
/*
========================================
SETUP: Reset, Fonts, and Variables
========================================
*/

/* --- CSS Reset & Scroll Behavior --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-padding-top: 80px; /* Offset for fixed header when navigating */
}

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&family=Roboto+Mono:wght@400;500&display=swap');

/* --- Root Variables --- */
:root {
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Poppins', sans-serif;
    --font-code: 'Roboto Mono', monospace;
    --primary-purple: #8a2be2;
    --hover-purple: #9b5ae7;
    --accent-cyan: #00e6e6;
    --primary-purple-rgb: 138, 43, 226;
}

/*
========================================
COLOR THEMES: Dark & Light Mode
========================================
*/

/* --- Dark Mode (Default) --- */
body, body.dark-mode {
    --bg-color: #0a192f;
    --header-bg: rgba(10, 25, 47, 0.85);
    --text-primary: #ccd6f6;
    --text-secondary: #8892b0;
    --card-bg: #112240;
    --shadow-color: rgba(2, 12, 27, 0.7);
    --border-color: #233554;
}

/* --- Light Mode --- */
body.light-mode {
    --bg-color: #f8f9fa;
    --header-bg: rgba(255, 255, 255, 0.85);
    --text-primary: #2c3e50;
    --text-secondary: #5a6a7a;
    --card-bg: #ffffff;
    --shadow-color: rgba(100, 100, 111, 0.2);
    --border-color: #e0e6ed;
}

/* --- General Body & Element Styling --- */
html, body {
    overflow-x: hidden;
    height: 100%;
}

body {
    background-color: var(--bg-color);
    color: var(--text-secondary);
    font-family: var(--font-body);
    line-height: 1.7;
    transition: background-color 0.4s ease, color 0.4s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4 {
    color: var(--text-primary);
    font-family: var(--font-heading);
}

section {
    padding: 100px 0;
}

h2 {
    font-size: clamp(2rem, 5vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 50px;
    text-align: center;
    position: relative;
    padding-bottom: 20px;
}

/* Decorative underline for section titles */
h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-purple), var(--accent-cyan));
    border-radius: 2px;
}

.section-intro {
    max-width: 700px;
    margin: -30px auto 50px;
    text-align: center;
    font-size: 1.1em;
}

/* CORRECTED: Subheading color in dark mode */
.dark body .section-intro {
    color: #a0aec0; /* A slightly brighter gray for better readability */
}


/*
========================================
HEADER & NAVIGATION
========================================
*/
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 15px 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--header-bg); /* CORRECTED: Was '---border-colo' */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

.header.header-scrolled {
    box-shadow: 0 5px 15px var(--shadow-color);
}

.header.header-hidden {
    transform: translateY(-100%);
}

.navbar {
    display: flex;
    gap: 30px;
}

.nav-link {
    font-size: 1em;
    font-weight: 600;
    padding: 5px 0;
    position: relative;
    color: var(--text-primary); /* CORRECTED: Was an invalid linear-gradient */
    text-decoration: none;
}

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

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

.header-right-controls {
    position: fixed;
    right: 24px;
    top: 200px;
    transform: none;
    z-index: 1060;
}

.header-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.control-btn {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--primary-purple);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px var(--shadow-color);
}

.control-btn:hover {
    background-color: var(--primary-purple);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(var(--primary-purple-rgb), 0.4);
}

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

/*
========================================
HERO SECTION
========================================
*/
.hero-section {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 20px;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient( to top, rgba(10, 25, 47, 0.85) 0%, rgba(10, 25, 47, 0.55) 40%, rgba(10, 25, 47, 0.35) 70%, rgba(10, 25, 47, 0.25) 100% );
    z-index: -1;
}

.hero-video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: -2;
    filter: brightness(0.5) contrast(1.03);
}

body.light-mode .hero-section::before {
    background: linear-gradient( to top, rgba(6, 8, 12, 0.65) 0%, rgba(6, 8, 12, 0.45) 40%, rgba(6, 8, 12, 0.25) 70%, rgba(6, 8, 12, 0.12) 100% );
}

.hero-content h1 {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}

.hero-content p {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    color: #fff;
    margin-bottom: 30px;
    font-family: var(--font-code);
}

#typing-text {
    background: linear-gradient(90deg, var(--primary-purple), var(--accent-cyan));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 500;
}

.social-links-std a {
    color: var(--primary-purple);
    background-color: #fff;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2em;
    transition: all .3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
     text-decoration: none; /* Add this line */
}

.social-links-std a:hover {
    background-color: var(--primary-purple);
    color: #fff;
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 6px 16px rgba(var(--primary-purple-rgb), 0.3);
}

.cta-button {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 1em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all .3s ease;
    margin-top: 20px;
    cursor: pointer;
    background: linear-gradient(90deg, var(--primary-purple), var(--hover-purple));
    color: #fff !important;
    border: none;
    box-shadow: 0 5px 15px rgba(var(--primary-purple-rgb), 0.4);
     text-decoration: none; /* Add this line */
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(var(--primary-purple-rgb), 0.5);
}

.hero-section .cta-button {
    animation: pulse 2s infinite;
}

/*
========================================
ABOUT SECTION
========================================
*/
.interactive-bio {
    max-width: 800px;
    margin: 0 auto;
    display: grid;
    gap: 20px;
}

.bio-panel {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all .3s ease;
}

.bio-panel.active {
    border-left: 4px solid var(--primary-purple);
}

.panel-header {
    padding: 20px 25px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 1.2em;
}

.panel-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.panel-icon {
    transition: transform .3s ease;
}

.bio-panel.active .panel-icon {
    transform: rotate(180deg);
}

.panel-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height .5s ease-out, padding .5s ease-out;
    padding: 0 25px;
    font-size: 0.95em;
}

.bio-panel.active .panel-content {
    max-height: 500px;
    padding: 0 25px 25px 25px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.skill-card {
    background-color: rgba(var(--primary-purple-rgb), 0.08);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px 10px;
    text-align: center;
    font-size: 0.9em;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: all .3s ease;
}

.skill-card:hover {
    transform: translateY(-5px);
    background-color: rgba(var(--primary-purple-rgb), 0.15);
    border-color: var(--primary-purple);
}

.skill-card i {
    font-size: 1.8em;
    color: var(--primary-purple);
}

.show-more-btn {
    background-color: transparent;
    color: var(--primary-purple);
    border: 2px solid var(--primary-purple);
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    margin-top: 20px;
    font-family: var(--font-heading);
    font-weight: bold;
    transition: all 0.3s ease;
}

.show-more-btn:hover {
    background-color: var(--primary-purple);
    color: #fff;
}


/*
========================================
PROJECTS & GALLERY SECTIONS
========================================
*/
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

#all-projects {
    display: none;
}

#all-projects.is-open {
    display: block;
}

.project-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px -5px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px -5px var(--shadow-color);
}

.project-card img, .project-card video, .project-card iframe {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    border: none;
    border-bottom: 1px solid var(--border-color);
}

.project-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 25px;
}

.project-content h3 {
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.project-content p {
    flex-grow: 1;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.project-links {
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 15px;
    justify-content: center;
}

.project-link {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: .9em;
    font-weight: 600;
    transition: all .3s ease;
    background-color: var(--primary-purple);
    color: #fff !important;
     text-decoration: none; /* Add this line */
}

.project-link:hover {
    background-color: var(--hover-purple);
}

.project-link.disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
}

/*
========================================
CASE STUDY SECTION
========================================
*/
.case-study-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: center;
}

.case-study-image, .case-study-details {
    flex: 1;
    min-width: 320px;
}

.carousel-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px var(--shadow-color);
}

.carousel-slides {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.carousel-slide {
    width: 100%;
    flex-shrink: 0;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(10, 25, 47, 0.6);
    color: #fff;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 1.5em;
    z-index: 10;
    border-radius: 5px;
    transition: background-color .3s ease;
}
.carousel-btn:hover { background: rgba(10, 25, 47, 0.9); }
.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }

.carousel-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color .3s ease, transform 0.3s ease;
}
.dot.active {
    background-color: var(--accent-cyan);
    transform: scale(1.2);
}

.case-study-stepper {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.step-number {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    border: 2px solid var(--border-color);
    background-color: var(--bg-color);
    transition: all .3s ease;
}

.step-title {
    font-weight: 600;
}

.step-connector {
    flex-grow: 1;
    height: 2px;
    background-color: var(--border-color);
}

.step-item.active .step-number {
    background-color: var(--primary-purple);
    border-color: var(--primary-purple);
    color: #fff;
}

.step-item.active .step-title {
    color: var(--primary-purple);
}

.case-study-panel {
    display: none;
    border: 1px solid var(--border-color);
    padding: 25px;
    border-radius: 8px;
}
.case-study-panel.active {
    display: block;
}

/*
========================================
CONTACT SECTION
========================================
*/
.contact-card {
    display: flex;
    flex-wrap: wrap;
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    max-width: 900px;
    margin: 0 auto;
    box-shadow: 0 10px 30px var(--shadow-color);
}
.contact-image-side { flex: 1; min-width: 300px; }
.contact-image-side img { width: 100%; height: 100%; object-fit: cover; }
.contact-details-side { flex: 1.5; padding: 50px; min-width: 300px; }
.contact-details-side h2 { text-align: left; }
.contact-details-side h2::after { left: 0; transform: translateX(0); }

/*
========================================
FOOTER
========================================
*/
.footer {
    position: relative;
    padding: 80px 20px 30px;
    text-align: center;
    background-color: #0d0d2b;
    color: var(--text-secondary);
    margin: 0;
    padding-bottom: 20px;
}
.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('images/footer-bg.png');
    background-size: 300px;
    opacity: 0.05;
    z-index: 1;
}
.footer-content, .footer-bottom { position: relative; z-index: 2; }
.footer-content h3 { color: #fff; font-size: 2em; }
.footer-social { margin: 30px 0; display: flex; justify-content: center; gap: 28px; }
.footer-social a {
    color: #fff;
    background-color: transparent;
    border: 2px solid var(--primary-purple);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2em;
    transition: all .3s ease;
}
.footer-social a:hover { background-color: var(--primary-purple); transform: translateY(-5px); }
.footer-nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 20px 30px; margin-bottom: 40px; }
.footer-nav a { color: var(--text-secondary); font-weight: 600; }
.footer-nav a:hover { color: var(--accent-cyan); }
.footer-bottom { border-top: 1px solid var(--border-color); padding-top: 30px; margin-top: 30px; }

/*
========================================
UTILITIES & ANIMATIONS
========================================
*/
.animate-on-scroll { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.animate-on-scroll.is-visible { opacity: 1; transform: translateY(0); }
/* ========================================
   BACK TO TOP BUTTON (Corrected Specificity)
   ======================================== */

/* By adding 'body >', this selector is now more specific */
.back-to-top-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    background: linear-gradient(45deg, #8a2be2, #9b5ae7);
    color: #fff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(138, 43, 226, 0.4);
    
    /* Hide by default */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
}

 .back-to-top-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(138, 43, 226, 0.5);
}
/*
========================================
RESPONSIVE DESIGN
========================================
*/
@media (max-width: 768px) {
    .header {
        justify-content: flex-end;
        padding: 15px 20px;
    }
    .navbar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        padding-top: 70px;
        background-color: var(--header-bg);
        flex-direction: column;
        align-items: center;
        box-shadow: 0 5px 15px var(--shadow-color);
        z-index: 998;
        transform: translateY(-100%);
        transition: transform 0.4s ease;
    }
    .navbar.active {
        transform: translateY(0);
        display: flex;
    }
    .mobile-menu-toggle {
        display: flex;
        background: transparent;
        border: none;
        color: var(--text-primary);
        font-size: 1.5rem;
        cursor: pointer;
        z-index: 1100;
        padding: 5px;
    }
    .header-right-controls {
        position: absolute;
        top: 64px;
        left: 349px;
        right: 0;
        margin: 0 auto;
        display: flex;
        justify-content: center;
        gap: 12px;
        padding: 8px 12px;
        z-index: 1105;
        pointer-events: auto;
        background: transparent;
    }
    .navbar {
        padding-top: 120px;
    }
    .header-right-controls .control-btn {
        width: 36px;
        height: 36px;
        font-size: 0.95em;
    }
}

/* Ensure page fills viewport and footer sits at bottom */
html, body {
    height: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

.lightbox-modal {
    box-sizing: border-box;
    overflow: hidden;
}



.section-cta {
    max-width: 800px;
    margin: 60px auto 0;
    padding: 30px 20px;
    border-radius: 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.section-cta p {
    font-size: 1.2em;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.section-cta .cta-button {
    margin-top: 0;
}

body.dark-mode .section-cta {
    background: radial-gradient(circle, rgba(var(--primary-purple-rgb), 0.1) 0%, transparent 80%);
}

body.light-mode .section-cta {
    background: radial-gradient(circle, rgba(var(--primary-purple-rgb), 0.05) 0%, transparent 80%);
}

.social-links-std {
    display: flex;
    gap: 24px;
    justify-content: center;
}

.footer-social {
    margin: 30px 0;
    display: flex;
    justify-content: center;
    gap: 28px;
}

/* Illustrations - more "disruptive" layout and lightbox styles */
.illustrations-section .projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 28px;
    align-items: start;
    perspective: 1200px;
}

.project-card img.illustration-thumb {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    object-fit: cover;
    transition: transform .36s cubic-bezier(.2,.9,.2,1), box-shadow .36s;
    box-shadow: 0 14px 34px rgba(3,10,20,0.45);
    cursor: pointer;
    transform-origin: center;
    will-change: transform;
}

.project-card:nth-child(3n+1) img.illustration-thumb { transform: rotate(-6deg) translateY(0); }
.project-card:nth-child(3n+2) img.illustration-thumb { transform: rotate(4deg) translateY(0); }
.project-card:nth-child(3n)  img.illustration-thumb { transform: rotate(-2deg) translateY(0); }

.project-card:hover img.illustration-thumb {
    transform: rotate(0deg) scale(1.03);
    box-shadow: 0 28px 60px rgba(2,8,20,0.6);
}

.project-card .project-content { transition: transform .36s; }
.project-card:hover .project-content { transform: translateY(-6px); }

/* Lightbox modal */
.lightbox-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(6,8,12,0.85);
    z-index: 6000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
}

.lightbox-modal.open {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-img {
    max-width: 92%;
    max-height: 92%;
    border-radius: 10px;
    box-shadow: 0 40px 90px rgba(0,0,0,0.7);
    transform: translateY(6px) scale(.99);
    transition: transform .22s ease;
}

.lightbox-modal.open .lightbox-img {
    transform: translateY(0) scale(1);
}

.lightbox-close {
    position: absolute;
    top: 18px;
    right: 20px;
    background: transparent;
    color: #fff;
    font-size: 34px;
    line-height: 1;
    border: none;
    cursor: pointer;
    z-index: 6100;
    padding: 6px 10px;
}

@media (max-width: 720px) {
    .project-card:nth-child(3n+1) img.illustration-thumb,
    .project-card:nth-child(3n+2) img.illustration-thumb,
    .project-card:nth-child(3n) img.illustration-thumb {
        transform: rotate(0deg);
    }
    .illustrations-section .projects-grid { gap: 18px; }
}

.section-cta .cta-button,
.section-cta .cta-button:link,
.section-cta .cta-button:visited,
.section-cta .cta-button:hover,
.section-cta .cta-button:active,
.section-cta .cta-button:focus {
    text-decoration: none !important;
    -webkit-text-decoration-skip-ink: auto;
    text-decoration-skip-ink: auto;
    outline: none;
}

.section-cta a {
    text-decoration: none !important;
}

/* AI Videos — horizontal snap gallery */
.ai-snap-wrap {
  margin: 24px 0 40px;
  overflow: hidden;
  position: relative;
  padding: 20px 0;
}

.ai-snap-track {
  display: flex;
  gap: 28px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 12px;
  -webkit-overflow-scrolling: touch;
}

.ai-card {
  scroll-snap-align: center;
  flex: 0 0 72%;
  max-width: 720px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.06));
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(2,8,20,0.6);
  transform-style: preserve-3d;
  transition: transform .35s cubic-bezier(.2,.9,.2,1), box-shadow .35s;
  position: relative;
  padding: 12px;
  display: flex;
  gap: 14px;
  align-items: center;
}

.ai-card:hover {
  transform: translateY(-8px) rotateX(2deg) scale(1.02);
  box-shadow: 0 30px 80px rgba(2,8,20,0.75);
}

.ai-media {
  flex: 0 0 55%;
  height: 320px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  background: #000;
  display: grid;
  place-items: center;
}

.ai-media iframe,
.ai-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ai-caption {
  flex: 1 1 40%;
  padding: 6px 10px;
}

.ai-caption h3 { margin: 0 0 8px; font-size: 1.2rem; color: var(--text-primary); }
.ai-caption p { margin: 0; font-size: .98rem; color: var(--text-secondary); }

.ai-card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none; /* CORRECTED: Was missing value */
}

.ai-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
}
.ai-nav-btn {
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    font-size: 22px;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background .18s, transform .12s;
}
.ai-nav-btn:hover { background: rgba(0,0,0,0.72); transform: translateY(-2px); }
.ai-nav-btn:focus { outline: 3px solid rgba(138,43,226,0.12); outline-offset: 4px; }
/* ===================================
   AI Gallery Pagination Dots
   =================================== */

/* The container for the dots */
.ai-pagination {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Default style for an inactive dot (a small pill) */
.ai-pagination .ai-dot {
    width: 20px; /* Width of the pill */
    height: 6px;  /* Height of the pill */
    background: var(--border-color); /* Uses your theme's border color */
    border-radius: 3px; /* Makes the ends rounded */
    transition: all 0.4s cubic-bezier(.2, .9, .2, 1); /* Smooth animation */
    cursor: pointer;
    border: none; /* Remove default button border */
    padding: 0;
}

/* Add a subtle hover effect for inactive dots */
.ai-pagination .ai-dot:hover {
    background: var(--text-secondary);
}

/* Style for the currently active dot */
.ai-pagination .ai-dot.active {
    width: 40px; /* Expands to be longer */
    background: var(--primary-purple); /* Uses your theme's accent color */
    box-shadow: 0 0 10px rgba(var(--primary-purple-rgb), 0.5); /* Adds a nice glow */
}

@media (max-width: 820px) {
  .ai-card { flex: 0 0 86%; max-width: 86%; }
}

.ai-snap-track { outline: none; }
.ai-snap-track:focus { box-shadow: 0 0 0 4px rgba(138,43,226,0.06); border-radius: 12px; }


/*
===================================
Music Choice Modal Styles
===================================
*/
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 25, 47, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.modal-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    transform: scale(0.95);
    transition: transform 0.4s ease;
}

.modal-overlay.visible .modal-content {
    transform: scale(1);
}

#music-modal-title {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 30px;
}

.modal-choices {
    display: flex;
    gap: 15px;
}
#upload-music-btn {
    cursor: pointer;
}

.hidden {
    display: none !important;
}
  
/* ===================================
   Language Toggle Styles
   =================================== */

.language-toggle-container {
    position: relative; /* This is crucial for positioning the dropdown */
}

/* Style the box that Google creates */
#google_translate_element {
    position: absolute;
    top: 120%; /* Position it just below the button */
    right: 0;
    z-index: 1100; /* Ensure it appears above other header content */
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px; /* Added some padding */
    box-shadow: 0 5px 15px var(--shadow-color);

    /* --- NEW styles for vertical layout --- */
    width: 200px; /* Give it a fixed width */
    max-height: 300px; /* Limit the height */
    overflow-y: auto; /* Allow scrolling if there are many languages */
    
    /* Hide by default */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

/* Show the dropdown when the button is clicked */
.language-toggle-container.dropdown-active #google_translate_element {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Hide the default Google Translate branding */
.goog-te-gadget-simple {
    background-color: transparent !important;
    border: none !important;
}
.goog-te-gadget-icon,
.VIpgJd-ZVi9od-l4eHX-hSRGPd {
    display: none !important;
}

/* ===================================
   AI Videos Section - Mobile Layout
   =================================== */

@media (max-width: 768px) {
    /* Change the instructional text on mobile */
    #ai-videos .section-intro {
        content: "Exploring creative storytelling through AI.";
    }

    /* Convert the horizontal track to a vertical grid */
    .ai-snap-track {
        display: grid;
        grid-template-columns: 1fr; /* A single column */
        gap: 25px;                 /* Space between cards */
        overflow-x: hidden;        /* Remove horizontal scrollbar */
        scroll-snap-type: none;    /* Disable snapping */
    }

    /* Adjust each card for the vertical layout */
    .ai-card {
        flex: 0 0 100%;             /* Make cards take full width */
        flex-direction: column;    /* Stack the video/image and text vertically */
        scroll-snap-align: none;   /* No snapping needed */
    }
    
    /* Ensure the media and caption fill the card's width */
    .ai-media,
    .ai-caption {
       flex-basis: auto;
       width: 100%;
    }
    
    /* Give the video a consistent height on mobile */
    .ai-media {
       height: 200px;
    }
    
    /* Adjust caption padding for the new layout */
    .ai-caption {
       padding: 20px 15px;
       text-align: center;
    }

    /* Hide the desktop navigation buttons (prev/next) on mobile */
    .ai-controls {
        display: none;
    }
}
