/*
* File: style.css
* Description: Stylesheet for the Trading Education Website.
* Design System: Retro with Asymmetrical Balance
* Color Scheme: Complementary (Deep Blue & Vibrant Orange)
* Animation Style: Bouncy/Elastic
*/

/* -------------------------------------------------- */
/*                      1. ROOT VARIABLES               */
/* -------------------------------------------------- */
:root {
    /* Color Palette (Complementary) */
    --primary-color: #0d1b2a; /* Deep, dark blue */
    --secondary-color: #1b263b; /* Slightly lighter dark blue */
    --accent-color: #ff9900; /* Vibrant retro orange */
    --accent-color-dark: #e68a00;
    
    --text-light: #f0f0f0; /* Off-white for better readability on dark backgrounds */
    --text-dark: #333333;
    --text-muted: #8d99ae;

    --bg-light: #ffffff;
    --bg-dark: #132235; /* Dark section background */

    --border-color: #415a77;
    --shadow-color: rgba(0, 0, 0, 0.1);

    /* Typography */
    --font-heading: 'Manrope', sans-serif;
    --font-body: 'Rubik', sans-serif;
    
    /* Spacing & Layout */
    --header-height: 80px;
    --container-padding: 1.5rem;
    --section-padding-y: 6rem;
    --card-border-radius: 12px;
    
    /* Animation */
    --transition-bouncy: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    --transition-smooth: all 0.3s ease-in-out;
}

/* -------------------------------------------------- */
/*                      2. GLOBAL STYLES                */
/* -------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 800;
    line-height: 1.2;
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.05);
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.25rem; }

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: var(--transition-smooth);
}

a:hover {
    color: var(--accent-color-dark);
}

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

/* -------------------------------------------------- */
/*                  3. UTILITY CLASSES                */
/* -------------------------------------------------- */
.container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

.section-padding {
    padding-top: var(--section-padding-y);
    padding-bottom: var(--section-padding-y);
}

.section-padding-dark {
    padding-top: var(--section-padding-y);
    padding-bottom: var(--section-padding-y);
    background-color: var(--bg-dark);
    color: var(--text-light);
}

.section-padding-dark h2,
.section-padding-dark h3,
.section-padding-dark h4 {
    color: var(--text-light);
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.section-title {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title-left {
    text-align: left;
    margin-bottom: 2rem;
}

.section-subtitle {
    text-align: center;
    max-width: 700px;
    margin: -3rem auto 4rem auto;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.section-padding-dark .section-subtitle {
    color: var(--text-light);
    opacity: 0.8;
}

/* -------------------------------------------------- */
/*               4. GLOBAL COMPONENTS                 */
/* -------------------------------------------------- */
/* --- Buttons --- */
.button-primary, .button-secondary, .button-nav {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 50px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition-bouncy);
    user-select: none;
}

.button-primary {
    background-color: var(--accent-color);
    color: var(--primary-color);
    border-color: var(--accent-color);
}

.button-primary:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 20px rgba(255, 153, 0, 0.3);
    color: var(--primary-color);
}

.button-secondary {
    background-color: transparent;
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.button-secondary:hover {
    background-color: var(--accent-color);
    color: var(--primary-color);
    transform: scale(1.05);
}

/* --- Cards --- */
.card {
    background-color: var(--bg-light);
    border-radius: var(--card-border-radius);
    box-shadow: 0 8px 30px var(--shadow-color);
    overflow: hidden;
    transition: var(--transition-bouncy);
    display: flex;
    flex-direction: column;
    text-align: center;
}

.card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.section-padding-dark .card {
    background-color: var(--secondary-color);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.card-image {
    width: 100%;
    height: 250px; /* Fixed height for consistency */
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease-out;
}

.card:hover .card-image img {
    transform: scale(1.1);
}

.card-content {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* --- Forms --- */
.contact-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background-color: transparent;
    color: var(--text-dark);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: var(--transition-smooth);
}

.section-padding-dark .form-group input,
.section-padding-dark .form-group textarea,
.section-padding-dark .form-group select {
    color: var(--text-light);
    border-color: var(--text-muted);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    color: var(--text-muted);
    pointer-events: none;
    transition: var(--transition-smooth);
    background-color: var(--bg-light);
    padding: 0 5px;
}

.section-padding-dark .form-group label {
    background-color: var(--bg-dark);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
.form-group input:not(:placeholder-shown),
.form-group textarea:not(:placeholder-shown) {
    outline: none;
    border-color: var(--accent-color);
}

.form-group input:focus + label,
.form-group textarea:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:not(:placeholder-shown) + label {
    top: -0.75rem;
    left: 0.75rem;
    font-size: 0.85rem;
    color: var(--accent-color);
}

.contact-form button {
    width: 100%;
    margin-top: 1rem;
}

/* -------------------------------------------------- */
/*                  5. HEADER & NAVIGATION            */
/* -------------------------------------------------- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 0;
    transition: var(--transition-smooth);
    background-color: rgba(13, 27, 42, 0.8);
    backdrop-filter: blur(10px);
}

.site-header.scrolled {
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

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

.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-light);
}

.logo-accent {
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-light);
    font-weight: 500;
    position: relative;
    padding: 5px 0;
}

.nav-links a:not(.button-nav)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: var(--transition-smooth);
}

.nav-links a:not(.button-nav):hover::after {
    width: 100%;
}

.button-nav {
    padding: 8px 22px;
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.button-nav:hover {
    background-color: var(--accent-color);
    color: var(--primary-color);
}

.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(--text-light);
    margin: 5px 0;
    transition: var(--transition-smooth);
}

/* -------------------------------------------------- */
/*                  6. SECTION STYLES                 */
/* -------------------------------------------------- */

/* --- Hero Section --- */
.hero-section {
    position: relative;
    height: 100vh;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, rgba(13, 27, 42, 0.8) 0%, rgba(13, 27, 42, 0.4) 100%);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
}

.hero-title {
    color: #FFFFFF;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    margin-bottom: 1.5rem;
    text-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    max-width: 800px;
    margin: 0 auto 2.5rem auto;
    color: #FFFFFF;
    opacity: 0.9;
}

/* --- Features Section --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card .card-icon {
    color: var(--accent-color);
    margin-bottom: 1.5rem;
}

.feature-card .card-icon svg {
    animation: bounce 2s infinite ease-in-out;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-20px);}
    60% {transform: translateY(-10px);}
}


/* --- Courses Section --- */
.slider-container {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 90%;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 2rem;
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

.slider-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.course-card {
    text-align: left;
}

.course-card .card-content {
    justify-content: space-between;
}

/* --- Gallery Section --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 250px;
    grid-auto-flow: dense;
    gap: 1rem;
}

.gallery-item {
    overflow: hidden;
    border-radius: var(--card-border-radius);
    box-shadow: 0 5px 15px var(--shadow-color);
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-bouncy);
}
.gallery-item:hover img {
    transform: scale(1.1);
}

/* Asymmetrical Layout for Gallery */
.gallery-item:nth-child(1) { grid-column: span 1; grid-row: span 2; }
.gallery-item:nth-child(2) { grid-column: span 2; grid-row: span 2; }
.gallery-item:nth-child(3) { grid-column: span 2; grid-row: span 1; }
.gallery-item:nth-child(4) { grid-column: span 1; grid-row: span 1; }

/* --- News Section --- */
.news-container {
    display: grid;
    gap: 2rem;
}

.news-article {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
}

.news-article:last-child {
    border-bottom: none;
}

.news-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.read-more {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--accent-color);
    display: inline-block;
    margin-top: 1rem;
}

.read-more:hover {
    text-decoration: underline;
}

/* --- Partners Section --- */
.partners-logo-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4rem;
}

.partner-logo img {
    max-height: 50px;
    filter: grayscale(100%) opacity(0.6);
    transition: var(--transition-smooth);
}

.partner-logo:hover img {
    filter: grayscale(0%) opacity(1);
}

/* --- Community Section --- */
.community-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}
.community-image img {
    border-radius: var(--card-border-radius);
    box-shadow: -20px 20px 0 var(--accent-color);
}

/* --- Careers Section --- */
.careers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.career-path {
    padding: 2rem;
    border-left: 4px solid var(--accent-color);
    background-color: #f9f9f9;
    border-radius: 0 var(--card-border-radius) var(--card-border-radius) 0;
    transition: var(--transition-smooth);
}

.career-path:hover {
    transform: translateX(10px);
    box-shadow: 5px 5px 20px var(--shadow-color);
}

/* --- External Resources Section --- */
.resources-list {
    display: grid;
    gap: 1.5rem;
}
.resource-item {
    background-color: var(--secondary-color);
    padding: 1.5rem;
    border-radius: var(--card-border-radius);
    transition: var(--transition-smooth);
}
.resource-item:hover {
    transform: scale(1.03);
    background-color: #2a3b4d;
}
.resource-item h4 a {
    color: var(--text-light);
}
.resource-item p {
    color: var(--text-muted);
    margin-bottom: 0;
}

/* -------------------------------------------------- */
/*                         7. FOOTER                  */
/* -------------------------------------------------- */
.site-footer-dark {
    background-color: var(--primary-color);
    color: var(--text-light);
    padding-top: 4rem;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}

.footer-container h4 {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    position: relative;
}
.footer-container h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 40px;
    height: 3px;
    background-color: var(--accent-color);
}

.footer-about p {
    color: var(--text-muted);
}

.footer-links ul, .footer-legal ul, .footer-social ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links ul li, .footer-legal ul li, .footer-social ul li {
    margin-bottom: 0.75rem;
}

.footer-links a, .footer-legal a, .footer-social a {
    color: var(--text-muted);
}

.footer-links a:hover, .footer-legal a:hover, .footer-social a:hover {
    color: var(--accent-color);
    padding-left: 5px;
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    margin-top: 3rem;
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* -------------------------------------------------- */
/*           8. PAGE SPECIFIC & TRANSITIONS           */
/* -------------------------------------------------- */
/* --- Success, Privacy, Terms pages --- */
.centered-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 100vh;
    padding: var(--container-padding);
}
.centered-page h1 {
    color: var(--primary-color);
}

.static-page-content {
    padding-top: calc(var(--header-height) + 4rem);
    padding-bottom: var(--section-padding-y);
    min-height: 80vh;
}
.static-page-content h1 {
    margin-bottom: 2rem;
}
.static-page-content h2 {
    margin-top: 3rem;
    margin-bottom: 1rem;
}

/* --- Barba.js Page Transitions --- */
.barba-leave-active,
.barba-enter-active {
    transition: opacity 0.5s;
}
.barba-leave-to,
.barba-enter-from {
    opacity: 0;
}

/* -------------------------------------------------- */
/*                  9. MEDIA QUERIES                  */
/* -------------------------------------------------- */

/* --- Tablet (up to 992px) --- */
@media (max-width: 992px) {
    h1 { font-size: 2.8rem; }
    h2 { font-size: 2.2rem; }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 220px;
    }
    
    .community-content-wrapper {
        grid-template-columns: 1fr;
    }
    .community-image {
        order: -1; /* Move image to top */
        margin-bottom: 2rem;
    }
    .community-image img {
        box-shadow: 0px 20px 0 var(--accent-color);
    }
    .section-title-left {
        text-align: center;
    }
}

/* --- Mobile (up to 768px) --- */
@media (max-width: 768px) {
    :root {
        --section-padding-y: 4rem;
    }
    
    /* --- Mobile Navigation --- */
    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        background-color: var(--primary-color);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2.5rem;
        transform: translateX(100%);
        transition: transform 0.4s ease-in-out;
        z-index: 1000;
    }
    .nav-links.active {
        transform: translateX(0);
    }
    .nav-links 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);
    }

    /* --- General Mobile Layout --- */
    .form-grid {
        grid-template-columns: 1fr;
    }
    .gallery-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 250px;
    }
    .gallery-item:nth-child(n) { /* Reset grid spans for mobile */
        grid-column: span 1;
        grid-row: span 1;
    }
    .footer-container {
        text-align: center;
    }
    .footer-container h4::after {
        left: 50%;
        transform: translateX(-50%);
    }
}