/* ========================================
   GARLAND - Grumpy Elf Chat Experience
   Pryon AI Gift Advisor
   ======================================== */

/* CSS Variables */
:root {
    /* Colors - Moody Christmas */
    --bg-dark: #0a0f14;
    --bg-card: #141c24;
    --bg-elevated: #1a2530;
    --accent-green: #2d5a3d;
    --accent-green-light: #3d7a52;
    --accent-red: #8b2635;
    --accent-red-light: #a83344;
    --accent-gold: #c9a227;
    --accent-gold-light: #dbb84a;
    --text-primary: #e8e6e3;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --border-color: #2a3744;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 30px rgba(45, 90, 61, 0.3);

    /* Typography */
    --font-display: 'Mountains of Christmas', cursive;
    --font-body: 'Quicksand', sans-serif;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-body);
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Snowfall Effect */
.snowfall {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    color: white;
    font-size: 1rem;
    opacity: 0.7;
    animation: snowfall linear infinite;
    text-shadow: 0 0 5px rgba(255,255,255,0.5);
}

@keyframes snowfall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* ========================================
   WELCOME PAGE
   ======================================== */

.welcome-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.welcome-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
}

/* Elf Video Background */
.elf-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.elf-video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(10, 15, 20, 0.8) 0%,
        rgba(45, 90, 61, 0.3) 50%,
        rgba(10, 15, 20, 0.9) 100%
    );
}

/* Welcome Content */
.welcome-content {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 600px;
    animation: fadeInUp 1s ease;
}

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

/* Logo Section */
.logo-section {
    margin-bottom: var(--spacing-lg);
}

.event-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-red), var(--accent-red-light));
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-md);
}

.main-title {
    font-family: var(--font-display);
    line-height: 1.1;
}

.title-line {
    display: block;
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.title-name {
    display: block;
    font-size: 4rem;
    color: var(--accent-gold);
    text-shadow: 0 0 30px rgba(201, 162, 39, 0.5);
    animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { text-shadow: 0 0 30px rgba(201, 162, 39, 0.5); }
    50% { text-shadow: 0 0 50px rgba(201, 162, 39, 0.8); }
}

.subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: var(--spacing-sm);
    font-style: italic;
}

/* Intro Text */
.intro-text {
    margin-bottom: var(--spacing-xl);
}

.elf-quote {
    font-size: 1.5rem;
    font-family: var(--font-display);
    color: var(--accent-green-light);
    margin-bottom: var(--spacing-sm);
}

.elf-quote em {
    color: var(--text-muted);
}

.description {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.7;
}

/* CTA Section */
.cta-section {
    margin-bottom: var(--spacing-lg);
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: linear-gradient(135deg, var(--accent-green), var(--accent-green-light));
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--shadow-md), var(--shadow-glow);
    transition: all var(--transition-normal);
    border: 2px solid transparent;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg), 0 0 50px rgba(45, 90, 61, 0.5);
    background: linear-gradient(135deg, var(--accent-green-light), var(--accent-green));
}

.cta-button:active {
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 1.5rem;
    transition: transform var(--transition-fast);
}

.cta-button:hover .btn-icon {
    transform: translateX(5px);
}

.cta-subtext {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: var(--spacing-sm);
    font-style: italic;
}

/* Powered By */
.powered-by {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.pryon-logo {
    height: 20px;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.powered-by:hover .pryon-logo {
    opacity: 1;
}

/* Features Section */
.features-section {
    padding: var(--spacing-lg);
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
}

.features-scroll {
    display: flex;
    gap: var(--spacing-md);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--spacing-sm);
}

.features-scroll::-webkit-scrollbar {
    height: 4px;
}

.features-scroll::-webkit-scrollbar-thumb {
    background: var(--accent-green);
    border-radius: 4px;
}

.feature-card {
    flex: 0 0 280px;
    background: var(--bg-elevated);
    border-radius: 16px;
    padding: var(--spacing-lg);
    scroll-snap-align: center;
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-green);
    box-shadow: var(--shadow-glow);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
}

.feature-card h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--accent-gold);
    margin-bottom: var(--spacing-xs);
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Footer */
.welcome-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: center;
    background: linear-gradient(to top, rgba(10, 15, 20, 0.9), transparent);
    color: var(--text-muted);
    font-size: 0.85rem;
    z-index: 10;
}

.welcome-footer strong {
    color: var(--text-secondary);
}

/* ========================================
   CHAT PAGE
   ======================================== */

.chat-page {
    height: 100vh;
    overflow: hidden;
}

/* Chat Main Layout */
.chat-main {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ========================================
   LEFT PANEL - Elf Sidebar
   ======================================== */

.elf-panel {
    display: none;
    width: 280px;
    background: #ffffff;
    border-right: 1px solid #e5e5e5;
    flex-direction: column;
    padding: var(--spacing-md);
    gap: var(--spacing-md);
    overflow-y: auto;
}

/* Adjust text colors for white background */
.elf-panel .back-link {
    color: #666;
}

.elf-panel .back-link:hover {
    color: #333;
}

@media (min-width: 900px) {
    .elf-panel {
        display: flex;
    }
}

/* Back Link */
.back-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    padding: var(--spacing-xs) 0;
    transition: color var(--transition-fast);
}

.back-link:hover {
    color: var(--text-primary);
}

.back-link svg {
    width: 18px;
    height: 18px;
}

/* Elf Video - positioned at bottom */
.elf-video-wrapper {
    border-radius: 12px;
    overflow: visible;
    background: #f5f5f5;
    margin-top: auto;
    order: 99;
    flex-shrink: 0;
}

.elf-video-wrapper video {
    width: 100%;
    height: auto;
    display: block;
}

/* Elf Info Card */
.elf-info {
    text-align: center;
    padding: var(--spacing-md);
    background: #f8f8f8;
    border-radius: 12px;
    border: 1px solid #e5e5e5;
}

.elf-info h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: #1a5c2e;
    margin-bottom: 4px;
}

.elf-title {
    color: #555;
    font-size: 0.85rem;
}

.elf-years {
    color: #888;
    font-size: 0.75rem;
    margin-bottom: var(--spacing-sm);
}

.elf-mood {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: var(--spacing-sm);
    border-top: 1px solid #e5e5e5;
}

.mood-label {
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mood-value {
    font-size: 0.85rem;
    color: var(--accent-red);
    font-style: italic;
}

/* Chat Mode Navigation */
.chat-mode-nav {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.mode-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid #ddd;
    border-radius: 10px;
    background: transparent;
    color: #555;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mode-btn svg {
    width: 18px;
    height: 18px;
}

.mode-btn:hover {
    border-color: var(--accent-green);
    color: #333;
    background: rgba(45, 90, 61, 0.1);
}

.mode-btn.active {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: white;
}

/* Help Link */
.help-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: #888;
    font-size: 0.8rem;
    padding: var(--spacing-xs) 0;
    background: none;
    border: none;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.help-link:hover {
    color: #555;
}

.help-link svg {
    width: 16px;
    height: 16px;
}

/* ========================================
   RIGHT PANEL - Chat Area
   ======================================== */

.chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-dark);
}

/* Chat Interfaces */
.chat-interface {
    flex: 1;
    display: none;
    overflow: hidden;
}

.chat-interface.active {
    display: flex;
    flex-direction: column;
}

/* Pryon Iframe - Full Size */
.pryon-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: var(--bg-dark);
}

/* ========================================
   MOBILE LAYOUT
   ======================================== */

/* Mobile Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 0 var(--spacing-sm);
    align-items: center;
    justify-content: space-between;
    z-index: 100;
}

@media (max-width: 899px) {
    .mobile-header {
        display: flex;
    }

    .chat-main {
        padding-top: 56px;
        padding-bottom: 64px;
    }
}

.mobile-back {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all var(--transition-fast);
}

.mobile-back:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.mobile-back svg {
    width: 20px;
    height: 20px;
}

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

.mobile-name {
    display: block;
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--accent-gold);
}

.mobile-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.status-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-green-light);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.mobile-menu-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
    transition: all var(--transition-fast);
}

.mobile-menu-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.mobile-menu-btn svg {
    width: 20px;
    height: 20px;
}

/* Mobile Bottom Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-xs) var(--spacing-sm);
    gap: var(--spacing-xs);
    z-index: 100;
}

@media (max-width: 899px) {
    .mobile-nav {
        display: flex;
    }
}

.mobile-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: none;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mobile-nav-btn svg {
    width: 22px;
    height: 22px;
}

.mobile-nav-btn:hover {
    color: var(--text-secondary);
}

.mobile-nav-btn.active {
    background: var(--accent-green);
    color: white;
}

/* Voice Chat Container */
.voice-chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    gap: var(--spacing-lg);
}

.voice-elf-preview {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--accent-green);
    box-shadow: var(--shadow-glow);
}

.voice-elf-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.voice-instructions h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--accent-gold);
    margin-bottom: var(--spacing-xs);
}

.voice-instructions p {
    color: var(--text-secondary);
}

.voice-instructions em {
    color: var(--text-muted);
}

.elevenlabs-widget {
    margin-top: var(--spacing-md);
}

/* Mobile Elf Peek */
.mobile-elf-peek {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--accent-green);
    box-shadow: var(--shadow-md);
    z-index: 50;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.mobile-elf-peek:hover {
    transform: scale(1.1);
}

.mobile-elf-peek video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 1023px) {
    .mobile-elf-peek {
        display: block;
    }
}

/* ========================================
   WALKTHROUGH OVERLAY
   ======================================== */

.walkthrough-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.walkthrough-overlay.active {
    opacity: 1;
    visibility: visible;
}

.walkthrough-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 15, 20, 0.9);
}

.walkthrough-content {
    position: relative;
    background: var(--bg-card);
    border-radius: 24px;
    padding: var(--spacing-xl);
    max-width: 450px;
    width: 90%;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

.walkthrough-step {
    display: none;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.walkthrough-step.active {
    display: block;
}

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

.step-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--accent-green);
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-md);
}

.walkthrough-step h3 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--accent-gold);
    margin-bottom: var(--spacing-sm);
}

.walkthrough-step p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.walkthrough-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

.walk-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.skip-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.skip-btn:hover {
    border-color: var(--text-secondary);
    color: var(--text-secondary);
}

.next-btn {
    background: var(--accent-green);
    border: none;
    color: white;
}

.next-btn:hover {
    background: var(--accent-green-light);
}

.walk-dots {
    display: flex;
    gap: var(--spacing-xs);
}

.walk-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-color);
    transition: all var(--transition-fast);
}

.walk-dot.active {
    background: var(--accent-green);
    transform: scale(1.2);
}

/* ========================================
   FLOATING TIP
   ======================================== */

.floating-tip {
    position: fixed;
    bottom: 120px;
    right: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: var(--spacing-md);
    max-width: 280px;
    box-shadow: var(--shadow-md);
    z-index: 40;
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.floating-tip.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.tip-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.tip-close:hover {
    color: var(--text-primary);
}

.tip-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
}

@media (max-width: 1023px) {
    .floating-tip {
        left: 20px;
        right: 20px;
        max-width: none;
        bottom: 110px;
    }
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 768px) {
    .title-name {
        font-size: 3rem;
    }

    .elf-quote {
        font-size: 1.2rem;
    }

    .cta-button {
        padding: 0.875rem 2rem;
        font-size: 1.1rem;
    }

    .feature-card {
        flex: 0 0 250px;
    }

    .back-text {
        display: none;
    }

    .walkthrough-content {
        padding: var(--spacing-lg);
    }

    .walkthrough-step h3 {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .title-name {
        font-size: 2.5rem;
    }

    .description {
        font-size: 1rem;
    }

    .features-section {
        padding: var(--spacing-md);
    }

    .feature-card {
        flex: 0 0 220px;
        padding: var(--spacing-md);
    }

    .voice-elf-preview {
        width: 150px;
        height: 150px;
    }

    .voice-instructions h3 {
        font-size: 1.2rem;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
