/* --- Custom Properties & General Styles --- */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --bg-body: #f8f9fa;
    --text-main: #2c3e50;
    --nav-bg: rgba(255, 255, 255, 0.95);
    --nav-shadow: 0 4px 20px rgba(44, 62, 80, 0.1);
    --modal-bg: #ffffff;
    --border-color: #ecf0f1;
    --card-hover: #f1f3f4;
    --success-color: #27ae60;
    --warning-color: #f1c40f;

    /* Dark Mode Defaults (same as dashboard.css) */
    --dark-bg-body: #0f172a;
    --dark-bg-card: #111827;
    --dark-bg-hover: #1f2937;
    --dark-text-main: #f9fafb;
    --dark-text-secondary: #9ca3af;
    --dark-text-muted: #6b7280;
    --dark-border-color: #374151;
    --dark-primary-color: #60a5fa;
    --dark-primary-hover: #3b82f6;
    --dark-primary-light: #1e3a8a;
    --dark-success-color: #34d399;
    --dark-danger-color: #f87171;
    --dark-warning-color: #f59e0b;
    --dark-info-color: #22d3ee;
}

body[data-theme="dark"] {
    --bg-body: var(--dark-bg-body);
    --text-main: var(--dark-text-main);
    --primary-color: var(--dark-primary-color);
    --secondary-color: var(--dark-primary-hover);
    --nav-bg: rgba(15, 23, 42, 0.95);
    --nav-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    --modal-bg: var(--dark-bg-card);
    --border-color: var(--dark-border-color);
    --card-hover: var(--dark-bg-hover);
    --success-color: var(--dark-success-color);
    --warning-color: var(--dark-warning-color);
}

/* Specific Dark Mode overrides for sections */
body[data-theme="dark"] .hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7); /* Darker overlay for dark mode */
    z-index: 1;
}

body[data-theme="dark"] .hero-content {
    position: relative;
    z-index: 2;
}

body[data-theme="dark"],
body[data-theme="dark"] .legacy-section,
body[data-theme="dark"] .departments-section {
    background-color: var(--bg-body) !important;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    transition: background-color 0.3s, color 0.3s;
}

/* --- Header & Navigation --- */
header {
    padding-top: 15px;
    background-color: transparent;
    position: absolute;
    width: 100%;
    z-index: 100;
    transition: top 0.4s ease-in-out;
}

.navbar {
    background-color: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    box-shadow: var(--nav-shadow);
    padding: 0.75rem 2rem;
    margin: 0 2%;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.navbar-brand {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 40px;
    margin-right: 10px;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-text strong {
    font-size: 1rem;
    color: var(--text-main);
}

.logo-text span {
    font-size: 0.7rem;
    color: var(--text-main);
    opacity: 0.7;
}

.nav-link {
    color: var(--text-main);
    font-weight: 600;
    margin: 0 0.5rem;
}

.nav-link.active, .nav-link:hover {
    color: var(--primary-color);
}

.btn-login {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.6rem 1.4rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.navbar-toggler {
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
}
.navbar-toggler:focus {
    box-shadow: none;
}

/* --- Theme Switcher --- */
.theme-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.theme-switcher .fas {
    color: var(--text-main);
}
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

[data-theme="dark"] .slider {
    background: linear-gradient(135deg, #374151, #4b5563);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

[data-theme="dark"] .slider:before {
    background: linear-gradient(135deg, #1f2937, #374151);
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    border: 1px solid var(--dark-border-color);
}

input:checked + .slider {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}
input:checked + .slider:before {
    transform: translateX(26px);
}
.slider.round {
    border-radius: 34px;
}
.slider.round:before {
    border-radius: 50%;
}


/* --- Hero Section --- */
.hero-section {
    background-image: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url(img/llvvgate.jpg);
    background-size: cover;
    background-position: center;
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

.hero-content h1 {
    font-weight: 800;
    font-size: 3rem;
    max-width: 700px;
    margin: 0 auto 1.5rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.5px;
}

.hero-content h2 {
    font-weight: 400;
    font-size: 1.75rem;
    margin-bottom: 2.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.btn-apply, .btn-learn {
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 700;
    border: 2px solid;
    margin: 0 0.75rem;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-apply {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 6px 20px rgba(44, 62, 80, 0.3);
}

.btn-apply:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(44, 62, 80, 0.4);
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
}

.btn-learn {
    background-color: transparent;
    border-color: rgba(255, 255, 255, 0.8);
    color: white;
    backdrop-filter: blur(5px);
}

.btn-learn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: white;
    transform: translateY(-2px);
}

/* --- Other Sections --- */
.legacy-section, .departments-section {
    padding: 4rem 0;
}

.department-card {
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    background-color: var(--modal-bg);
    color: var(--text-main);
    overflow: hidden;
    position: relative;
}

[data-theme="dark"] .department-card {
    background: linear-gradient(180deg, var(--dark-bg-card) 0%, #0b1220 100%);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}
.department-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}
.department-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}
.department-card:hover::before {
    transform: scaleX(1);
}

.btn-about {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-weight: 700;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 25px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(44, 62, 80, 0.2);
}

.btn-about:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(44, 62, 80, 0.3);
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
}

.map-section iframe {
    width: 100%;
    height: 70vh;
}

/* --- Footer --- */
.footer {
    background-color: var(--modal-bg);
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-color);
    transition: background-color 0.3s, border-color 0.3s;
}

[data-theme="dark"] .footer {
    background: linear-gradient(180deg, var(--dark-bg-card) 0%, #0b1220 100%);
}

.footer-logo img { height: 30px; }
.footer-logo span { font-weight: 600; margin-left: 10px; color: var(--text-main); }
.footer-icons a { color: var(--text-main); font-size: 1.2rem; margin: 0 0.7rem; }
.btn-contact { background-color: #28a745; color: white; font-weight: 600; }

.footer-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* --- Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: flex-start; /* Align to top to allow for padding as margin */
    justify-content: center;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 40px 10px; /* Space at top and bottom */
    overflow-y: auto; /* Enable scrolling for long forms */
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: var(--modal-bg);
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transform: scale(0.95);
    transition: transform 0.3s ease, background-color 0.3s;
    display: none;
}

[data-theme="dark"] .modal-container {
    background: linear-gradient(180deg, var(--dark-bg-card) 0%, #0b1220 100%);
    border: 1px solid var(--dark-border-color);
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: border-color 0.3s;
}
.modal-header h2, .modal-header h5 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}
.modal-body { padding: 1.5rem; }

#requirementsModal .modal-body {
    padding: 1rem;
    overflow-y: auto;
    font-size: 0.9rem;
    margin: 0;
    max-height: 60vh;
}

#requirementsModal .modal-container {
    max-height: 90vh;
    overflow: visible;
    width: 95%;
    margin: 10px 10px 30px 10px;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    transition: border-color 0.3s;
}

[data-theme="dark"] .modal-footer {
    background-color: #0b1220;
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    color: #6c757d;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.close-modal-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.modal-footer .btn {
    padding: 0.85rem 1.75rem;
    font-size: 1rem;
    border-radius: 10px;
    min-width: 140px;
    transition: all 0.3s ease;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-footer .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.modal-footer .btn-secondary {
    background: linear-gradient(135deg, #6c757d, #495057);
    border-color: #495057;
    color: white;
}

.modal-footer .btn-secondary:hover {
    background: linear-gradient(135deg, #495057, #6c757d);
}

.modal-footer .btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(44, 62, 80, 0.3);
}

.modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    box-shadow: 0 6px 20px rgba(44, 62, 80, 0.4);
}

.btn-admin-login {
    background: transparent;
    border-radius: 999px;
    border: 1px solid var(--text-main);
    color: var(--text-main);
    font-weight: 700;
    padding: 0.45rem 1.1rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.btn-admin-login:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #ffffff;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(44, 62, 80, 0.3);
}

.form-step { display: none; }
.form-step.active { display: block; }

.modal-actions {
    margin-top: 20px;
    text-align: right;
}

.tracking-code-display {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    background-color: var(--bg-body);
    padding: 10px;
    border: 1px dashed var(--text-main);
    text-align: center;
    margin: 20px 0;
}

/* Ensure modals are hidden by default */
.modal-container {
    display: none;
}
#trackingCodeDisplay {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-right: 10px;
    display: flex;
}
#copyCodeBtn {
    background: none;
    border: none;
    color: #6c757d;
}

/* --- Application Form Modal Enhancements --- */
#applicationFormModal .modal-container {
    max-width: 700px;
    width: 95%;
}

.form-progress {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.step.active {
    opacity: 1;
    color: var(--primary-color);
}

.step.completed {
    opacity: 1;
    color: var(--success-color);
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--border-color);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.step.active .step-number {
    background-color: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.step.completed .step-number {
    background-color: var(--success-color);
    color: white;
}

.step-label {
    font-size: 0.8rem;
    text-align: center;
    font-weight: 600;
}

.progress-bar {
    height: 6px;
    background-color: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.5s ease;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.form-actions .btn {
    min-width: 120px;
    padding: 0.75rem 1.5rem;
    font-weight: 700;
}

.prev-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.prev-btn:hover {
    background-color: var(--border-color);
    transform: translateY(0);
}

.next-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    color: white;
}

.next-btn:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    transform: translateY(0);
}

.signature-pad-container {
    border: 1px solid var(--text-main);
    border-radius: .25rem;
    position: relative;
    background-color: #fff; /* Keep white for signature */
    height: 200px; /* Default height */
}

#signature-pad {
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.signature-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.signature-actions .btn {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    border-radius: 6px;
    font-weight: 600;
}

.form-text {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.invalid-feedback {
    display: none;
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.was-validated .form-control:invalid ~ .invalid-feedback,
.was-validated .form-select:invalid ~ .invalid-feedback {
    display: block;
}

.was-validated .form-control:valid {
    border-color: #28a745;
}

.was-validated .form-control:invalid {
    border-color: #dc3545;
}

/* Mobile-specific enhancements for the application form */
@media (max-width: 768px) {
    body {
        font-size: 14px;
        line-height: 1.4;
    }

    /* Navigation */
    .navbar {
        padding: 0.75rem 1rem;
        margin: 0 2%;
    }
    
    .logo-img {
        height: 35px;
        margin-right: 8px;
    }
    
    .logo-text strong {
        font-size: 0.95rem;
    }
    
    .logo-text span {
        font-size: 0.65rem;
    }
    
    .nav-link {
        font-size: 0.9rem;
        margin: 0 0.25rem;
        padding: 0.5rem 0.75rem;
    }
    
    .btn-login {
        padding: 0.4rem 1rem;
        font-size: 0.85rem;
    }

    /* Hero Section */
    .hero-section {
        height: 55vh;
        padding: 2rem 0;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
        margin-bottom: 0.75rem;
        line-height: 1.2;
    }
    
    .hero-content h2 {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
        line-height: 1.3;
    }
    
    .hero-buttons {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        width: 90%;
        margin: 0 auto;
    }
    
    .btn-apply, .btn-learn {
        padding: 0.75rem 2.5rem;
        font-size: 1rem;
        width: 100%;
        margin: 0;
        border-radius: 0.75rem;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        white-space: normal;
        line-height: 1.2;
    }

    /* Content Sections */
    .legacy-section, .departments-section {
        padding: 2.5rem 0;
    }
    
    .legacy-section h2, .departments-section h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
        text-align: center;
    }
    
    .department-card {
        margin-bottom: 1.5rem;
        padding: 1.5rem;
    }
    
    .btn-about {
        padding: 0.6rem 1.25rem;
        font-size: 0.9rem;
    }

    /* Map Section */
    .map-section iframe {
        height: 50vh;
    }

    /* Footer */
    .footer {
        padding: 2rem 0;
    }
    
    .footer-logo span {
        font-size: 0.9rem;
    }
    
    .footer-icons a {
        font-size: 1.1rem;
        margin: 0 0.5rem;
    }
    
    .btn-contact {
        padding: 0.5rem 1.25rem;
        font-size: 0.9rem;
    }

    /* Modals - Fixed for top/bottom margins */
    .modal-overlay {
        padding: 20px 10px; /* Base padding */
        align-items: flex-start;
    }

    .modal-container {
        width: 95%;
        margin: 20px auto; /* Explicit margin for top and bottom */
        border-radius: 12px;
        max-height: none; 
        overflow: visible;
    }
    
    #applicationFormModal .modal-container {
        width: 95%;
        margin: 30px auto; /* More margin for the long application form */
        max-height: none;
        overflow: visible;
    }
    
    .form-progress {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }
    
    .progress-steps {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .step {
        width: 100%;
        flex-direction: row;
        justify-content: flex-start;
        opacity: 0.7;
    }
    
    .step.active {
        opacity: 1;
    }
    
    .step-number {
        margin-right: 1rem;
        margin-bottom: 0;
        width: 30px;
        height: 30px;
    }
    
    .step-label {
        text-align: left;
        font-size: 0.9rem;
    }
    
    .progress-bar {
        margin-top: 0.5rem;
        height: 4px;
    }
    
    .form-actions {
        flex-direction: column-reverse;
        gap: 0.75rem;
        margin-top: 1.5rem;
        padding-top: 1rem;
    }
    
    .form-actions .btn {
        width: 100%;
        min-width: auto;
        margin: 0;
    }
    
    .signature-pad-container {
        height: 150px;
    }
    
    .signature-actions {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .row {
        margin: 0 -0.5rem;
    }
    
    .col-md-4, .col-md-6 {
        padding: 0 0.5rem;
        margin-bottom: 1rem;
    }
    
    .modal-body {
        padding: 1rem 0.75rem;
    }
    
    .form-step h5 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .modal-header {
        padding: 0.85rem 1rem;
    }
    
    .modal-header h2, .modal-header h5 {
        font-size: 1.1rem;
    }
    
    .modal-footer {
        padding: 0.85rem 1rem;
        flex-direction: row;
        justify-content: flex-end;
        gap: 0.6rem;
    }
    
    .modal-footer .btn {
        min-width: 80px;
        padding: 0.55rem 1rem;
        font-size: 0.85rem;
        border-radius: 8px;
    }
    
    .tracking-code-display {
        font-size: 1.3rem;
        padding: 8px;
        border-radius: 8px;
    }
    
    .form-step {
        padding: 0 0.4rem;
    }
    
    .form-group {
        margin-bottom: 0.8rem;
    }
    
    .form-label {
        font-size: 0.85rem;
        margin-bottom: 0.4rem;
        display: block;
    }
    
    .form-control {
        font-size: 0.9rem;
        padding: 0.65rem;
        border-radius: 8px;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 0.65rem 1rem;
        border-radius: 8px;
    }
    
    .container {
        padding: 0 0.8rem;
    }
    
    .container-fluid {
        padding: 0 0.8rem;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 13px;
        line-height: 1.5;
    }
    
    /* Navigation */
    .navbar {
        padding: 0.5rem 0.75rem;
        margin: 0 1%;
    }
    
    .logo-text strong {
        font-size: 0.85rem;
    }
    
    .logo-text span {
        font-size: 0.6rem;
    }
    
    .nav-link {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
    }
    
    .btn-login {
        padding: 0.35rem 0.85rem;
        font-size: 0.8rem;
    }

    /* Hero Section */
    .hero-section {
        height: 50vh;
        padding: 1.5rem 0;
    }
    
    .hero-content h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .hero-content h2 {
        font-size: 0.95rem;
        margin-bottom: 1.25rem;
    }
    
    .btn-apply, .btn-learn {
        padding: 0.75rem 2.25rem;
        font-size: 0.95rem;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        white-space: normal;
        line-height: 1.2;
    }

    /* Content Sections */
    .legacy-section, .departments-section {
        padding: 2rem 0;
    }
    
    .legacy-section h2, .departments-section h2 {
        font-size: 1.25rem;
        margin-bottom: 1.25rem;
    }
    
    .department-card {
        padding: 1.25rem;
        margin-bottom: 1.25rem;
    }
    
    .btn-about {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    /* Map Section */
    .map-section iframe {
        height: 40vh;
    }

    /* Footer */
    .footer {
        padding: 1.5rem 0;
    }
    
    .footer-logo span {
        font-size: 0.85rem;
    }
    
    .footer-icons a {
        font-size: 1rem;
        margin: 0 0.4rem;
    }
    
    .btn-contact {
        padding: 0.45rem 1rem;
        font-size: 0.85rem;
    }

    /* Modals */
    .modal-container {
        width: 96%;
        margin: 15px auto; /* Margin at top/bottom for very small mobile */
        border-radius: 10px;
    }

    #applicationFormModal .modal-container {
        margin: 20px auto;
    }
    
    .modal-header {
        padding: 0.75rem 0.85rem;
    }
    
    .modal-header h2, .modal-header h5 {
        font-size: 1rem;
    }
    
    .modal-body {
        padding: 0.85rem;
    }
    
    .modal-footer {
        padding: 0.75rem 0.85rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-footer .btn {
        width: 100%;
        font-size: 0.85rem;
        padding: 0.5rem 0.85rem;
        min-width: auto;
        border-radius: 6px;
    }
    
    .modal-footer .btn-secondary, .modal-footer .btn-primary {
        width: 100%;
        margin-bottom: 0.4rem;
    }
    
    .modal-footer .btn:last-child {
        margin-bottom: 0;
    }
    
    .tracking-code-display {
        font-size: 1.1rem;
        padding: 6px;
        border-radius: 6px;
    }
    
    .form-group {
        margin-bottom: 0.6rem;
    }
    
    .form-label {
        font-size: 0.8rem;
        margin-bottom: 0.35rem;
    }
    
    .form-control {
        font-size: 0.85rem;
        padding: 0.55rem;
        border-radius: 6px;
    }
    
    .btn {
        font-size: 0.85rem;
        padding: 0.55rem 0.85rem;
        border-radius: 6px;
    }
    
    /* Application Form specific adjustments for small screens */
    .step-number {
        width: 25px;
        height: 25px;
        font-size: 0.8rem;
    }
    
    .step-label {
        font-size: 0.8rem;
    }
    
    .signature-pad-container {
        height: 120px;
    }
    
    .form-actions {
        margin-top: 1rem;
        padding-top: 0.75rem;
        gap: 0.5rem;
    }
    
    .form-actions .btn {
        padding: 0.65rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Progress Steps */
    .progress-step::after {
        font-size: 0.65rem;
        top: 22px;
        width: 70px;
    }
    
    /* Cards and Grids */
    .row {
        margin: 0 -0.4rem;
    }
    
    .col-md-4, .col-md-6 {
        padding: 0 0.4rem;
        margin-bottom: 1rem;
    }
    
    /* Spacing adjustments */
    .container {
        padding: 0 0.6rem;
    }
    
    .container-fluid {
        padding: 0 0.6rem;
    }
    
    /* Additional mobile-specific adjustments */
    .text-center {
        text-align: center;
    }
    
    .text-start {
        text-align: left;
    }
    
    .text-end {
        text-align: right;
    }
}
