/* Design System - Future Editorial */
:root {
    /* Colors - Abyssal Teal Theme */
    --color-bg: #021a1e;
    --color-surface: rgba(10, 45, 50, 0.4);
    --color-surface-hover: rgba(20, 60, 65, 0.6);
    --color-surface-active: rgba(30, 70, 75, 0.8);

    --color-text-primary: #e0faff;
    --color-text-secondary: #8daab0;
    --color-text-muted: #4a656a;

    /* Accents - Coral & Electric Cyan */
    --color-accent: #ff6b6b;
    /* Living Coral */
    --color-accent-dim: rgba(255, 107, 107, 0.1);
    --color-accent-glow: 0 0 25px rgba(255, 107, 107, 0.4);

    --color-secondary: #4ecdc4;
    /* Medium Turquoise */
    --color-secondary-glow: 0 0 20px rgba(78, 205, 196, 0.3);

    --color-border: rgba(78, 205, 196, 0.15);
    --color-border-glow: rgba(78, 205, 196, 0.3);

    /* Typography */
    --font-display: 'Playfair Display', serif;
    --font-sans: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 8rem;
    --space-xxl: 12rem;

    /* Radius */
    --radius-sm: 2px;
    --radius-md: 4px;
    --radius-lg: 12px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.2, 0, 0, 1);
    --transition-smooth: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-bounce: 0.5s cubic-bezier(0.68, -0.6, 0.32, 1.6);
}

/* Base Reset & Setup */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    cursor: none;
    /* Custom Cursor Prep */
}

#app {
    position: relative;
    z-index: 1;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    font-family: var(--font-sans);
    overflow-x: hidden;
    cursor: default;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(78, 205, 196, 0.03) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(255, 107, 107, 0.03) 0%, transparent 20%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

/* Global Noise Texture */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: overlay;
}

/* Typography Classes */
h1,
h2,
h3,
h4 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.text-display-xl {
    font-size: clamp(3.5rem, 8vw, 8rem);
    font-weight: 400;
    color: #ffffff;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.text-display-lg {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
}

.text-mono {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

/* Utilities */
.container {
    width: 90%;
    max-width: 1600px;
    margin: 0 auto;
}

.grid {
    display: grid;
    gap: var(--space-md);
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

/* Components: Buttons */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    overflow: hidden;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
    cursor: none;
}

.btn-primary {
    background: var(--color-accent);
    color: #000;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--color-accent-glow);
    letter-spacing: 0.1em;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
    backdrop-filter: blur(5px);
}

.btn-ghost:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background: rgba(255, 107, 107, 0.05);
}

/* Components: Cards */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.card:hover {
    border-color: var(--color-secondary);
    transform: translateY(-5px) scale(1.01);
    box-shadow: var(--color-secondary-glow), 0 10px 30px rgba(0, 0, 0, 0.2);
    background: var(--color-surface-hover);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-secondary), transparent);
    opacity: 0;
    transform: translateX(-100%);
    transition: opacity 0.3s, transform 0.6s;
}

.card:hover::before {
    opacity: 1;
    transform: translateX(100%);
}

/* Custom Cursor */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 10000;
    pointer-events: none;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--color-accent);
    box-shadow: 0 0 10px var(--color-accent);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 107, 107, 0.5);
    transition: width 0.2s, height 0.2s, background-color 0.2s, border-color 0.2s;
}

.cursor-outline.hover {
    width: 60px;
    height: 60px;
    background-color: rgba(78, 205, 196, 0.1);
    border-color: var(--color-secondary);
    mix-blend-mode: difference;
}

button,
a {
    cursor: none;
    /* Hide default cursor to use custom one */
}

button {
    border: none;
    background: none;
    font-family: inherit;
}

/* Animations */
/* Animations handled by GSAP now */


/* GSAP will handle the 'active' state via inline styles */

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}

/* Navigation */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) 0;
    mix-blend-mode: normal;
    /* Changed from difference for better visibility over bg */
    z-index: 100;
    position: relative;
}

.nav-link {
    position: relative;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    transition: color var(--transition-fast);
    padding: 0.5rem 0;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-text-primary);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 1px;
    background: var(--color-accent);
    transition: width var(--transition-smooth);
    box-shadow: 0 0 5px var(--color-accent);
}

.nav-link:hover::before,
.nav-link.active::before {
    width: 100%;
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
    margin: 1rem 0;
}

th,
td {
    padding: 1rem;
    text-align: left;
    color: var(--color-text-secondary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

th {
    color: var(--color-accent);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--color-border);
}

tr {
    transition: transform 0.2s, background 0.2s;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
    transform: scale(1.01);
}

td {
    border-bottom: 1px solid rgba(78, 205, 196, 0.05);
}

/* Toast Notification Styles */
#toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 11000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    background: rgba(2, 26, 30, 0.95);
    border-left: 4px solid var(--color-accent);
    color: var(--color-text-primary);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    min-width: 300px;
    backdrop-filter: blur(10px);

    opacity: 0;
    transform: translateX(100%);
    animation: toast-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.success {
    border-color: var(--color-secondary);
}

.toast.error {
    border-color: var(--color-accent);
}

.toast.hiding {
    animation: toast-out 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Helper for Pomodoro */
.timer-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(78, 205, 196, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(78, 205, 196, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(78, 205, 196, 0);
    }
}

/* ========== WHATSAPP FLOATING BUTTON ========== */
.whatsapp-float {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    animation: whatsapp-pulse 2s infinite;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(37, 211, 102, 0.6);
}

@keyframes whatsapp-pulse {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }

    50% {
        box-shadow: 0 4px 30px rgba(37, 211, 102, 0.7);
    }
}

/* ========== COOKIE BANNER ========== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(2, 26, 30, 0.97);
    border-top: 1px solid var(--color-border);
    padding: 1.5rem 2rem;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    backdrop-filter: blur(20px);
    animation: slide-up 0.5s ease forwards;
}

@keyframes slide-up {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.cookie-banner p {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    flex: 1;
}

.cookie-banner .cookie-buttons {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}

/* ========== HAMBURGER MENU (MOBILE) ========== */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    padding: 0.5rem;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--color-text-primary);
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    nav ul.nav-links {
        display: none !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(2, 26, 30, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column !important;
        align-items: center;
        justify-content: center;
        gap: 2rem !important;
        z-index: 1000;
    }

    nav ul.nav-links.open {
        display: flex !important;
    }

    nav ul.nav-links a,
    nav ul.nav-links button {
        font-size: 1.2rem !important;
    }

    .cookie-banner {
        flex-direction: column;
        text-align: center;
    }
}

/* ========== FAQ ACCORDION ========== */
.faq-item {
    border-bottom: 1px solid var(--color-border);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 1.5rem 0;
    color: var(--color-text-primary);
    font-family: var(--font-sans);
    font-size: 1.1rem;
    font-weight: 500;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.3s;
}

.faq-question:hover {
    color: var(--color-accent);
}

.faq-question .faq-icon {
    transition: transform 0.3s ease;
    font-size: 1.2rem;
    color: var(--color-accent);
}

.faq-item.open .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    color: var(--color-text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
}

.faq-item.open .faq-answer {
    max-height: 300px;
    padding-bottom: 1.5rem;
}

/* ========== QUIZ STYLES ========== */
.quiz-option {
    display: block;
    width: 100%;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
    font-family: var(--font-sans);
    font-size: 1rem;
    text-align: left;
    transition: all 0.3s;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
}

.quiz-option:hover {
    background: rgba(78, 205, 196, 0.1);
    border-color: var(--color-secondary);
}

.quiz-option.correct {
    background: rgba(78, 205, 196, 0.2);
    border-color: var(--color-secondary);
    color: var(--color-secondary);
}

.quiz-option.wrong {
    background: rgba(255, 107, 107, 0.2);
    border-color: var(--color-accent);
    color: var(--color-accent);
}



/* ========== STAR RATING ========== */
.star-rating {
    display: flex;
    gap: 0.25rem;
    font-size: 1.5rem;
}

.star-rating .star {
    cursor: pointer;
    transition: transform 0.2s;
    color: var(--color-text-muted);
}

.star-rating .star:hover {
    transform: scale(1.2);
}

.star-rating .star.active {
    color: #ffd700;
}

/* Disable custom cursor on touch devices */
@media (hover: none) and (pointer: coarse) {

    *,
    *::before,
    *::after,
    button,
    a,
    body {
        cursor: auto !important;
    }

    .cursor-dot,
    .cursor-outline {
        display: none !important;
    }
}