/* ==========================================================================
   Design Architecture Variables & Reset
   ========================================================================== */
   :root {
    --primary-blue: #0f3d6c;
    --secondary-blue: #547799;
    --bg-light: #fbfbfb;
    --text-dark: #2b3a4a;
    --white: #ffffff;
    --border-color: #e2e8f0;
    --input-bg: #ffffff;
    --transition-smooth: cubic-bezier(0.25, 1, 0.5, 1);
}

[data-theme="dark"] {
    --bg-light: #0d1622;
    --text-dark: #e2e8f0;
    --white: #132033;
    --border-color: #23354f;
    --input-bg: #1a2a42;
    --secondary-blue: #7ca3cc;
}

html {
    scroll-behavior: smooth;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Navigation Header Architecture
   ========================================================================== */
.main-header {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(15, 61, 108, 0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
}

[data-theme="dark"] .main-header {
    background-color: rgba(19, 32, 51, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-container {
    max-width: 1250px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
}

.logo-link { text-decoration: none; display: inline-block; }
.logo-wrapper { display: flex; align-items: center; height: 82px; }
.brand-logo { height: 100%; width: auto; object-fit: contain; }

.nav-menu-wrapper { display: flex; align-items: center; gap: 35px; }
.nav-links { display: flex; list-style: none; gap: 28px; align-items: center; }

.nav-links a.nav-item {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 15px;
    padding: 8px 0;
    position: relative;
    opacity: 0.85;
}

.nav-links a.nav-item::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-blue);
    transform-origin: bottom right;
    transition: transform 0.3s var(--transition-smooth);
}

[data-theme="dark"] .nav-links a.nav-item::after { background-color: var(--secondary-blue); }
.nav-links a.nav-item:hover::after, .nav-links a.nav-item.active::after { transform: scaleX(1); transform-origin: bottom left; }
.nav-links a.nav-item:hover, .nav-links a.nav-item.active { opacity: 1; color: var(--primary-blue); }
[data-theme="dark"] .nav-links a.nav-item:hover, [data-theme="dark"] .nav-links a.nav-item.active { color: var(--secondary-blue); }

.theme-switch-btn {
    background: rgba(15, 61, 108, 0.05);
    border: 1px solid rgba(15, 61, 108, 0.08);
    width: 38px; height: 38px; border-radius: 50%;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    color: var(--primary-blue);
}
.theme-switch-btn svg { width: 18px; height: 18px; }
.theme-switch-btn .sun-icon { display: none; }
.theme-switch-btn .moon-icon { display: block; }
[data-theme="dark"] .theme-switch-btn { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.1); color: var(--secondary-blue); }
[data-theme="dark"] .theme-switch-btn .sun-icon { display: block; }
[data-theme="dark"] .theme-switch-btn .moon-icon { display: none; }

.mobile-nav-toggle { display: none; }

/* ==========================================================================
   Hero Section & Pure CSS Cross-Fade Carousel Architecture (TIMING INCREASED)
   ========================================================================== */
.hero {
    position: relative;
    color: #ffffff;
    padding: 140px 24px;
    text-align: center;
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-carousel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transform: scale(1.04);
    /* Cycle timing increased to 24s total for a more subtle backdrop transition */
    animation: smoothCrossFade 24s linear infinite; 
}

.slide-1 {
    background-image: url('../assets/1.png');
}
.slide-2 {
    background-image: url('../assets/2.png');
    animation-delay: 12s; /* Delays exactly 50% through the new 24s track timeline */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(15, 61, 108, 0.90), rgba(19, 32, 51, 0.85));
    z-index: 2;
}

.hero-content {
    position: relative;
    max-width: 850px;
    width: 100%;
    z-index: 3;
}

.hero h1 { font-size: 46px; margin-bottom: 24px; font-weight: 700; line-height: 1.25; letter-spacing: -0.5px; text-shadow: 0 2px 10px rgba(0,0,0,0.15); }
.hero p { font-size: 19px; margin-bottom: 40px; opacity: 0.9; max-width: 700px; margin-left: auto; margin-right: auto; text-shadow: 0 1px 5px rgba(0,0,0,0.15); }
.hero-actions { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }

/* Readjusted keyframes mapping to cleanly space out transitions across 24s */
@keyframes smoothCrossFade {
    0% { opacity: 0; transform: scale(1.04); }
    4% { opacity: 1; }
    46% { opacity: 1; }
    50% { opacity: 0; transform: scale(1.0); }
    100% { opacity: 0; }
}

.cta-btn, .btn-secondary {
    padding: 12px 28px; border-radius: 6px; font-weight: 600; text-decoration: none; font-size: 15px; display: inline-block;
}
.cta-btn { background-color: var(--primary-blue); color: #ffffff !important; }
.cta-btn:hover { background-color: var(--secondary-blue); }
.btn-secondary { background-color: transparent; border: 2px solid rgba(255,255,255,0.4); color: #ffffff; }
.btn-secondary:hover { background-color: #ffffff; color: var(--primary-blue); border-color: #ffffff; }

/* ==========================================================================
   Layout Modules & Services Grid 
   ========================================================================== */
.container { max-width: 1200px; margin: 0 auto; padding: 90px 24px; scroll-margin-top: 80px; }
.section-title { color: var(--primary-blue); font-size: 36px; margin-bottom: 24px; font-weight: 700; }
.section-title.center-title { text-align: center; margin-bottom: 45px; }
[data-theme="dark"] .section-title { color: var(--secondary-blue); }
.section-subtitle { font-size: 18px; max-width: 850px; margin: 0 auto; line-height: 1.7; opacity: 0.95; text-align: center; }
.section-subtitle a {
    color: inherit;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid currentColor;
}
.section-subtitle a:hover { opacity: 0.85; }

.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; align-items: stretch; }
.services-block {
    background: var(--white); padding: 35px 30px; border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.02); border-top: 5px solid var(--secondary-blue);
    display: flex; flex-direction: column;
}

.services-block.portal-block { border-top-color: var(--primary-blue); }
[data-theme="dark"] .services-block.portal-block { border-top-color: #4a90e2; }

.block-header { margin-bottom: 20px; }
.services-block h3 { color: var(--primary-blue); margin-bottom: 12px; font-size: 21px; font-weight: 700; line-height: 1.3; }
[data-theme="dark"] .services-block h3 { color: #ffffff; }
.block-intro { font-size: 14px; color: var(--secondary-blue); font-weight: 500; line-height: 1.5; }

.service-list { list-style-type: none; margin-top: 10px; }
.service-list li { padding: 12px 0; border-bottom: 1px solid var(--border-color); position: relative; padding-left: 24px; font-size: 14px; line-height: 1.5; }
.service-list li:last-child { border-bottom: none; }
.service-list li::before { content: "✓"; color: var(--secondary-blue); position: absolute; left: 2px; font-weight: bold; }
.services-block.portal-block .service-list li::before { color: var(--primary-blue); }
[data-theme="dark"] .services-block.portal-block .service-list li::before { color: #4a90e2; }

/* Location Card Component */
.location-card { background: var(--white); padding: 45px; border-radius: 12px; border-left: 6px solid var(--primary-blue); box-shadow: 0 10px 30px rgba(0,0,0,0.02); }
.location-card h2 { color: var(--primary-blue); margin-bottom: 15px; font-size: 28px; }
[data-theme="dark"] .location-card h2 { color: var(--secondary-blue); }

/* Contact Us Form Architecture */
.contact-wrapper { background-color: var(--white); padding: 45px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.02); max-width: 800px; margin: 0 auto; }
.contact-form .form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.form-group { margin-bottom: 24px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 14px; }
.form-group input, .form-group textarea {
    width: 100%; padding: 14px 16px; border: 1px solid var(--border-color);
    background-color: var(--input-bg); color: var(--text-dark); border-radius: 6px;
    font-size: 15px; outline: none;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--secondary-blue); box-shadow: 0 0 0 3px rgba(84, 119, 153, 0.15); }
.btn-submit { background-color: var(--primary-blue); color: #ffffff; border: none; padding: 16px 30px; border-radius: 6px; font-size: 16px; font-weight: 600; cursor: pointer; width: 100%; }
.btn-submit:hover { background-color: var(--secondary-blue); }
.form-feedback { display: none; margin-top: 20px; padding: 15px; border-radius: 6px; font-size: 14px; }
.form-feedback.success { background-color: #e6f4ea; color: #137333; border: 1px solid #c2e7cc; }
[data-theme="dark"] .form-feedback.success { background-color: #132d1b; color: #81c784; border-color: #1b4d29; }
.form-feedback.error { background-color: #fde8e8; color: #b42318; border: 1px solid #f5b8b8; }
[data-theme="dark"] .form-feedback.error { background-color: #3a1616; color: #ff8a80; border-color: #7f2d2d; }

/* Animations Framework */
.section-animate { opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--transition-smooth), transform 0.8s var(--transition-smooth); }
.section-animate.visible { opacity: 1; transform: translateY(0); }

/* Footer */
footer { background-color: var(--primary-blue); color: #ffffff; padding: 45px 24px; border-top: 1px solid rgba(255,255,255,0.05); }
.footer-container { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 24px; }
.footer-info p { opacity: 0.8; font-size: 14px; margin-top: 4px; }
.footer-info a {
    color: inherit;
    text-decoration: none;
}
.footer-info a:hover { text-decoration: underline; }
.footer-copy p { font-size: 14px; opacity: 0.6; }

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES (FULL BREAKPOINT CORRECTIONS)
   ========================================================================== */
@media (max-width: 1100px) {
    .services-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 992px) {
    .hero h1 { font-size: 38px; }
    .container { padding: 70px 24px; }
}

@media (max-width: 768px) {
    .mobile-nav-toggle {
        display: flex; flex-direction: column; justify-content: space-between;
        width: 24px; height: 18px; background: none; border: none; cursor: pointer; z-index: 1010;
    }
    .hamburger-bar { width: 100%; height: 2px; background-color: var(--text-dark); transition: all 0.3s ease; transform-origin: left center; }
    
    .mobile-nav-toggle.active .hamburger-bar:nth-child(1) { transform: rotate(45deg) translateY(-2px); }
    .mobile-nav-toggle.active .hamburger-bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
    .mobile-nav-toggle.active .hamburger-bar:nth-child(3) { transform: rotate(-45deg) translateY(2px); }

    .nav-menu-wrapper {
        position: fixed; top: 0; right: -100%; width: 280px; height: 100vh;
        background-color: var(--white); box-shadow: -10px 0 30px rgba(0,0,0,0.05);
        flex-direction: column; justify-content: flex-start; align-items: flex-start;
        padding: 100px 32px 40px; gap: 40px; visibility: hidden;
        transition: right 0.4s var(--transition-smooth), visibility 0.4s;
    }
    .nav-menu-wrapper.open { right: 0; visibility: visible; }
    .nav-links { flex-direction: column; align-items: flex-start; gap: 24px; width: 100%; }
    .nav-links a.nav-item { font-size: 18px; width: 100%; display: block; }

    .hero { padding: 100px 20px; }
    .hero h1 { font-size: 32px; }
    .hero p { font-size: 17px; }
    .section-title { font-size: 28px; }
    
    .services-grid { grid-template-columns: 1fr; gap: 24px; }
    .services-block { padding: 30px 20px; }
    .contact-wrapper { padding: 30px 20px; }
    .contact-form .form-row { grid-template-columns: 1fr; gap: 0; }
    .footer-container { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
    .logo-wrapper { height: 56px; }
    .hero h1 { font-size: 28px; }
    .hero-actions { flex-direction: column; width: 100%; }
    .hero-actions a { width: 100%; text-align: center; }
    .location-card { padding: 30px 20px; }
}
