/* 
    Government Immigration Portal - High-Fidelity Design System
    Modeled after Australian Home Affairs UI
*/

:root {
    /* Colors */
    --primary-blue: #002664; /* Official Prussian Blue */
    --primary-dark: #001a4d;
    --accent-blue: #00adef;
    --accent-light: #f0f7ff;
    --bg-light: #f4f7fa;
    --text-dark: #1a1a1a;
    --text-light: #4d4d4d;
    --white: #ffffff;
    --border-color: #d1d5db;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 40px;
    --container-max: 1200px;

    /* Shadow */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.1);

    /* Fonts */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-serif: "Times New Roman", Times, serif; /* For official text if needed */
}

/* Official Government Branding Components */
.gov-header {
    background: var(--white);
    padding: 12px 0;
    border-bottom: 4px solid var(--primary-blue);
    position: relative;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.gov-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-lg);
}

.gov-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
}

.gov-logo img {
    height: 50px;
    width: auto;
}

.gov-logo-text {
    border-left: 1px solid var(--border-color);
    padding-left: 15px;
    color: var(--primary-blue);
}

.gov-logo-text span {
    display: block;
    line-height: 1.1;
}

.gov-logo-text .dept-name {
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gov-logo-text .gov-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-light);
    margin-top: 2px;
}

/* User Actions in Header */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-search-mini {
    display: flex;
    background: var(--bg-light);
    border-radius: 4px;
    padding: 4px 10px;
    border: 1px solid var(--border-color);
}

.header-search-mini input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    width: 140px;
}

.header-search-mini button {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.gov-footer {
    background: var(--primary-blue);
    color: white;
    padding: 60px 0 30px;
}

.acknowledgement-box {
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 30px;
    padding-bottom: 30px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.acknowledgement-text {
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.9;
}

.footer-bottom-grid {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-links a {
    color: white;
    text-decoration: none;
    font-size: 13px;
    margin-right: 20px;
    opacity: 0.7;
}

.footer-links a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Mobile Menu Toggle */
.mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 2000;
}

.hamburger {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--primary-blue);
    position: relative;
    transition: background 0.3s;
}

.hamburger::before, .hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 3px;
    background: var(--primary-blue);
    transition: transform 0.3s;
}

.hamburger::before { top: -8px; }
.hamburger::after { bottom: -8px; }

.mobile-toggle.active .hamburger {
    background: transparent;
}

.mobile-toggle.active .hamburger::before {
    transform: rotate(45deg) translate(5px, 6px);
}

.mobile-toggle.active .hamburger::after {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white);
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    color: var(--primary-dark);
    margin-bottom: var(--spacing-md);
    line-height: 1.2;
}

a {
    color: var(--primary-dark);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-blue);
    text-decoration: underline;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Layout */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-blue);
    color: white;
    padding: 8px;
    z-index: 100;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
}

/* Top Gov Bar */
.gov-bar {
    background-color: var(--primary-dark);
    color: var(--white);
    font-size: 12px;
    padding: var(--spacing-xs) 0;
}

.gov-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Header */
.header-main {
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--border-color);
    background: var(--white);
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-lg);
}

.logo-area a {
    display: flex;
    flex-direction: column;
    text-decoration: none;
}

.logo-text-top {
    font-size: 14px;
    color: var(--text-light);
    font-weight: bold;
}

.logo-text-main {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-dark);
    text-transform: uppercase;
    letter-spacing: -1px;
}

.header-search {
    flex-grow: 1;
    max-width: 500px;
    position: relative;
}

.search-input-wrapper {
    display: flex;
    border: 2px solid var(--primary-dark);
    border-radius: 4px;
    overflow: hidden;
}

.search-input-wrapper input {
    flex-grow: 1;
    padding: 10px 15px;
    border: none;
    outline: none;
    font-size: 16px;
}

.search-input-wrapper button {
    background: var(--primary-dark);
    color: white;
    border: none;
    padding: 0 20px;
    cursor: pointer;
    font-size: 20px;
}

/* Navigation */
.nav-primary {
    background: var(--white);
    border-bottom: 4px solid var(--primary-dark);
    position: relative;
    z-index: 900;
}

.nav-list {
    display: flex;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: block;
    padding: var(--spacing-md) var(--spacing-lg);
    font-weight: 600;
    color: var(--primary-dark);
    text-decoration: none;
    border-bottom: 4px solid transparent;
    margin-bottom: -4px;
}

.nav-link:hover, .nav-link.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
    background-color: var(--bg-light);
}

/* Mega Menu */
.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 600px;
    background: var(--white);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-lg);
    display: none;
    z-index: 1000;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
}

.nav-item:hover .mega-menu {
    display: grid;
}

.mega-menu h4 {
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: var(--spacing-xs);
}

.mega-menu ul li {
    margin-bottom: var(--spacing-xs);
}

.mega-menu ul li a {
    font-size: 14px;
    color: var(--text-dark);
}

/* Hero Section */
.hero {
    position: relative;
    background-color: var(--bg-light);
    min-height: 400px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    right: 0;
    width: 65%;
    height: 100%;
    object-fit: cover;
    clip-path: polygon(15% 0, 100% 0, 100% 100%, 0% 100%);
}

.hero-overlay {
    position: relative;
    width: 45%;
    background: var(--primary-dark);
    color: white;
    padding: var(--spacing-xl);
    z-index: 10;
    transform: skewX(-5deg);
    margin-left: -50px;
    padding-left: 100px;
}

.hero-content {
    transform: skewX(5deg);
}

.hero h1 {
    color: white;
    font-size: 42px;
    margin-bottom: var(--spacing-md);
}

.hero-nav {
    margin-top: var(--spacing-lg);
}

.hero-nav-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    color: white;
    font-weight: 500;
}

.hero-nav-item:hover {
    color: var(--accent-blue);
    text-decoration: none;
}

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin: var(--spacing-xl) 0;
}

.service-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    position: relative;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.service-card h3 {
    margin-bottom: var(--spacing-sm);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.service-card .arrow {
    color: var(--primary-dark);
    font-size: 20px;
}

/* News Section */
.news-section {
    background: var(--accent-blue);
    padding: var(--spacing-xl) 0;
    color: white;
}

.news-section h2 {
    color: white;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.news-card {
    background: var(--white);
    color: var(--text-dark);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.news-img {
    height: 180px;
    object-fit: cover;
}

.news-body {
    padding: var(--spacing-md);
}

.news-date {
    font-size: 12px;
    color: var(--text-light);
    font-weight: bold;
}

.news-title {
    font-size: 18px;
    margin: var(--spacing-sm) 0;
}

/* Footer */
footer {
    background: var(--primary-dark);
    color: white;
    padding: var(--spacing-xl) 0 var(--spacing-md);
}

.footer-top {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.footer-col h4 {
    color: white;
    font-size: 14px;
    text-transform: uppercase;
    margin-bottom: var(--spacing-md);
}

.footer-col ul li {
    margin-bottom: var(--spacing-sm);
}

.footer-col ul li a {
    color: rgba(255,255,255,0.7);
    font-size: 13px;
}

.footer-col ul li a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.footer-logo img {
    height: 60px;
    filter: brightness(0) invert(1);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 24px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-primary {
    background: var(--primary-dark);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-blue);
    text-decoration: none;
}

.btn-outline {
    border: 2px solid var(--primary-dark);
    background: transparent;
    color: var(--primary-dark);
}

.btn-outline:hover {
    background: var(--primary-dark);
    color: white;
    text-decoration: none;
}

/* Visa List Page Specifics */
.listing-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--spacing-xl);
    margin-top: var(--spacing-xl);
}

.sidebar {
    background: var(--bg-light);
    padding: var(--spacing-lg);
    border-radius: 4px;
    height: fit-content;
}

.filter-group {
    margin-bottom: var(--spacing-lg);
}

.filter-group h3 {
    font-size: 16px;
    margin-bottom: var(--spacing-sm);
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
}

/* Tabs System */
.tab-container {
    margin: var(--spacing-xl) 0;
}

.tab-list {
    display: flex;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    padding: var(--spacing-md) var(--spacing-lg);
    background: transparent;
    border: none;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 4px solid transparent;
}

.tab-btn.active {
    color: var(--primary-dark);
    border-bottom-color: var(--primary-dark);
}

.tab-content {
    display: none;
    padding: var(--spacing-xl) 0;
}

.tab-content.active {
    display: block;
}

/* Responsive */
@media (max-width: 992px) {
    .hero-bg {
        width: 100%;
        clip-path: none;
        opacity: 0.3;
    }
    .hero-overlay {
        width: 100%;
        margin-left: 0;
        padding-left: var(--spacing-xl);
        transform: none;
        background: rgba(0, 58, 108, 0.9);
    }
    .hero-content {
        transform: none;
    }
    .header-main .container {
        flex-direction: column;
        align-items: flex-start;
    }
    .header-search {
        width: 100%;
        max-width: none;
    }
    .listing-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 var(--spacing-md);
    }
    
    .mobile-toggle {
        display: block;
    }

    .nav-primary {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--white);
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        transition: right 0.3s ease;
        padding-top: 80px;
        border-bottom: none;
    }

    .nav-primary.active {
        right: 0;
    }

    .nav-list {
        flex-direction: column;
    }

    .nav-link {
        padding: 15px 25px;
        border-bottom: 1px solid var(--border-color);
        margin-bottom: 0;
    }

    .nav-link:hover, .nav-link.active {
        border-bottom-color: var(--border-color);
        background-color: var(--accent-light);
    }

    .mega-menu {
        position: static;
        width: 100%;
        box-shadow: none;
        padding: 15px 25px;
        grid-template-columns: 1fr;
        background: var(--bg-light);
    }

    .header-actions {
        display: none; /* Hide desktop specific actions, we'll put key ones in menu or simplify */
    }

    .gov-logo img {
        height: 40px;
    }

    .gov-logo-text .dept-name {
        font-size: 14px;
    }
    
    .gov-logo-text .gov-name {
        font-size: 9px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .hero-overlay {
        padding: var(--spacing-lg);
    }
}

@media (max-width: 480px) {
    .gov-header .container {
        gap: var(--spacing-sm);
    }
    
    .gov-logo {
        gap: 8px;
    }

    .gov-logo-text {
        padding-left: 8px;
    }

    .hero-nav-item {
        font-size: 14px;
    }

    .news-grid, .card-grid {
        grid-template-columns: 1fr;
    }
}

/* Application Form Specific Styles */
.app-container {
    max-width: 800px;
    margin: var(--spacing-xl) auto;
    padding: 0 var(--spacing-md);
}

.profile-upload-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: var(--spacing-lg);
    text-align: center;
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
}

.profile-upload-box {
    width: 120px;
    height: 120px;
    border: 2px dashed var(--accent-blue);
    border-radius: 50%;
    margin: 20px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.profile-upload-box:hover {
    background: var(--accent-light);
}

.profile-upload-box .icon {
    font-size: 24px;
    margin-bottom: 5px;
}

.form-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
}

.form-header {
    background: var(--primary-dark);
    color: var(--white);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.form-header .step-num {
    background: var(--white);
    color: var(--primary-dark);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-weight: 800;
    font-size: 14px;
}

.form-header h3 {
    color: var(--white);
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.form-body {
    padding: var(--spacing-lg);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

.form-full {
    grid-column: span 2;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 6px;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 15px;
    font-family: inherit;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    border-color: var(--accent-blue);
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-group input[type="file"] {
    padding: 8px 10px;
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.form-group input[type="file"]::-webkit-file-upload-button {
    background: #f1f3f4;
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 4px;
    margin-right: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.form-group input[type="file"]::-webkit-file-upload-button:hover {
    background: #e8eaed;
}

.radio-group {
    display: flex;
    gap: 20px;
    padding-top: 5px;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.form-footer {
    text-align: center;
    margin-top: var(--spacing-xl);
    padding-bottom: var(--spacing-xl);
}

.submit-btn {
    background: var(--primary-blue);
    color: white;
    font-size: 18px;
    padding: 15px 40px;
    border: none;
    border-radius: 100px;
    cursor: pointer;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.2s, background 0.2s;
}

.submit-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

@media (max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    .form-full {
        grid-column: span 1;
    }
}
