/* Professional Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
}

:root {
    --dagupan-blue: #0038A8;
    --dagupan-red: #CE1126;
    --text-dark: #1a1a1a;
    --text-muted: #666;
    --white: #ffffff;
}

html, body {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Navbar Styling */
.navbar {
    height: 75px;
    background: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    border-bottom: 3px solid var(--dagupan-blue);
    z-index: 10;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.city-logo { height: 50px; }

.brand-name {
    font-size: 1.1rem;
    color: var(--dagupan-blue);
    letter-spacing: 0.5px;
}

.system-time {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Hero Section with Bridge Background */
.hero-section {
    position: relative;
    flex-grow: 1;
    background: url('img/pantal_bridge.jpeg') no-repeat center center/cover;
    display: flex;
    align-items: center;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 56, 168, 0.2) 100%);
}

.container {
    position: relative;
    z-index: 2;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Left Content Content */
.content-left h1 {
    font-size: 3rem;
    color: var(--white);
    margin-bottom: 30px;
    line-height: 1.1;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.features {
    display: flex;
    gap: 30px;
}

.feature-item { text-align: center; color: var(--white); }

.icon-circle {
    width: 65px;
    height: 65px;
    background: var(--dagupan-red);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    margin: 0 auto 10px;
    box-shadow: 0 6px 20px rgba(36, 1, 116, 0.4);
}

.feature-item p { font-size: 0.75rem; font-weight: 700; letter-spacing: 1px; }

/* Professional Login Card */
.login-card {
    background: var(--white);
    padding: 40px;
    border-radius: 16px;
    width: 400px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.form-title {
    font-size: 1.75rem;
    color: var(--dagupan-blue);
    margin-bottom: 30px;
    text-align: center;
    font-weight: 800;
}

.input-wrapper { margin-bottom: 20px; }

.input-wrapper label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.label-row { display: flex; justify-content: space-between; align-items: center; }

.input-field {
    position: relative;
    display: flex;
    align-items: center;
}

.input-field i {
    position: absolute;
    left: 15px;
    color: var(--text-muted);
}

.input-field input {
    width: 100%;
    padding: 12px 12px 12px 45px;
    border: 1.5px solid #eee;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.input-field input:focus {
    border-color: var(--dagupan-blue);
    outline: none;
    background: #f8faff;
}

.forgot-link { font-size: 0.8rem; color: var(--dagupan-blue); text-decoration: none; font-weight: 600; }

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--dagupan-blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, background 0.3s;
    margin-top: 10px;
}

.btn-primary:hover { background: #002d86; transform: translateY(-1px); }

/* Divider */
.divider {
    text-align: center;
    margin: 25px 0;
    position: relative;
    border-bottom: 1px solid #eee;
    line-height: 0.1em;
}

.divider span { background: #fff; padding: 0 15px; color: var(--text-muted); font-size: 0.8rem; }

/* Social Buttons */
.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s;
}

.google { border: 1.5px solid #eee; color: #444; }
.google img { width: 18px; }
.google:hover { background: #f9f9f9; border-color: #ddd; }

.register-text { text-align: center; margin-top: 25px; font-size: 0.9rem; color: var(--text-muted); }
.register-text a { color: var(--dagupan-blue); font-weight: 700; text-decoration: none; }

/* Container for the input and icon */
.input-field {
    position: relative;
    display: flex;
    align-items: center;
}

/* Icon positioning inside the input */
.input-field i {
    position: absolute;
    left: 15px;
    color: #888;
    font-size: 0.9rem;
}

.input-field input {
    width: 100%;
    padding: 12px 12px 12px 42px; /* Extra left padding for the icon */
    border: 1.5px solid #eee;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s;
}

.input-field input:focus {
    border-color: var(--dagupan-blue);
}

/* Google Button Professional Styling */
.google {
    background: #ffffff;
    border: 1px solid #dadce0;
    color: #3c4043;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.google:hover {
    background-color: #f8f9fa;
    box-shadow: 0 1px 3px rgba(60,64,67,0.3);
}

.google img {
    width: 18px; /* Standard size for Google G logo */
    height: 18px;
}

/* Footer */
.footer {
    background: var(--text-muted);
    color: var(--white);
    padding: 20px 5%;
    flex-shrink: 0;
}

.footer-content { display: flex; justify-content: space-between; align-items: center; }
.footer-info p { font-size: 0.8rem; margin: 2px 0; opacity: 0.9; color: rgb(255, 255, 255); }
.footer-links a { color: rgb(255, 255, 255); text-decoration: none; margin-left: 20px; font-size: 0.8rem; font-weight: 600; opacity: 0.8; }
.footer-links a:hover { opacity: 1; }

/* --- Mobile Responsive Rules --- */

/* For Tablets and smaller (992px and down) */
@media (max-width: 992px) {
    html, body {
        height: auto;
        overflow-y: auto;
    }

    .container {
        flex-direction: column;
        justify-content: center;
        padding: 40px 20px;
    }

    .content-left {
        text-align: center;
        margin-bottom: 40px;
    }

    .content-left h1 {
        font-size: 2.2rem;
    }

    .login-card {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }
}

/* For Mobile Phones (576px and down) */
@media (max-width: 576px) {
    .navbar {
        padding: 0 15px;
        height: 65px;
    }

    .brand-name {
        font-size: 0.9rem;
    }

    .system-time {
        display: none; /* Hide time on very small screens to save space */
    }

    .content-left h1 {
        font-size: 1.8rem;
    }

    .features {
        gap: 15px;
    }

    .icon-circle {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .login-card {
        padding: 25px 20px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .footer-links a {
        margin: 0 10px;
    }
}

/* Alert Styling */
.error-alert {
    background: #fee2e2;
    color: #991b1b;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.85rem;
    text-align: center;
    border: 1px solid #fecaca;
}

/* Sidebar Link Hover Animation - Apply to all pages */
.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease; /* Smooth transition */
    position: relative;
    overflow: hidden;
}

.nav-link i { 
    margin-right: 12px; 
    width: 20px; 
    text-align: center; 
}

/* The "Apply ID" style animation for all navs */
.nav-link:hover {
    background: var(--primary-blue);
    color: white;
    transform: translateX(8px); /* The sliding effect you liked */
}

/* Active State */
.nav-link.active {
    background: var(--primary-blue);
    color: white;
}

@media (max-width: 992px) {
    .menu-toggle { 
        display: block !important; /* Shows the hamburger icon on mobile */
    }
    .sidebar { 
        transform: translateX(-100%); /* Hides sidebar by default */
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 80%; /* Takes up most of the screen on mobile */
        transition: transform 0.3s ease;
        box-shadow: 5px 0 15px rgba(0,0,0,0.3);
    }
    .sidebar.active { 
        transform: translateX(0); /* Slides sidebar in */
    }
    .main-content { 
        margin-left: 0 !important; /* Removes desktop margin */
        width: 100% !important; 
    }
}

/* Container for the details and QR code */
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 8pt;
    width: 100%; /* Ensures it spans the whole card width */
}

/* Forces the text container to take up available space but not push the QR */
.detail-item:first-child {
    flex: 1; 
    min-width: 0; /* Prevents long names from overflowing */
    padding-right: 10px;
}

/* Fixes the QR code area so it doesn't move */
.qr-side {
    flex-shrink: 0; /* Prevents the QR from being squeezed */
    width: 1.4cm;   /* Matches the QR image width */
    height: 1.4cm;
    text-align: right;
    position: relative;
}

.qr-side img {
    width: 1.4cm;
    height: 1.4cm;
    border: 0.5pt solid #eee;
    background: white;
    padding: 2px;
    /* Absolute anchor to the far right of its fixed container */
    position: absolute;
    right: 0; 
    bottom: 0;
}

/* Responsive container for the profile photo */
.profile-photo-container {
    width: 100%;
    max-width: 250px; /* Limits the size on mobile */
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    border: 3px solid var(--ph-blue);
}

.profile-photo-container img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Mobile-specific adjustment */
@media (max-width: 480px) {
    .profile-photo-container {
        max-width: 180px; /* Further reduces size for small phones */
    }
}