/* ==========================================================================
   1. CSS Variables & Global Styles
   ========================================================================== */

:root {
    /* Triadic Color Scheme */
    --color-primary: #007bff;        /* Vibrant Blue - Trust, Professionalism */
    --color-secondary: #ffc107;      /* Warm Amber - Optimism, Action */
    --color-accent: #17a2b8;         /* Cool Teal - Calm, Clarity */
    --color-primary-darker: #0056b3;
    
    /* Neutral & Text Colors */
    --color-text: #333333;
    --color-text-light: #f8f9fa;
    --color-heading: #222222;
    --color-bg-light: #ffffff;
    --color-bg-section-light: #f4f7f6;
    --color-bg-dark: #212529;

    /* Glassmorphism & Texture */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --backdrop-blur: blur(10px);

    /* Fonts */
    --font-heading: 'Roboto', sans-serif;
    --font-body: 'Lato', sans-serif;

    /* Sizing & Spacing */
    --header-height: 80px;
    --border-radius: 15px;
    --section-padding: 80px 0;
    --container-width: 1140px;
    --container-padding: 0 20px;

    /* Effects */
    --transition-morph: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    --box-shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.15);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg-light);
    color: var(--color-text);
    line-height: 1.7;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-heading);
    line-height: 1.3;
    margin-bottom: 0.75em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.05);
}

h1 { font-size: 3rem; font-weight: 900; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
}

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

a:hover {
    color: var(--color-primary-darker);
}

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

/* ==========================================================================
   2. Layout & Helpers
   ========================================================================== */

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: var(--container-padding);
}

.section-padding {
    padding: var(--section-padding);
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    color: var(--color-heading);
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: var(--color-primary);
    border-radius: 2px;
    margin: 15px auto 0;
}

.section-subtitle {
    text-align: center;
    max-width: 700px;
    margin: -30px auto 40px;
    color: #666;
    font-size: 1.1rem;
}

.section-bg-light {
    background-color: var(--color-bg-section-light);
}

.section-bg-texture {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.text-center { text-align: center; }

.parallax-bg {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
}

/* Page Transition Styles (for Barba.js) */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

.fade-out {
  animation: fadeOut 0.5s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ==========================================================================
   3. Header & Navigation
   ========================================================================== */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 15px 0;
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border-bottom: 1px solid var(--glass-border);
    transition: background 0.3s ease, padding 0.3s ease;
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--color-text-light);
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 30px;
}

.nav-menu a {
    color: var(--color-text-light);
    font-weight: 700;
    padding: 5px 0;
    position: relative;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.4);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-secondary);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease-out;
}

.nav-menu a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.burger-menu {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.burger-menu span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--color-text-light);
    margin: 5px 0;
    transition: all 0.3s ease;
}

/* ==========================================================================
   4. Hero Section
   ========================================================================== */

.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-text-light);
    position: relative;
    background-size: cover;
    background-position: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.7));
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero-title {
    font-size: 3.5rem;
    color: var(--color-text-light);
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 30px;
    color: var(--color-text-light);
    opacity: 0.9;
}

/* ==========================================================================
   5. Buttons & Forms (Global Styles)
   ========================================================================== */

.btn {
    display: inline-block;
    padding: 15px 35px;
    border-radius: 50px;
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    cursor: pointer;
    transition: var(--transition-morph);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-text-light);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
}

.btn-primary:hover {
    background-color: var(--color-primary-darker);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.5);
    color: var(--color-text-light);
}

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

.btn-secondary:hover {
    background-color: var(--color-primary);
    color: var(--color-text-light);
    transform: translateY(-3px);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    position: relative;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.8);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.contact-form label {
    position: absolute;
    top: 20px;
    left: 20px;
    color: #999;
    pointer-events: none;
    transition: all 0.3s ease;
}

.contact-form input:focus + label,
.contact-form input:not(:placeholder-shown) + label,
.contact-form textarea:focus + label,
.contact-form textarea:not(:placeholder-shown) + label {
    top: -10px;
    left: 15px;
    font-size: 0.8rem;
    color: var(--color-primary);
    background: var(--color-bg-light);
    padding: 0 5px;
}

/* ==========================================================================
   6. Cards (Global)
   ========================================================================== */

.card {
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 30px;
    text-align: center;
    box-shadow: var(--box-shadow);
    transition: var(--transition-morph);
    display: flex;
    flex-direction: column;
    align-items: center;
}

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

.card-image {
    margin-bottom: 20px;
    width: 100%;
    height: 200px; /* Fixed height for consistency */
    overflow: hidden;
    border-radius: var(--border-radius);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures image covers the area without distortion */
}

.card-content h4 {
    color: var(--color-heading);
    margin-bottom: 15px;
}

.card-content p {
    color: #555;
    font-size: 0.95rem;
}

/* ==========================================================================
   7. Section-Specific Styles
   ========================================================================== */

/* About Us Section */
.about-us-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}
.about-us-image-container {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}
.content-title {
    font-weight: 700;
    color: var(--color-heading);
}

/* Features, Services, Resources Grids */
.features-grid, .services-grid, .resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}
.features-grid .card { background: rgba(255, 255, 255, 0.7); }
.resource-card {
    background: #fff;
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition-morph);
}
.resource-card:hover { transform: translateY(-5px); box-shadow: var(--box-shadow-hover); }
.resource-card h4 { margin-top: 0; }
.resource-card a { text-decoration: none; color: var(--color-heading); }
.resource-card a:hover { color: var(--color-primary); }

/* Methodology Section */
.methodology-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    text-align: center;
}
.step-icon {
    width: 60px;
    height: 60px;
    line-height: 60px;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-text-light);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 20px;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.4);
}

/* Gallery Section */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}
.gallery-item {
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease;
}
.gallery-item:hover { transform: scale(1.05); }

/* Vision Section */
.vision-section {
    color: var(--color-text-light);
    padding: 120px 0;
    text-align: center;
}
.vision-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 90, 179, 0.7), rgba(0, 40, 80, 0.9));
}
.vision-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}
.vision-title { color: var(--color-text-light); text-shadow: 1px 1px 5px rgba(0,0,0,0.5); }

/* Contact Section on Index & Contact Page */
.contact-form-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--color-bg-light);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}
.contact-page-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: start;
}
.contact-details {
    background: var(--color-bg-section-light);
    padding: 30px;
    border-radius: var(--border-radius);
}

/* ==========================================================================
   8. Footer
   ========================================================================== */

.site-footer {
    background-color: var(--color-bg-dark);
    color: rgba(255, 255, 255, 0.7);
    padding: 60px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-col h4 {
    color: var(--color-text-light);
    margin-bottom: 20px;
}

.footer-col ul {
    list-style: none;
}

.footer-col a {
    color: rgba(255, 255, 255, 0.7);
    display: inline-block;
    padding: 5px 0;
    transition: color 0.3s, transform 0.3s;
}

.footer-col a:hover {
    color: var(--color-secondary);
    transform: translateX(5px);
}

.footer-bottom {
    padding: 20px 0;
    text-align: center;
    font-size: 0.9rem;
}

/* ==========================================================================
   9. Specific Pages (Success, Privacy, Terms)
   ========================================================================== */
.page-title {
    text-align: center;
}
.text-content {
    padding-top: calc(var(--header-height) + 40px);
    max-width: 800px;
    margin: 0 auto;
}
.text-content h1, .text-content h2 { margin-top: 2rem; }

.success-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - var(--header-height) * 2); /* Full viewport minus header/footer */
}

/* ==========================================================================
   10. Responsive Design
   ========================================================================== */

@media (max-width: 992px) {
    .about-us-grid, .contact-page-grid {
        grid-template-columns: 1fr;
    }
    .about-us-image-container {
        order: -1; /* Image appears on top */
    }
}

@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    .hero-title { font-size: 2.8rem; }
    
    .nav-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.95);
        backdrop-filter: var(--backdrop-blur);
        -webkit-backdrop-filter: var(--backdrop-blur);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: left 0.5s cubic-bezier(0.77, 0, 0.175, 1);
        gap: 40px;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu a {
        font-size: 1.5rem;
    }
    
    .burger-menu {
        display: block;
    }

    .burger-menu.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .burger-menu.active span:nth-child(2) {
        opacity: 0;
    }
    .burger-menu.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
}