@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;1,400&display=swap');

/* --- THEME SYSTEM & COLOR PALETTE --- */
:root, [data-theme="light"] {
    --pico-font-family: 'Lora', serif;
    --pico-border-radius: 0.75rem;
    --pico-card-padding: 1.5rem;
    --pico-form-element-spacing-vertical: 1rem;
    --pico-form-element-spacing-horizontal: 1.25rem;

    /* Light Theme (User Specified) */
    --pico-background-color: #f5ede2;
    --pico-color: #2a2f4c;
    --pico-h1-color: #1e2139;
    --pico-h2-color: #1e2139;
    --pico-h3-color: #2a2f4c;
    --pico-muted-color: #7b7992;
    --pico-card-background-color: #ffffff;
    --pico-card-border-color: #e3ddd2;
    --pico-muted-border-color: #e3ddd2;
    --pico-form-element-background-color: #ffffff;
    --pico-form-element-border-color: #dcd3c4;
    --pico-form-element-focus-color: var(--pico-primary);
    --pico-contrast: #1e2139;

    /* Accent Colors (User Specified) */
    --pico-primary: #425491;
    --pico-primary-background: #425491;
    --pico-primary-inverse: #ffffff;
    --pico-primary-hover: #354374;
    --pico-primary-hover-background: #354374;
    --pico-primary-focus: rgba(66, 84, 145, 0.25);
    --accent-secondary: #949bc1;
}

[data-theme="dark"] {
    /* Dark Theme (Derived) */
    --pico-background-color: #1a1a2e;
    --pico-color: #d1d1e0;
    --pico-h1-color: #ffffff;
    --pico-h2-color: #ffffff;
    --pico-h3-color: #d1d1e0;
    --pico-muted-color: #8c8ca1;
    --pico-card-background-color: #1f1f38;
    --pico-card-border-color: #2a2a4a;
    --pico-muted-border-color: #2a2a4a;
    --pico-form-element-background-color: #1a1a2e;
    --pico-form-element-border-color: #2a2a4a;
    --pico-contrast: #ffffff;
}

/* --- LAYOUT & FOREGROUND CONTENT --- */
.content-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    position: relative;
    z-index: 2; /* Ensure content wrapper is above animation scene */
}

.content-foreground {
    width: 100%;
    max-width: 720px;
    padding: 2.5rem 1rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--pico-border-radius);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .content-foreground {
    background: rgba(25, 25, 46, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.page-header h1, .page-header p {
    text-shadow: 0px 1px 5px rgba(0,0,0,0.1);
}

/* --- LOGO & HEADERS --- */
.logo {
    width: 110px;
    height: auto;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.page-header p {
    font-size: 1.1rem;
    max-width: 60ch;
    margin: 0 auto 2rem auto;
}

/* --- FORMS & BUTTONS --- */
button, [role="button"] {
    font-weight: 600;
}

#waitlist-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    max-width: 450px;
    margin: 0 auto;
}

#form-feedback {
    margin-top: 1rem;
    min-height: 24px;
    font-weight: bold;
    color: var(--pico-primary);
}

/* --- INTERPRETER PAGE --- */
#results-container article {
    margin-top: 2rem;
    padding: 0;
    text-align: left;
}

#results-container h3 {
    border-bottom: 1px solid var(--pico-muted-border-color);
    padding-bottom: 0.5rem;
    margin-top: 1.5rem;
    font-weight: 600;
}

.takeaway {
    border-left: 4px solid var(--accent-secondary);
    padding: 1rem 1rem 1rem 1.25rem;
    border-radius: 0 var(--pico-border-radius) var(--pico-border-radius) 0;
    margin-top: 1rem;
    font-style: italic;
    background-color: rgba(var(--pico-primary), 0.1);
}

/* --- FOOTER & THEME TOGGLE --- */
/* Cookie Banner Styles */

/* Modern Cookie Banner Styles */
.cookie-banner {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.5rem;
    z-index: 1000;
    display: none;
    max-width: 420px;
    width: calc(100vw - 40px);
    box-shadow:
            0 8px 32px rgba(0, 0, 0, 0.4),
            0 2px 8px rgba(0, 0, 0, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cookie-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.005));
    border-radius: 16px;
    pointer-events: none;
}

.cookie-content {
    position: relative;
    z-index: 1;
}

.cookie-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}

.cookie-icon {
    font-size: 1.2rem;
    opacity: 0.8;
}

.cookie-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
    letter-spacing: -0.01em;
}

.cookie-text {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0 0 1.25rem 0;
}

.cookie-text a {
    color: #60a5fa;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    border-bottom: 1px solid transparent;
}

.cookie-text a:hover {
    color: #93c5fd;
    border-bottom-color: rgba(147, 197, 253, 0.3);
}

.cookie-buttons {
    display: flex;
    gap: 0.5rem;
}

.cookie-btn {
    flex: 1;
    padding: 0.65rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    letter-spacing: -0.01em;
}

.cookie-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.btn-accept {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-accept::before {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.btn-accept:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-accept:hover::before {
    opacity: 1;
}

.btn-accept:active {
    transform: translateY(0);
}

.btn-deny {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-deny::before {
    background: rgba(255, 255, 255, 0.08);
}

.btn-deny:hover {
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.btn-deny:hover::before {
    opacity: 1;
}

.btn-deny:active {
    transform: translateY(0);
}

/* Enhanced Animations */
@keyframes cookieSlideIn {
    from {
        transform: translateX(120%) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

@keyframes cookieSlideOut {
    from {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
    to {
        transform: translateX(120%) scale(0.9);
        opacity: 0;
    }
}

.cookie-banner.show {
    animation: cookieSlideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cookie-banner.hide {
    animation: cookieSlideOut 0.4s cubic-bezier(0.55, 0.085, 0.68, 0.53);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .cookie-banner {
        bottom: 15px;
        right: 15px;
        left: 15px;
        width: auto;
        max-width: none;
        padding: 1.25rem;
        border-radius: 12px;
    }

    .cookie-buttons {
        gap: 0.75rem;
    }

    .cookie-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .cookie-text {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .cookie-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .cookie-btn {
        width: 100%;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .cookie-banner,
    .cookie-btn,
    .cookie-text a {
        transition: none !important;
        animation: none !important;
    }

    .cookie-banner.show,
    .cookie-banner.hide {
        animation: none;
    }

    .btn-accept:hover,
    .btn-deny:hover {
        transform: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cookie-banner {
        border: 2px solid white;
        background: black;
    }

    .btn-accept {
        background: white;
        color: black;
    }

    .btn-deny {
        background: transparent;
        border: 2px solid white;
        color: white;
    }
}

/* Social Media Links */
.social-links {
    text-align: center;
    margin-top: 2.5rem;
    padding: 1.5rem 0;
}

.social-links h3 {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.social-icons a {
    font-size: 1.8rem;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    filter: grayscale(20%);
    opacity: 0.8;
}

.social-icons a:hover {
    transform: scale(1.2) translateY(-2px);
    filter: grayscale(0%);
    opacity: 1;
}

/* Footer Styles */
.main-footer {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 0;
    margin-top: 3rem;
    position: relative;
    z-index: 10;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-content p {
    margin: 0;
    font-size: 0.9rem;
    color: #aaa;
}

.footer-nav {
    display: flex;
    gap: 1.5rem;
}

.footer-nav a {
    color: #aaa;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.footer-nav a:hover {
    color: white;
}

/* Animations */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .cookie-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .cookie-buttons {
        width: 100%;
        justify-content: center;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .footer-nav {
        justify-content: center;
    }

    .social-icons {
        gap: 1rem;
    }
}
