/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    overflow-x: hidden;
}

/* Mobile-first responsive design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .hero-button {
        width: 100%;
        max-width: 300px;
    }
    
    .features {
        padding: 3rem 0;
    }
    
    .features h2 {
        font-size: 2rem;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .how-it-works-section {
        padding: 3rem 0;
    }
    
    .how-it-works-section h2 {
        font-size: 2rem;
    }
    
    .unified-demo-container {
        padding: 1.5rem;
    }
    
    .demo-chat {
        min-height: 250px;
    }
    
    .cta-section {
        padding: 3rem 0;
    }
    
    .cta-section h2 {
        font-size: 2rem;
    }
    
    .auth-container {
        margin: 1rem;
        padding: 2rem 1.5rem;
        max-width: 100%;
    }
    
    .auth-form {
        padding: 1.5rem;
    }
    
    .form-group input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .hero-visual {
        margin-top: 2rem;
    }
    
    .phone-mockup {
        width: 280px;
        height: 500px;
    }
    
    /* Auth section mobile improvements */
    .auth-container {
        margin: 0.5rem;
        padding: 1.5rem 1rem;
        border-radius: 16px;
        max-width: calc(100% - 1rem);
    }
    
    .auth-form {
        padding: 1rem;
    }
    
    .auth-description {
        font-size: 14px;
        margin-bottom: 1.5rem;
    }
    
    .google-auth-button {
        padding: 14px 16px;
        font-size: 16px;
        border-radius: 10px;
    }
    
    .chat-preview {
        padding: 15px;
        min-height: 250px;
    }
    
    .chat-message {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .hero-visual .chat-message.ai {
        min-width: 140px;
        max-width: 180px;
    }
    
    .hero-visual .chat-message.user {
        min-width: 140px;
        max-width: 200px;
    }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Navigation */
.navbar {
    background: white;
    padding: 16px 0;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: none !important;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Override any potential container class inheritance */
.nav-container.container {
    max-width: none !important;
}

/* Force override for all nav-container variations */
.navbar > .nav-container,
.conversation-navbar > .nav-container,
.nav-container {
    max-width: none !important;
}

/* Override container class inheritance specifically */
.nav-container,
.navbar .nav-container,
.conversation-navbar .nav-container {
    max-width: none !important;
}

/* Maximum specificity override */
body .navbar .nav-container,
body .conversation-navbar .nav-container,
html body .nav-container {
    max-width: none !important;
}

/* Desktop: Align logo to left edge, logout to right edge */
@media (min-width: 768px) {
    /* Main navbar */
    .navbar .nav-container {
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        justify-content: flex-start !important;
        width: 100% !important;
    }
    
    .navbar .logo {
        margin-left: 0 !important;
        padding-left: 8px !important;
    }
    
    .navbar .nav-buttons {
        margin-left: auto !important;
        margin-right: 0 !important;
        padding-right: 20px !important;
    }
    
    /* Conversation navbar */
    .conversation-navbar .nav-container {
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        justify-content: flex-start !important;
        width: 100% !important;
    }
    
    .conversation-navbar .nav-left {
        margin-left: 0 !important;
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        flex-shrink: 0 !important;
        padding-left: 20px !important;
    }
    
    .conversation-navbar .nav-buttons {
        margin-left: auto !important;
        margin-right: 0 !important;
        flex-shrink: 0 !important;
        padding-right: 20px !important;
    }
    
    .conversation-navbar .sidebar-toggle {
        margin-left: 0 !important;
        padding-left: 0 !important;
    }
    
    .conversation-navbar .logo {
        margin-left: 0 !important;
        padding-left: 12px !important;
    }
    
    .conversation-navbar #conversation-logout-btn {
        margin-right: 0 !important;
    }
    
    /* Force full width and edge alignment */
    .navbar, .conversation-navbar {
        width: 100vw !important;
        margin-left: calc(-50vw + 50%) !important;
        left: 0 !important;
        right: 0 !important;
    }
}

.nav-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #3b82f6;
}

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-links a {
    color: #6b7280;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #3b82f6;
}

.nav-cta {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Navigation Button Styles */
.nav-button {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.nav-button.primary {
    background: #1e40af;
    color: white;
}

.nav-button.primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.nav-button.secondary {
    background: transparent;
    color: #1e40af;
    border: 2px solid #1e40af;
}

.nav-button.secondary:hover {
    background: #1e40af;
    color: white;
}

/* Subtle Settings Button */
.settings-btn {
    padding: 8px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    background: transparent;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.settings-btn:hover {
    background: #f3f4f6;
    color: #374151;
    transform: translateY(-1px);
}

/* Settings Modal Styles */
.settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.settings-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.settings-content {
    position: relative;
    background: #1e293b;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 0 24px;
    border-bottom: 1px solid #404040;
    margin-bottom: 24px;
}

.settings-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.settings-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    color: #6b7280;
    transition: all 0.2s ease;
}

.settings-close:hover {
    background: #404040;
    color: #ffffff;
}

.settings-body {
    padding: 0 24px 24px 24px;
}

.setting-group {
    margin-bottom: 32px;
}

.setting-label {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.setting-description {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 16px;
    line-height: 1.5;
}

.voice-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.voice-option-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 2px solid #404040;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #0f172a;
}

.voice-option-card:hover {
    border-color: #3b82f6;
    background: #404040;
}

.voice-option-card.selected {
    border-color: #3b82f6;
    background: #374151;
}

.voice-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 50%;
}

.voice-option-card.selected .voice-icon {
    background: #dbeafe;
}

.voice-info {
    flex: 1;
}

.voice-info .voice-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.voice-info .voice-description {
    font-size: 0.85rem;
    color: #6b7280;
}

.voice-check {
    color: #1e40af;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.voice-option-card.selected .voice-check {
    opacity: 1;
}

.hidden {
    display: none !important;
}

/* Mobile responsiveness for settings modal */
@media (max-width: 768px) {
    .settings-modal {
        padding: 10px;
    }
    
    .settings-content {
        max-width: 100%;
        border-radius: 12px;
    }
    
    .settings-header {
        padding: 20px 20px 0 20px;
    }
    
    .settings-body {
        padding: 0 20px 20px 20px;
    }
    
    .voice-option-card {
        padding: 12px;
        gap: 12px;
    }
    
    .voice-icon {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-content {
    max-width: 600px;
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
}

.hero-subtitle {
    font-size: 1.25rem;
    line-height: 1.6;
    margin-bottom: 32px;
    opacity: 0.9;
}

.hero-ctas {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.hero-guarantee {
    font-size: 14px;
    opacity: 0.8;
    font-weight: 500;
}

/* Hero Button Styles */
.hero-button {
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer !important;
    transition: all 0.3s ease;
    border: none;
    min-width: 180px;
    position: relative;
    z-index: 10;
}

.hero-button.primary {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    color: #1e3a8a;
    border: 3px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    font-size: 1.2rem;
    font-weight: 700;
    padding: 18px 36px;
    min-width: 220px;
}

.hero-button.primary:hover {
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
}

.hero-button.secondary {
    background: white;
    color: #1e40af;
    border: 2px solid #1e40af;
}

.hero-button.secondary:hover {
    background: #1e40af;
    color: white;
    transform: translateY(-2px);
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Hero Visual */
.phone-mockup {
    background: white;
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 8px solid #1e293b;
    animation: phoneFloat 6s ease-in-out infinite;
    width: 350px;
    max-width: 90vw;
}

@keyframes phoneFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.secondary-cta {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 14px 30px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.secondary-cta:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.hero-guarantee {
    font-size: 14px;
    opacity: 0.8;
    font-weight: 500;
}

/* Features Section */
.features {
    padding: 6rem 0;
    background: white;
    border-bottom: 1px solid #e2e8f0;
}

.features h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: #1e293b;
    text-align: center;
}

.section-intro {
    text-align: center;
    font-size: 1.2rem;
    color: #475569;
    margin-bottom: 4rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
}

.feature-card {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    transition: transform 0.2s ease, box-shadow 0.4s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1.5rem;
}

.feature-card ul {
    list-style: none;
}

.feature-card li {
    margin-bottom: 1rem;
    font-size: 1rem;
    color: #6b7280;
    display: flex;
    align-items: center;
}

.feature-card li:before {
    content: "•";
    color: #1e40af;
    font-weight: bold;
    margin-right: 12px;
    font-size: 1.2rem;
}

/* CTA Section */
.cta-section {
    padding: 2rem 0 4rem 0;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    text-align: center;
    position: relative;
    border-top: 3px solid #1d4ed8;
}

.cta-section h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.cta-section p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.cta-note {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 1rem;
}

/* How It Works Section Styles */
.how-it-works-section {
    padding: 4rem 0 2rem 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    position: relative;
    overflow: hidden;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.how-it-works-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.how-it-works-section h2 {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    color: #1e293b;
    text-align: center;
    background: linear-gradient(135deg, #1e40af, #3b82f6, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 8px rgba(30, 64, 175, 0.1);
    letter-spacing: -0.02em;
}

.how-it-works-section .section-intro {
    font-size: 1.4rem;
    color: #475569;
    text-align: center;
    margin-bottom: 3rem;
    font-weight: 600;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.demo-caption {
    font-size: 1.4rem;
    color: #374151;
    margin-bottom: 3rem;
    font-weight: 600;
    background: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: inline-block;
    border: 2px solid #e5e7eb;
}

@media (max-width: 768px) {
    .demo-caption {
        font-size: 1.2rem;
        padding: 0.75rem 1.5rem;
        margin-bottom: 2rem;
    }
    
    .demo-chat {
        padding: 1.5rem;
        border-radius: 20px;
    }
    
    .demo-recording-indicator {
        padding: 1.5rem;
    }
}

.demo-chat {
    display: none !important;
    background: white;
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 8px 16px rgba(0, 0, 0, 0.05);
    border: 2px solid #e5e7eb;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.demo-chat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #1e40af, #6366f1);
    border-radius: 24px 24px 0 0;
}

/* Demo Phases */
.demo-phase {
    display: none !important;
    transition: all 0.5s ease;
}

/* Recording Phase */
.demo-recording-indicator {
    padding: 2rem;
    border: 2px dashed #e5e7eb;
    border-radius: 16px;
    background: #f8fafc;
}

.recording-content {
    text-align: center;
}

.recording-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: #374151;
}

.status-pulse {
    animation: pulse 2s infinite;
}

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

.status-text {
    font-weight: 600;
}

.recording-timer {
    color: #6b7280;
    font-size: 0.9rem;
}

.transcription-preview {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    min-height: 60px;
}

.transcription-text {
    font-size: 1rem;
    color: #374151;
    margin-bottom: 0.5rem;
}

.transcription-status {
    font-size: 0.9rem;
    color: #6b7280;
    font-style: italic;
}

.recording-hint {
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.5;
}

/* Transformation CTA */
.transformation-cta {
    text-align: center;
    margin-top: 2rem;
}

.try-it-button {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

.try-it-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.4);
}

/* Word highlighting animation */
.word-highlight {
    display: inline-block;
    padding: 3px 6px;
    margin: 0 2px;
    border-radius: 6px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.7;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.word-highlight.highlighted {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    color: white;
    opacity: 1;
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    border-color: #1e40af;
}

/* Enhanced demo phase transitions */
.demo-phase {
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(20px);
}

.demo-phase[style*="display: block"] {
    opacity: 1;
    transform: translateY(0);
}

/* Ensure demo text is properly aligned */
.demo-phase .message-text {
    text-align: left !important;
}

.demo-phase .cantonese-text,
.demo-phase .pronunciation-text,
.demo-phase .meaning-text {
    text-align: left !important;
    margin-bottom: 0.75rem;
}

/* Auth Section Styles */
.auth-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
}

.auth-container {
    background: white;
    border-radius: 24px;
    padding: 3rem;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    animation: authSlideIn 0.3s ease-out;
}

@keyframes authSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: #1e40af;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: #6b7280;
    font-size: 1.1rem;
}


.auth-form h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
    text-align: center;
}

.auth-description {
    color: #6b7280;
    font-size: 1rem;
    text-align: center;
    margin-bottom: 2rem;
    line-height: 1.5;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #374151;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f9fafb;
}

.form-group input:focus {
    outline: none;
    border-color: #1e40af;
    background: white;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f9fafb;
    cursor: pointer;
}

.form-group select:focus {
    outline: none;
    border-color: #1e40af;
    background: white;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.auth-button {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.auth-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(30, 64, 175, 0.3);
}

.auth-divider {
    position: relative;
    text-align: center;
    margin: 1.5rem 0;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e5e7eb;
}

.auth-divider span {
    background: white;
    padding: 0 16px;
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 500;
}

.google-auth-button {
    width: 100%;
    padding: 12px 16px;
    background: white;
    color: #374151;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 1rem;
}

.google-auth-button:hover {
    background: #f9fafb;
    border-color: #1e40af;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.1);
}

.google-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-switch a {
    color: #1e40af;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Close button for auth modal */
.auth-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.auth-close:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Transformation Section */
.transformation-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 80px 0;
}

.transformation-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 16px;
    color: #2d3748;
}

.transformation-section .section-intro {
    font-size: 1.25rem;
    text-align: center;
    margin-bottom: 60px;
    color: #4a5568;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.transformation-showcase {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 40px;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
}

.transformation-scene {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: all 0.3s ease;
}

.transformation-scene:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.transformation-scene::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 20px 20px 0 0;
}

.transformation-scene.before::before {
    background: linear-gradient(90deg, #ff6b6b, #ee5a24);
}

.transformation-scene.after::before {
    background: linear-gradient(90deg, #4ecdc4, #44a08d);
}

.scene-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    text-align: center;
}

.transformation-scene h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
    color: #2d3748;
}

.scene-text {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 24px;
    color: #4a5568;
    font-style: italic;
}

.scene-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.scene-details span {
    font-size: 14px;
    color: #718096;
    font-weight: 500;
}

.transformation-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.arrow-line {
    width: 2px;
    height: 60px;
    background: linear-gradient(180deg, #ff6b6b, #4ecdc4);
    border-radius: 1px;
}

.arrow-head {
    font-size: 24px;
    color: #4ecdc4;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.transformation-cta {
    text-align: center;
    margin-top: 60px;
}

.transformation-quote {
    font-size: 1.25rem;
    font-style: italic;
    color: #4a5568;
    margin-bottom: 24px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.cta-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

/* How It Works Section */
.how-it-works-section {
    padding: 80px 0;
    background: white;
    /* Essential visibility */
    display: block;
    visibility: visible;
    opacity: 1;
    min-height: 200px;
}

.how-it-works-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 16px;
    color: #2d3748;
}

.how-it-works-section .section-intro {
    font-size: 1.25rem;
    text-align: center;
    margin-bottom: 60px;
    color: #4a5568;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-bottom: 60px;
}

.step-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.step-card:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.1);
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    margin: 0 auto 24px;
    flex-shrink: 0;
}

.step-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: #2d3748;
}

.step-card p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #4a5568;
}

/* Pricing Section */
.pricing-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 80px 0;
}

.pricing-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 16px;
    color: #2d3748;
}

.pricing-section .section-intro {
    font-size: 1.25rem;
    text-align: center;
    margin-bottom: 60px;
    color: #4a5568;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    max-width: 800px;
    margin: 0 auto 40px;
}

.pricing-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
    border: 2px solid #e2e8f0;
}

.pricing-card.featured {
    border-color: #667eea;
    transform: scale(1.05);
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.15);
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

.pricing-card.featured:hover {
    transform: scale(1.05) translateY(-5px);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.pricing-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: #2d3748;
}

.price {
    font-size: 3rem;
    font-weight: 800;
    color: #667eea;
    margin-bottom: 8px;
}

.price span {
    font-size: 1rem;
    font-weight: 500;
    color: #718096;
}

.pricing-header p {
    font-size: 1.1rem;
    color: #4a5568;
    margin-bottom: 32px;
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin-bottom: 32px;
    text-align: left;
}

.pricing-features li {
    padding: 8px 0;
    font-size: 1rem;
    color: #4a5568;
    font-weight: 500;
}

.pricing-cta {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pricing-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.pricing-cta.featured {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
}

.pricing-cta.featured:hover {
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
}

.pricing-note {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.pricing-note p {
    font-size: 1rem;
    color: #718096;
    line-height: 1.6;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
}

.cta-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.cta-section p {
    font-size: 1.25rem;
    margin-bottom: 32px;
    opacity: 0.9;
}

.primary-cta.large {
    padding: 20px 40px;
    font-size: 20px;
}

.cta-note {
    font-size: 14px;
    opacity: 0.8;
    margin-top: 24px;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-container {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-ctas {
        justify-content: center;
    }
    
    .transformation-showcase {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .transformation-arrow {
        display: none;
    }
    
    .steps-grid {
        grid-template-columns: 1fr;
    }
    
    .pricing-grid {
        grid-template-columns: 1fr;
    }
    
    .pricing-card.featured {
        transform: none;
    }
    
    .pricing-card.featured:hover {
        transform: translateY(-5px);
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 60px 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .primary-cta, .secondary-cta {
        padding: 14px 24px;
        font-size: 16px;
    }
    
    .transformation-section,
    .how-it-works-section,
    .pricing-section,
    .cta-section {
        padding: 60px 0;
    }
    
    .transformation-scene,
    .step-card,
    .pricing-card {
        padding: 30px 20px;
    }
}

/* AI Understanding Section */
.ai-understanding-section {
    padding: 80px 0;
    background: white;
}

.ai-understanding-section h2 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 16px;
}

.understanding-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 40px;
    margin-top: 48px;
}

.understanding-card {
    background: #f8fafc;
    padding: 32px;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.understanding-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.understanding-icon {
    font-size: 2rem;
    margin-bottom: 16px;
}

.understanding-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 16px;
}

.understanding-list {
    list-style: none;
    padding: 0;
}

.understanding-list li {
    padding: 8px 0;
    color: #374151;
    font-weight: 500;
    position: relative;
    padding-left: 20px;
}

.understanding-list li::before {
    content: "•";
    color: #3b82f6;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Social Proof Section */
.social-proof-section {
    padding: 80px 0;
    background: #f9fafb;
}

.social-proof-section h2 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 48px;
    font-style: italic;
}

.social-proof-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}

.testimonial-card {
    background: white;
    padding: 32px;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.testimonial-content p {
    font-size: 1.1rem;
    color: #374151;
    font-style: italic;
    margin-bottom: 24px;
    line-height: 1.6;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    font-size: 2rem;
}

.author-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.author-title {
    font-size: 0.9rem;
    color: #6b7280;
}

/* Top bar */
.top-bar {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar-content {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1f2937;
}

/* Main container */
.conversation-journal {
    flex: 1;
    padding: 24px 0 20px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%; /* Take full available width */
    overflow-y: auto !important;
    scroll-behavior: smooth;
    position: relative;
    max-height: calc(100vh - 100px);
    min-height: 400px;
    background: #0f172a;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Welcome state */
.welcome-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px 20px;
}

.welcome-mic {
    width: 100px;
    height: 100px;
    border-radius: 24px;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
    animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.welcome-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
}

.welcome-subtitle {
    font-size: 1rem;
    color: #6b7280;
    margin-bottom: 32px;
    max-width: 400px;
}

.start-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.start-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35);
}

/* Conversation journal */
.getting-started {
    background: linear-gradient(135deg, #f3f4f6 0%, #e0e7ff 100%);
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    box-shadow: 0 4px 24px rgba(59, 130, 246, 0.10);
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (max-width: 767px) {
    .getting-started {
        padding: 0 12px;
    }
}

.getting-started h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}


/* Scenario Cards Section */
.scenarios-section {
    margin-bottom: 40px;
}

@media (max-width: 767px) {
    .scenarios-section {
        margin-bottom: 20px;
    }
}

.scenarios-title {
    text-align: center;
    margin: 0 0 32px 0;
    color: #111827;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

@media (max-width: 767px) {
    .scenarios-title {
        font-size: 20px;
        margin: 0 0 16px 0;
    }
}

.scenario-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 0;
    max-width: 100%;
}

@media (min-width: 768px) {
    .scenario-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

@media (min-width: 1200px) {
    .scenario-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
        max-width: 800px;
        margin: 0 auto;
    }
}

.scenario-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
    min-height: 160px;
}

.scenario-card.featured {
    border: 2px solid #f59e0b;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.featured-banner {
    position: absolute;
    top: -1px;
    left: -1px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 4px 8px;
    border-radius: 6px 0 6px 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@media (max-width: 767px) {
    .scenario-card {
        padding: 12px;
        min-height: 70px;
        border-radius: 10px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    .scenario-card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    .scenario-content {
        margin-right: 40px;
    }
    
    .scenario-title {
        font-size: 10px;
        font-weight: 400;
        margin: 0 0 2px 0;
        line-height: 1.2;
    }
    
    .scenario-description {
        display: none;
    }
    
    .scenario-icon {
        width: 40px;
        height: 40px;
        top: 16px;
        right: 16px;
        font-size: 20px;
    }
    
    .scenario-badge {
        display: none;
    }
    
    .scenario-arrow {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
    
    .scenario-footer {
        gap: 8px;
    }
    
    .featured-banner {
        display: none;
    }
}

.scenario-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.scenario-card[data-action="mid-autumn"]:hover {
    border-color: #f59e0b;
}

.scenario-card[data-topic="learn"]:hover {
    border-color: #3b82f6;
}

.scenario-card[data-topic="family"]:hover {
    border-color: #ec4899;
}

.scenario-card[data-topic="food"]:hover {
    border-color: #10b981;
}

.scenario-card[data-topic="greeting"]:hover {
    border-color: #8b5cf6;
}

.scenario-card[data-topic="general"]:hover {
    border-color: #6366f1;
}

.scenario-icon {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.scenario-icon.general {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.scenario-icon.mid-autumn {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.scenario-icon.learn {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.scenario-icon.family {
    background: linear-gradient(135deg, #ec4899, #be185d);
}

.scenario-icon.food {
    background: linear-gradient(135deg, #10b981, #059669);
}

.scenario-icon.greeting {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.scenario-content {
    margin-right: 80px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.scenario-title {
    margin: 0 0 12px 0;
    color: #111827;
    font-size: 16px;
    font-weight: 600;
    text-align: left;
    letter-spacing: -0.5px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scenario-description {
    margin: 0 0 24px 0;
    color: #6b7280;
    font-size: 15px;
    text-align: left;
    line-height: 1.5;
    font-weight: 400;
    flex: 1;
}

.scenario-footer {
    display: flex;
    align-items: center;
    gap: 12px;
}

.scenario-badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scenario-badge.mid-autumn {
    background: #fef3c7;
    color: #92400e;
}

.scenario-badge.learn {
    background: #dbeafe;
    color: #1e40af;
}

.scenario-badge.family {
    background: #fce7f3;
    color: #be185d;
}

.scenario-badge.food {
    background: #dcfce7;
    color: #166534;
}

.scenario-badge.greeting {
    background: #f3e8ff;
    color: #7c3aed;
}

.scenario-badge.general {
    background: #e0e7ff;
    color: #4338ca;
}

.scenario-arrow {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.scenario-arrow.general {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.scenario-arrow.mid-autumn {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.scenario-arrow.learn {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.scenario-arrow.family {
    background: linear-gradient(135deg, #ec4899, #be185d);
}

.scenario-arrow.food {
    background: linear-gradient(135deg, #10b981, #059669);
}

.scenario-arrow.greeting {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}


.manual-start {
    margin-top: 8px;
}

/* CSP-compliant utility classes */
.thinking-text {
    color: #666;
    font-style: italic;
}

.error-text {
    color: #dc2626;
}

.chip-label {
    font-weight: 600;
    color: #374151;
    font-size: 15px;
    word-wrap: break-word;
    white-space: normal;
    line-height: 1.3;
}


.chip-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    color: #6b7280;
    margin-left: 16px;
}

.chip-arrow[data-color] {
    color: var(--chip-color);
}

/* Scenario chip button styles */
.scenario-chip-btn {
    background: white;
    border: 2px solid var(--chip-border-color);
    border-radius: 12px;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    flex: 1;
    min-width: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.scenario-chip-btn:hover {
    background: #f8fafc;
    border-color: var(--chip-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.chip-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.summary-phrase-box {
    margin: 8px 0;
}

.summary-actions {
    margin-top: 12px;
}

.speed-buttons-hidden {
    display: none;
    visibility: hidden;
}

.loading-spinner-hidden {
    display: none;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px;
    max-width: 560px;
    width: calc(100% - 32px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: #111827;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 12px;
}
.tips-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.tip-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
}

.tip-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.tip-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.tip-icon {
    font-size: 1.2rem;
}

.tip-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
}

.tip-description {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.4;
}





.manual-start {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.manual-start p {
    font-size: 0.9rem;
    color: #64748b;
}

.back-button {
    background: none;
    border: none;
    color: #3b82f6;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: none;
}

.back-button:hover {
    background: #f1f5f9;
    color: #1d4ed8;
}

.back-button.show {
    display: block;
}

/* Enhanced Message Styling */
/* WhatsApp-style message container */
.message {
    margin-bottom: 8px;
    animation: slideInUp 0.3s ease-out;
    overflow: visible !important;
    position: relative;
    z-index: auto;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

/* User messages - right aligned */
.message.user-message {
    justify-content: flex-end;
    margin-left: auto;
    max-width: 80%;
}

.message.user-message .message-content {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    border-radius: 18px 18px 4px 18px;
    padding: 8px 12px;
    position: relative;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    overflow: visible !important;
    max-width: 100%;
    word-wrap: break-word;
    transition: background-color 0.2s ease;
}

.message.user-message .message-content:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
}

.message.user-message .message-controls {
    order: 2;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}


/* Transcription Redo Button - appears during live transcription */
.transcription-redo-button {
    background: #ff0000 !important; /* Bright red for testing */
    border: 3px solid #000 !important; /* Black border for visibility */
    border-radius: 50%;
    width: 40px !important; /* Larger for testing */
    height: 40px !important; /* Larger for testing */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 12px rgba(255, 0, 0, 0.6),
        0 2px 4px rgba(255, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1000 !important; /* High z-index for testing */
    opacity: 1 !important;
}

.transcription-redo-button:hover {
    transform: translateY(-2px) scale(1.1);
    box-shadow: 
        0 8px 20px rgba(102, 126, 234, 0.5),
        0 4px 8px rgba(102, 126, 234, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.transcription-redo-button:active {
    transform: translateY(0) scale(0.95);
    transition: all 0.1s ease;
}

.transcription-redo-button .redo-icon {
    width: 18px;
    height: 18px;
    color: white;
    stroke-width: 2.5;
    transition: transform 0.3s ease;
}

.transcription-redo-button:hover .redo-icon {
    transform: rotate(180deg);
}

/* Make transcription preview container relative for positioning */
.transcription-preview {
    position: relative;
}

.message.user-message:hover .message-controls {
    opacity: 1;
}

/* Futuristic Redo Button */
.redo-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 12px rgba(102, 126, 234, 0.3),
        0 2px 4px rgba(102, 126, 234, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.redo-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.redo-button:hover::before {
    left: 100%;
}

.redo-button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 8px 20px rgba(102, 126, 234, 0.4),
        0 4px 8px rgba(102, 126, 234, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.redo-button:active {
    transform: translateY(0) scale(0.95);
    transition: all 0.1s ease;
}

.redo-icon {
    width: 16px;
    height: 16px;
    color: white;
    stroke-width: 2.5;
    transition: transform 0.3s ease;
}

.redo-button:hover .redo-icon {
    transform: rotate(180deg);
}

/* Glow effect for futuristic feel */
.redo-button::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #667eea, #764ba2, #667eea);
    border-radius: 50%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: pulse 2s infinite;
}

.redo-button:hover::after {
    opacity: 0.6;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* AI messages - left aligned */
.message.warm-message {
    justify-content: flex-start;
    margin-right: auto;
    max-width: 80%;
    align-items: center;
}

.message.warm-message .message-content {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f0f9ff 100%);
    border: 1px solid rgba(14, 165, 233, 0.15);
    border-radius: 18px 18px 18px 6px;
    padding: 20px 24px;
    position: relative;
    box-shadow: 
        0 4px 12px rgba(14, 165, 233, 0.08),
        0 2px 4px rgba(14, 165, 233, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    overflow: visible !important;
    transition: background-color 0.2s ease;
}

.message.warm-message .message-content:hover {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    border-radius: 12px !important;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.15),
        0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* Warm message container styling */
.message.warm-message .message-content .warm-message-container {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #f8fafc 100%);
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: 12px;
    padding: 16px 20px;
    margin: 8px 0;
    box-shadow: 
        0 2px 8px rgba(14, 165, 233, 0.06),
        0 1px 2px rgba(14, 165, 233, 0.03);
}

/* Simple response styling for Translator mode - match mixed-response-container */
.simple-response {
    background: #0f172a;
    border-radius: 12px;
    padding: 20px;
    margin: 8px 0;
    border: 1px solid #334155;
    color: #e0e0e0;
    line-height: 1.6;
    font-size: 16px;
}

/* When warm-message contains mixed-response-container, use simpler styling */
.message.warm-message .message-content:has(.mixed-response-container) {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

/* When warm-message contains simple-response, use simpler styling */
.message.warm-message .message-content:has(.simple-response) {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.message.warm-message .message-content > div:first-child {
    order: 1;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    backdrop-filter: blur(8px);
}

.message.warm-message .message-controls {
    order: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
    margin-left: 8px;
}

.message.warm-message:hover .message-controls {
    opacity: 1;
}

/* Remove the old pseudo-elements for tails */
.message.user-message .message-content::before,
.message.warm-message .message-content::before {
    display: none;
}

/* Simplify the strong tags */
.message.user-message strong,
.message.warm-message strong {
    display: none; /* Hide the "You" and "AI" labels for cleaner look */
}

/* Desktop adjustments */
@media (min-width: 768px) {
    .message.user-message,
    .message.warm-message {
        max-width: 75%;
    }
}

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

/* Speed Controls - FIXED for both desktop and mobile */
.unified-speed-controls {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    z-index: 1;
    isolation: isolate;
}

.unified-speed-controls.expanded::before {
    content: '';
    position: fixed;
    top: 60px; /* Below header */
    left: 0;
    right: 0;
    bottom: 120px; /* Above footer/mic area */
    background: rgba(0, 0, 0, 0.5);
    z-index: 2147483646;
    pointer-events: auto;
    backdrop-filter: blur(4px);
}

.unified-speed-controls.expanded {
    z-index: 1000 !important;
    position: relative;
    isolation: isolate;
}

.speed-toggle-btn {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 6px 10px;
    background: transparent;
    border: none;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 60px;
    justify-content: center;
    white-space: nowrap;
    box-shadow: none;
}

.speed-toggle-btn:hover {
    background: linear-gradient(145deg, #6b7280 0%, #4b5563 100%);
    border: 1px solid rgba(107, 114, 128, 0.4);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(107, 114, 128, 0.1);
}

.speed-toggle-btn .chevron {
    transition: transform 0.2s ease;
    font-size: 0.7rem;
    margin-left: 4px;
}

.speed-toggle-btn.expanded .chevron {
    transform: rotate(180deg);
}

/* Speed Dropdown - Modern Design */
.speed-buttons {
    display: none;
    position: fixed;
    z-index: 2147483647 !important;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: none;
    border-radius: 12px;
    padding: 4px;
    box-shadow: 
        0 12px 24px rgba(0, 0, 0, 0.1),
        0 4px 8px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    min-width: 80px;
    max-width: 80px;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px) scale(0.95);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.unified-speed-controls.expanded .speed-buttons {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateY(0) scale(1) !important;
}

.unified-speed-btn {
    padding: 1px 2px;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: none;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    min-width: 30px;
    white-space: nowrap;
    margin: 1px 0;
    width: 100%;
    margin-bottom: 6px;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.unified-speed-btn:hover {
    background: linear-gradient(145deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #374151;
    transform: translateY(-2px);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(59, 130, 246, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.unified-speed-btn:active {
    transform: translateY(0);
    transition: all 0.1s ease;
}

.unified-speed-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    font-weight: 700;
    border-color: #1d4ed8;
    box-shadow: 
        0 4px 12px rgba(59, 130, 246, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

body.speed-dropdown-open .audio-controls-inner:not(.current-dropdown-container .audio-controls-inner) {
    pointer-events: none !important;
    filter: brightness(0.95) !important;
}

body.speed-dropdown-open .current-dropdown-container .audio-controls-inner {
    z-index: 999998 !important;
    position: relative !important;
}

/* Play Button */
.unified-play-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 10px;
    background: transparent;
    color: #475569;
    border: none;
    border-radius: 50%;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: none;
    min-width: 44px;
    height: 44px;
}

.unified-play-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.unified-play-btn.loading {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    cursor: not-allowed;
}

.unified-play-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.unified-play-btn:hover::before {
    left: 100%;
}

.unified-play-btn:hover {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    border: 1px solid rgba(107, 114, 128, 0.6);
    transform: translateY(-1px) scale(1.02);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(107, 114, 128, 0.1),
        inset 0 1px 0 rgba(107, 114, 128, 0.2);
}

.unified-play-btn.playing {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: 1px solid rgba(59, 130, 246, 0.3);
    animation: pulse 2s infinite;
    box-shadow: 
        0 4px 12px rgba(59, 130, 246, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.9; 
        transform: scale(1.02);
    }
}

/* Audio controls container - Enhanced styling for message-controls */
/* Compact audio controls for WhatsApp-style messages */
.audio-controls.unified-style {
    margin: 0;
    padding: 0;
    overflow: visible !important;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 0;
    flex-shrink: 0;
    width: 70px;
    align-self: center;
    gap: 6px;
    min-height: 80px;
    margin-right: -8px;
}

/* When audio controls are in message-controls, make them always visible */
.message-controls .audio-controls.unified-style {
    opacity: 1 !important;
}

/* Make message-controls always visible when they contain audio controls */
.message-controls:has(.audio-controls.unified-style),
.message-controls.has-audio-controls {
    opacity: 1 !important;
}

.audio-controls-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    transition: all 0.3s ease;
    overflow: visible !important;
    box-shadow: none;
}

/* Feedback sections */
.feedback-section {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    overflow: visible !important;
    position: relative;
    z-index: auto;
}

.feedback-section h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.feedback-section p {
    margin-bottom: 12px;
    line-height: 1.6;
}

.feedback-section p strong {
    color: #1e40af;
    font-weight: 600;
}

/* Enhanced Cantonese Display */
.feedback-cantonese-block {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    position: relative;
    box-shadow: none;
    overflow: visible !important;
    z-index: 1;
}

.feedback-cantonese-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #06b6d4);
    border-radius: 12px 12px 0 0;
}

/* Consolidated cantonese-response-box styling moved below */

.cantonese-response-box .text-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Override the message-content first-child rule for cantonese-response-box */
.message.warm-message .message-content > .cantonese-response-box {
    display: flex !important;
    flex-direction: row !important;
}

.cantonese-response-box:hover {
    transform: none !important;
    box-shadow: none;
    border-color: transparent;
}

/* Force all containers to not interfere */
.feedback-cantonese-block,
.cantonese-response-box,
.audio-controls,
.audio-controls-inner,
.message,
.message-content,
.feedback-section {
    overflow: visible !important;
    transform: none !important;
    contain: none !important;
    position: relative;
    z-index: auto;
}

.family-response-header {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.section-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    margin: 12px 0 6px 0;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.cantonese-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
    line-height: 1.3;
    letter-spacing: 0.02em;
}

.pronunciation-text {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
    font-style: italic;
    line-height: 1.4;
    margin-bottom: 16px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    opacity: 0.8;
}

.meaning-text {
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 16px;
    font-style: italic;
    font-weight: 500;
}

.cantonese-word {
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.cantonese-word:hover {
    background: rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.pronunciation-word {
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.pronunciation-word:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #1e40af;
}

/* Highlight effects */
.cantonese-word.highlighted,
.pronunciation-word.highlighted {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Combined input area */
.input-area {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, #0f172a 0%, rgba(15, 23, 42, 0.95) 70%, transparent 100%);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 100;
    max-width: 100%;
}








/* Simple feedback system */
.simple-feedback {
    position: fixed;
    top: 80px;
    right: 20px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    font-size: 0.85rem;
    font-weight: 500;
    max-width: 300px;
}

.simple-feedback.show {
    opacity: 1;
    transform: translateX(0);
}

.simple-feedback.fade-out {
    opacity: 0;
    transform: translateX(100%);
}

.simple-feedback.success {
    border-left: 3px solid #10b981;
    color: #059669;
}

.simple-feedback.error {
    border-left: 3px solid #ef4444;
    color: #dc2626;
}

.simple-feedback.warning {
    border-left: 3px solid #f59e0b;
    color: #d97706;
}

.simple-feedback.info {
    border-left: 3px solid #3b82f6;
    color: #2563eb;
}

/* Recording indicator */
.recording-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    min-width: 320px;
    max-width: 90vw;
}

.recording-indicator.show {
    opacity: 1;
}

.recording-indicator.fade-out {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
}

.recording-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recording-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #374151;
    background: white;
    padding: 4px 8px;
    border-radius: 6px;
}

.status-pulse {
    animation: pulse 2s infinite;
}

.recording-timer {
    margin-left: auto;
    font-family: monospace;
    color: #059669;
    font-weight: bold;
}

.transcription-preview {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    min-height: 60px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.transcription-text {
    flex: 1;
    color: #374151;
    font-style: italic;
    /* Ensure visibility */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.transcription-status {
    font-size: 1.2rem;
    min-width: 24px;
    text-align: center;
}

.recording-hint {
    font-size: 0.8rem;
    color: #6b7280;
    text-align: center;
    border-top: 1px solid #f3f4f6;
    padding-top: 12px;
    margin-top: 8px;
}

/* Demo Play Button */
.demo-play-button {
    position: absolute !important;
    top: 20px !important;
    right: -80px !important;
    width: 50px !important;
    height: 50px !important;
    background-color: #ff0000 !important;
    border: 3px solid yellow !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 20px !important;
    z-index: 9999 !important;
    visibility: visible !important;
    opacity: 1 !important;
    cursor: pointer !important;
    transition: all 0.3s ease;
    animation: playPulse 2s infinite;
}

.demo-play-button:hover {
    background: #2563eb;
    transform: scale(1.1);
}

.demo-play-button.playing {
    background: #ef4444;
    animation: playingPulse 1s infinite;
}

@keyframes playPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes playingPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Word Highlighting - Match app style */
.cantonese-word {
    display: inline;
    transition: all 0.2s ease;
    background: transparent;
    color: #374151;
    font-weight: 500;
}

.cantonese-word.highlighted {
    background: #fff3cd !important;
    color: #856404 !important;
}

.pronunciation-word {
    display: inline;
    transition: all 0.2s ease;
}

.pronunciation-word.highlighted {
    background: #fff3cd !important;
    color: #856404 !important;
}

/* Hidden state */
.hidden {
    display: none !important;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.loading-spinner {
    text-align: center;
    color: #1e40af;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #1e40af;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner p {
    font-size: 16px;
    font-weight: 500;
    margin: 0;
}

/* Enhanced How It Works Section Styling */
.section-intro {
    text-align: center;
    margin-bottom: 1rem;
}

.intro-line {
    font-size: 1.3rem;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.intro-line:last-child {
    margin-bottom: 0;
    color: #475569;
    font-weight: 600;
}

.demo-caption {
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: #3b82f6;
    margin-bottom: 1.5rem;
    letter-spacing: 1px;
    position: relative;
    display: inline-block;
    padding: 8px 16px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    transition: all 0.3s ease;
}

.demo-caption:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .how-it-works-section {
        padding: 3rem 0 1.5rem 0;
    }
    
    .cta-section {
        padding: 1.5rem 0 3rem 0;
    }
    
    .intro-line {
        font-size: 1.1rem;
    }
    
    .demo-caption {
        font-size: 0.8rem;
        padding: 6px 12px;
        margin-bottom: 1.25rem;
    }
}

/* Conversation Interface */
.conversation-interface {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0f172a;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    visibility: visible;
    opacity: 1;
}

/* Sidebar Styles */
.conversation-sidebar {
    position: fixed;
    top: 0;
    left: -350px;
    width: 350px;
    height: 100vh;
    background: #1e293b;
    border-right: 1px solid #404040;
    z-index: 10001;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.conversation-sidebar.open {
    left: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #404040;
    background: #0f172a;
}

.sidebar-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.sidebar-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-close:hover {
    background: #404040;
    color: #ffffff;
}

.sidebar-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-actions {
    padding: 16px 20px;
    border-bottom: 1px solid #404040;
}

.new-conversation-btn {
    width: 100%;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

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

.conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.loading-conversations {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #6b7280;
    gap: 12px;
}

.loading-spinner-small {
    width: 24px;
    height: 24px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.conversation-item {
    padding: 16px 20px;
    border-bottom: 1px solid #404040;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    background: #1e293b;
    color: #ffffff;
}

.conversation-item:hover {
    background: #404040;
}

.conversation-item.active {
    background: #525252;
    border-left: 3px solid #9ca3af;
}

.conversation-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.conversation-title {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}


.conversation-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.conversation-item:hover .conversation-actions {
    opacity: 1;
}


/* Show delete buttons permanently on mobile */
@media (max-width: 768px) {
    .conversation-actions {
        opacity: 1;
    }
    
    .conversation-action-btn {
        padding: 6px;
        min-width: 32px;
        min-height: 32px;
    }
    
    .conversation-action-btn.delete {
        color: #dc2626;
    }
    
}

.conversation-action-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.conversation-action-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.conversation-action-btn.delete:hover {
    background: #fef2f2;
    color: #dc2626;
}

.conversation-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    color: #6b7280;
}

.conversation-date {
    display: flex;
    align-items: center;
    gap: 4px;
}

.conversation-turns {
    display: flex;
    align-items: center;
    gap: 4px;
}

.conversation-preview {
    font-size: 0.8rem;
    color: #d1d5db;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-style: italic;
}

.empty-conversations {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #6b7280;
}

.empty-conversations svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-conversations h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 8px 0;
}

.empty-conversations p {
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.4;
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.open {
    opacity: 1;
    visibility: visible;
}


/* Sidebar Toggle Button */
.sidebar-toggle {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.sidebar-toggle:hover {
    background: #f3f4f6;
    color: #374151;
}

.nav-left {
    display: flex;
    align-items: center;
}

/* Responsive Design for Sidebar */
@media (max-width: 768px) {
    .conversation-sidebar {
        width: 100vw;
        left: -100vw;
    }
    
    .sidebar-header {
        padding: 16px;
    }
    
    .sidebar-actions {
        padding: 12px 16px;
    }
    
    .conversation-item {
        padding: 12px 16px;
    }
    
    .conversation-title {
        font-size: 0.9rem;
    }
    
    .conversation-meta {
        font-size: 0.75rem;
        gap: 8px;
    }
    
    
    .new-conversation-btn {
        padding: 10px 14px;
        font-size: 0.85rem;
    }
}

/* Conversation Loading State - Apply to both mobile and desktop */
.conversation-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    color: #6b7280;
    min-height: 300px;
}

/* Modern Multi-Ring Spinner */
.modern-spinner {
    position: relative;
    width: 60px;
    height: 60px;
    margin-bottom: 30px;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-radius: 50%;
    animation: modernSpin 2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

.spinner-ring:nth-child(1) {
    border-top-color: #3b82f6;
    animation-delay: 0s;
}

.spinner-ring:nth-child(2) {
    border-right-color: #8b5cf6;
    animation-delay: 0.3s;
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
}

.spinner-ring:nth-child(3) {
    border-bottom-color: #06b6d4;
    animation-delay: 0.6s;
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
}

@keyframes modernSpin {
    0% {
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }
    50% {
        transform: rotate(180deg) scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: rotate(360deg) scale(1);
        opacity: 1;
    }
}

.conversation-loading h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: #374151;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.conversation-loading p {
    font-size: 0.95rem;
    margin: 0;
    color: #6b7280;
    opacity: 0.8;
    animation: pulse 2s ease-in-out infinite;
}

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

/* Load More Button Styles - Sleek and modern but subtle */
.load-more-conversations {
    padding: 16px;
    text-align: center;
}

.load-more-btn {
    background: rgba(255, 255, 255, 0.8) !important;
    color: #64748b !important;
    border: 1px solid rgba(226, 232, 240, 0.6) !important;
    border-radius: 12px;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    backdrop-filter: blur(8px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
}

.load-more-btn:hover {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #475569 !important;
    border-color: rgba(203, 213, 225, 0.8) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    background: rgba(248, 250, 252, 0.8) !important;
    color: #94a3b8 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.load-more-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 1px 3px rgba(0, 0, 0, 0.05);
}

.load-more-btn .loading-spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(100, 116, 139, 0.3);
    border-top: 2px solid #64748b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none; /* Hidden by default */
}

.load-more-btn .loading-spinner-small[style*="display: block"] {
    display: block !important;
}

/* Desktop sidebar improvements */
@media (min-width: 769px) {
    .conversation-sidebar {
        width: 320px;
    }
    
    .conversation-sidebar.open {
        left: 0;
    }
    
    /* Adjust main content when sidebar is open */
    .conversation-interface:has(.conversation-sidebar.open) .container {
        margin-left: 320px;
        transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* Adjust input area when sidebar is open - match container movement */
    .conversation-interface:has(.conversation-sidebar.open) .input-area {
        left: 320px;
        right: 0;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* Keep input area aligned with message boundaries */
    .conversation-interface:has(.conversation-sidebar.open) .futuristic-input-container {
        max-width: 100%;
    }
    
    /* Refined Load More button for desktop */
    .load-more-btn {
        padding: 12px 24px;
        font-size: 0.9rem;
        border-radius: 14px;
    }
    
    .load-more-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08), 0 3px 6px rgba(0, 0, 0, 0.05);
    }
    
    /* Ensure spinner is visible on desktop */
    .load-more-btn .loading-spinner-small {
        width: 18px;
        height: 18px;
        border: 2px solid rgba(100, 116, 139, 0.4);
        border-top: 2px solid #64748b;
    }
    
    /* Enhanced conversation loading for desktop */
    .conversation-loading {
        padding: 120px 40px;
        min-height: 400px;
    }
    
    .modern-spinner {
        width: 80px;
        height: 80px;
        margin-bottom: 40px;
    }
    
    .conversation-loading h3 {
        font-size: 1.5rem;
        margin-bottom: 16px;
    }
    
    .conversation-loading p {
        font-size: 1rem;
    }
}

/* Sidebar scrollbar styling */
.conversation-list::-webkit-scrollbar {
    width: 6px;
}

.conversation-list::-webkit-scrollbar-track {
    background: #1e293b;
}

.conversation-list::-webkit-scrollbar-thumb {
    background: #525252;
    border-radius: 3px;
}

.conversation-list::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* Animation for conversation items */
.conversation-item {
    animation: slideInFromLeft 0.3s ease-out;
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Loading state improvements */
.loading-conversations {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Conversation Interface Navigation */
.conversation-navbar {
    background: #0f172a;
    border-bottom: 1px solid #404040;
    z-index: 10000;
    position: relative;
}

.conversation-interface .container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
}



/* Desktop specific */
@media (min-width: 769px) {
    .conversation-journal {
        padding-bottom: 150px; /* Increased bottom padding for desktop */
        max-width: 900px; /* Constrain width on larger screens */
        width: 100%; /* Take full width up to max-width */
        margin: 0 auto; /* Center the journal */
    }
    
    .input-area {
        max-width: 900px; /* Match journal constraint */
        margin: 0 auto; /* Center the input area */
    }
    
    .keyboard-toggle {
        display: none;
    }
    
    .text-input-wrapper {
        max-width: 400px;
    }
    
    .floating-text-input {
        min-width: 200px;
    }

    .unified-speed-controls.expanded {
        background: none !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
    }

    .unified-speed-controls.expanded .speed-buttons {
        position: absolute !important;
        top: 100% !important;
        right: 0 !important;
        left: auto !important;
        margin-top: 8px !important;
        z-index: 1000 !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* ADD this rule to prevent flash: */
    .speed-buttons {
        opacity: 0 !important;
        visibility: hidden !important;
        transition: none !important; /* Disable CSS transitions */
    }

    .unified-speed-controls.expanded::before,
    .unified-speed-controls.expanded::after {
        display: none !important;
        content: none !important;
    }

    /* Prevent any container effects */
    .feedback-cantonese-block,
    .cantonese-response-box,
    .audio-controls,
    .audio-controls-inner {
        opacity: 1 !important;
        filter: none !important;
        position: relative !important;
        z-index: auto !important;
    }
    
    /* Ensure dropdown positions correctly */
    .speed-buttons {
        position: absolute !important;
        z-index: 1000 !important;
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .container {
        padding: 0 8px;
    }
    
    .top-bar-content {
        padding: 0 16px;
    }
    
    .conversation-journal {
        padding-bottom: 120px;
        padding-left: 0;
        padding-right: 0;
        max-width: none;
    }
    
    /* Make scenario chips full width on mobile */
    .scenario-chip-btn {
        width: 100%;
        flex: none;
    }
    
    /* Mobile optimizations for warm-message and audio controls */
    .message.warm-message {
        max-width: 95%;
        align-items: flex-start;
    }
    
    .message.warm-message .message-content {
        padding: 18px 20px;
        border-radius: 16px 16px 16px 4px;
        gap: 8px;
    }
    
    .audio-controls.unified-style {
        width: 55px;
        min-height: 70px;
        gap: 4px;
        margin-right: -6px;
    }
    
    .audio-controls-inner {
        gap: 4px;
    }
    
    .unified-play-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
        font-size: 0.8rem;
        padding: 8px;
        flex-shrink: 0;
    }
    
    .speed-toggle-btn {
        padding: 4px 8px;
        font-size: 0.65rem;
        min-width: 50px;
    }
    
    .speed-buttons {
        min-width: 70px;
        max-width: 70px;
        padding: 3px;
    }
    
    .unified-speed-btn {
        padding: 3px 6px;
        font-size: 0.65rem;
        margin: 1px 0;
    }
    
    .cantonese-response-box {
        gap: 0;
    }
    
    .cantonese-response-box .text-content {
        gap: 6px;
    }
    
    .family-response-header {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }
    
    .cantonese-text {
        font-size: 0.95rem;
        margin-bottom: 10px;
    }
    
    .pronunciation-text {
        font-size: 0.8rem;
        margin-bottom: 12px;
    }
    
    .meaning-text {
        font-size: 0.8rem;
        margin-bottom: 12px;
    }
    
    .audio-controls-inner {
        padding: 10px 12px;
        gap: 8px;
    }

    .unified-speed-controls.expanded .speed-buttons {
        display: block !important;
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) scale(1) !important;
        z-index: 2147483647 !important;
        min-width: 140px;
        max-width: 160px;
        background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%) !important;
        border: 1px solid rgba(226, 232, 240, 0.8) !important;
        border-radius: 16px !important;
        padding: 12px !important; 
        box-shadow: 
            0 16px 32px rgba(0, 0, 0, 0.18),
            0 0 0 1px rgba(255, 255, 255, 0.05),
            inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
        backdrop-filter: blur(8px) !important;
        visibility: visible !important;
        opacity: 1 !important;
        animation: modalFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        animation-fill-mode: both !important;
    }
    
    .unified-speed-controls.expanded {
        background: none !important;
        box-shadow: none !important;
    }

    .unified-speed-controls.expanded::before {
        content: '';
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        bottom: 100px;
        background: rgba(0, 0, 0, 0.3);
        z-index: 2147483646;
        pointer-events: auto;
    }
    
    /* Enhanced mobile button styling */
    .unified-speed-btn {
        padding: 8px 12px !important;
        font-size: 0.9rem !important;
        font-weight: 600 !important;
        border-radius: 10px !important;
        background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%) !important;
        border: 1px solid rgba(226, 232, 240, 0.6) !important;
        cursor: pointer !important;
        touch-action: manipulation !important;
        -webkit-tap-highlight-color: transparent !important;
        width: 100%;
        text-align: center !important;
        margin-bottom: 6px !important;
        line-height: 1.1 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 36px !important;
        box-shadow: 
            0 4px 8px rgba(0, 0, 0, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
    
    .unified-speed-btn:last-child {
        margin-bottom: 0 !important;
    }
    
    .unified-speed-btn:hover,
    .unified-speed-btn:active {
        background: linear-gradient(145deg, #f1f5f9 0%, #e2e8f0 100%) !important;
        transform: translateY(-2px) !important;
        box-shadow: 
            0 8px 16px rgba(0, 0, 0, 0.12),
            0 0 0 1px rgba(59, 130, 246, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    }
    
    .unified-speed-btn.active {
        background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%) !important;
        color: white !important;
        font-weight: 700 !important;
        border-color: #1d4ed8 !important;
        box-shadow: 
            0 6px 16px rgba(59, 130, 246, 0.4),
            0 0 0 1px rgba(255, 255, 255, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
        transform: translateY(-1px) !important;
    }
    
    

    /* Mobile body state when dropdown is open */
    body.speed-dropdown-open {
        overflow: hidden;
    }
    
}

/* index.html styles */
/* Onboarding Page Styles - Scoped to prevent conflicts */

.onboarding-view {
    margin: 0 auto;
    padding: 10px 10px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.onboarding-view .app-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 24px;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.25);
}

.onboarding-view h1 {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.onboarding-view .subtitle {
    font-size: 16px;
    color: #64748b;
    margin-bottom: 40px;
    line-height: 1.4;
}

.onboarding-view .example-section {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 32px;
    border: 1px solid #e2e8f0;
    text-align: left;
}

.onboarding-view .example-title {
    font-size: 15px;
    font-weight: 600;
    color: #3b82f6;
    margin-bottom: 16px;
    text-align: center;
}

.onboarding-view .chat-message {
    margin-bottom: 16px;
}

.onboarding-view .message-label {
    font-size: 11px;
    font-weight: 500;
    color: #94a3b8;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.onboarding-view .message-bubble {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 8px;
}

.onboarding-view .user-bubble {
    background: #f1f5f9;
    color: #1e293b;
}

.onboarding-view .ai-bubble {
    background: #eff6ff;
    color: #1e293b;
}

.onboarding-view .cantonese-response {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-top: 8px;
}

.onboarding-view .cantonese-text {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.onboarding-view .pronunciation {
    font-size: 12px;
    color: #64748b;
    font-family: 'SF Mono', Monaco, monospace;
    margin-bottom: 8px;
}

.onboarding-view .meaning {
    font-size: 12px;
    color: #64748b;
    font-style: italic;
    margin-bottom: 12px;
}

.onboarding-view .audio-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.onboarding-view .play-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.onboarding-view .speed-control {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 500;
    color: #475569;
}

.onboarding-view .steps-section {
    margin-bottom: 32px;
}

.onboarding-view .step {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    text-align: left;
}

.onboarding-view .step:last-child {
    margin-bottom: 0;
}

.onboarding-view .step-number {
    width: 28px;
    height: 28px;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    margin-right: 16px;
    flex-shrink: 0;
}

.onboarding-view .step-text {
    font-size: 15px;
    color: #475569;
    font-weight: 500;
}

.onboarding-view .start-button {
    width: 100%;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 18px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    margin-bottom: 16px;
}

.onboarding-view .start-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.onboarding-view .privacy-note {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.4;
}

.onboarding-view .privacy-highlight {
    color: #3b82f6;
    font-weight: 500;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .onboarding-view h1 {
        font-size: 24px;
    }
    
    .onboarding-view .subtitle {
        font-size: 15px;
    }
    
    .onboarding-view {
        padding: 10px 10px;
    }
}

/* Video Demo Section */
.video-demo {
    max-width: 600px;
    margin: 0 auto 24px;
    padding: 0 20px;
}

.video-placeholder {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    border: 2px dashed #cbd5e1;
    transition: all 0.3s ease;
    cursor: pointer;
}

.video-placeholder:hover {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    transform: translateY(-2px);
}

.video-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    display: block;
}

.video-placeholder h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.video-placeholder p {
    color: #6b7280;
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.play-video-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.play-video-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

@media (max-width: 768px) {
    .video-placeholder {
        padding: 30px 16px;
    }
    
    .video-icon {
        font-size: 2.5rem;
        margin-bottom: 12px;
    }
    
    .video-placeholder h3 {
        font-size: 1.1rem;
    }
    
    .video-placeholder p {
        font-size: 0.9rem;
        margin-bottom: 16px;
    }
    
    .play-video-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* Demo GIF styling */
.demo-gif {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 16px;
}

/* When GIF is present, hide the placeholder elements */
.video-placeholder.has-gif .video-icon,
.video-placeholder.has-gif .play-video-btn {
    display: none;
}

.video-placeholder.has-gif h3 {
    margin-bottom: 8px;
}

.video-placeholder.has-gif p {
    margin-bottom: 0;
}

/* Onboarding System */
.onboarding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.onboarding-modal {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

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

.onboarding-content h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 16px;
}

.onboarding-content p {
    font-size: 1.1rem;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 32px;
}

.onboarding-progress {
    margin-bottom: 32px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
}

.onboarding-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.onboarding-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 1rem;
}

.onboarding-btn.primary {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    color: white;
}

.onboarding-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3);
}

.onboarding-btn.secondary {
    background: white;
    color: #6b7280;
    border: 2px solid #e5e7eb;
}

.onboarding-btn.secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* Achievement Notifications */
.achievement-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
    z-index: 1001;
    animation: slideInRight 0.3s ease-out;
    max-width: 300px;
}

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

.achievement-content h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.achievement-content p {
    font-size: 0.9rem;
    opacity: 0.9;
    line-height: 1.4;
}

/* Progress Dashboard */
.progress-dashboard {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.progress-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1f2937;
}

.progress-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.progress-stat {
    text-align: center;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
}

.progress-stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 4px;
}

.progress-stat-label {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
}

.progress-achievements {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.achievement-badge {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.achievement-badge.earned {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

/* Responsive Design for Onboarding */
@media (max-width: 768px) {
    .onboarding-modal {
        padding: 24px;
        margin: 20px;
    }
    
    .onboarding-content h2 {
        font-size: 1.5rem;
    }
    
    .onboarding-content p {
        font-size: 1rem;
    }
    
    .onboarding-actions {
        flex-direction: column;
    }
    
    .achievement-notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Demo Showcase Styles */
.demo-showcase {
    max-width: 900px;
    margin: 0 auto 40px;
    position: relative;
    overflow: hidden;
    min-height: 400px;
}

.demo-step {
    display: none;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    max-width: 800px;
    margin: 0 auto;
}

.demo-step.active {
    display: block !important;
    animation: fadeInUp 0.5s ease;
}

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

.step-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 30px;
}

.step-number {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

.step-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.demo-content {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* Recording Indicator */
.recording-indicator {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    max-width: 500px;
    width: 100%;
    box-sizing: border-box;
}

.recording-status {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #3b82f6;
    color: white;
    border-radius: 12px;
    font-weight: 600;
}

.status-icon {
    font-size: 18px;
    animation: pulse 2s infinite;
}

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

.recording-timer {
    margin-left: auto;
    font-family: monospace;
    font-size: 14px;
}

.transcription-preview {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
}

.transcription-text {
    font-size: 1.1rem;
    color: #1e293b;
    line-height: 1.6;
    min-height: 24px;
}

/* Cantonese Response Box - consolidated styling */
.cantonese-response-box {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    position: relative;
    box-shadow: none;
    transition: none;
    overflow: visible !important;
    z-index: 1;
    display: flex !important;
    flex-direction: row !important;
    gap: 0;
    max-width: none;
    width: auto;
    box-sizing: border-box;
}

.family-response-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-weight: 700;
    color: #1e293b;
    font-size: 1.1rem;
}

.cantonese-text {
    font-size: 0.95rem;
    color: #1e293b;
    margin-bottom: 8px;
    line-height: 1.4;
    min-height: 24px;
}

.pronunciation-text {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 16px;
    font-style: italic;
    line-height: 1.5;
    min-height: 24px;
}

.meaning-text {
    font-size: 0.9rem;
    color: #64748b;
    font-style: italic;
    min-height: 20px;
}

.section-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

/* Word Highlighting Demo */
.word-highlighting-demo {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

.highlighting-text {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 16px;
    min-height: 40px;
}

.cantonese-word {
    background: #3b82f6;
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.cantonese-word:hover {
    background: #1e40af;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.cantonese-word {
    background: #3b82f6;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: inline-block;
    margin: 2px;
}

.cantonese-word:hover {
    background: #1e40af;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.cantonese-word.highlighted {
    background: #10b981;
    animation: highlightPulse 1s ease;
}

@keyframes highlightPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.hover-hint {
    font-size: 12px;
    color: #64748b;
    font-style: italic;
}



/* Responsive Design */
@media (max-width: 768px) {
    .demo-step {
        padding: 24px;
    }
    
    .step-header {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .demo-navigation {
        flex-direction: column;
        gap: 16px;
    }
    
    .nav-btn {
        width: 100%;
        max-width: 200px;
    }
}

/* Demo Steps */
.demo-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
    margin-bottom: 60px;
    /* Essential visibility */
    min-height: 100px;
}

.demo-step {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    /* Essential visibility */
    display: block;
    visibility: visible;
    opacity: 1;
    min-height: 50px;
}

.demo-step:hover {
    border-color: #3b82f6;
    transform: translateY(-5px);
    box-shadow: 0 20px 60px rgba(59, 130, 246, 0.1);
}



/* Phone Mockup Styles */
.phone-mockup {
    background: #1e293b;
    border-radius: 28px;
    padding: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 2px solid #334155;
    position: relative;
    max-width: 300px;
    margin: 0 auto;
}

.phone-mockup::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: #475569;
    border-radius: 2px;
}

.chat-preview {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8fafc;
    border-radius: 18px;
    padding: 14px;
    min-height: 280px;
}

.chat-message {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.4;
}

.chat-message.user {
    align-self: flex-end;
    background: #3b82f6;
    color: white;
    border-bottom-right-radius: 6px;
}

.chat-message.ai {
    align-self: flex-start;
    background: white;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 6px;
}

.message-pronunciation {
    font-size: 11px;
    color: #64748b;
    margin-top: 3px;
    font-style: italic;
}

.message-meaning {
    font-size: 11px;
    color: #64748b;
    margin-top: 3px;
    font-style: italic;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Chat Messages */
.chat-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    margin-bottom: 12px;
    position: relative;
}

.chat-message.user {
    align-self: flex-end;
    background: #3b82f6;
    color: white;
    border-bottom-right-radius: 6px;
    margin-left: auto;
}

.chat-message.ai {
    align-self: flex-start;
    background: white;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 6px;
    margin-right: auto;
}

.message-text {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 4px;
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    text-align: right;
}

/* Dark Mode Styles for Conversation Interface */
.conversation-interface {
    color: #ffffff;
}

.conversation-interface .message-text {
    color: #ffffff;
}

.conversation-interface .message.user-message .message-content {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: background-color 0.2s ease;
}

.conversation-interface .message.user-message .message-content:hover {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}

.conversation-interface .message.warm-message .message-content {
    background: linear-gradient(135deg, #374151 0%, #4b5563 50%, #374151 100%);
    border: 1px solid #6b7280;
    color: #ffffff;
    padding: 20px 24px;
    transition: background-color 0.2s ease;
}

.conversation-interface .message.warm-message .message-content:hover {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    border-radius: 12px !important;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.2),
        0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* Dark theme warm message container styling */
.conversation-interface .message.warm-message .message-content .warm-message-container {
    background: linear-gradient(135deg, #4b5563 0%, #6b7280 50%, #4b5563 100%);
    border: 1px solid #9ca3af;
    border-radius: 12px;
    padding: 16px 20px;
    margin: 8px 0;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.15),
        0 1px 2px rgba(0, 0, 0, 0.1);
}

/* When warm-message contains mixed-response-container in dark theme, use simpler styling */
.conversation-interface .message.warm-message .message-content:has(.mixed-response-container) {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

/* When warm-message contains simple-response in dark theme, use simpler styling */
.conversation-interface .message.warm-message .message-content:has(.simple-response) {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.conversation-interface .cantonese-text {
    color: #fbbf24;
}

.conversation-interface .pronunciation-text {
    color: #a78bfa;
}

.conversation-interface .meaning-text {
    color: #9ca3af;
}

.conversation-interface .thinking-text {
    color: #9ca3af;
}


.conversation-interface .new-conversation-btn {
    background: #3b82f6;
    color: #ffffff;
    border: 1px solid #2563eb;
}

.conversation-interface .new-conversation-btn:hover {
    background: #2563eb;
}

.conversation-interface .navbar {
    background: #0f172a;
    border-bottom: 1px solid #404040;
}

.conversation-interface .logo {
    color: #ffffff;
}

.conversation-interface .settings-btn,
.conversation-interface .sidebar-toggle {
    color: #9ca3af;
}

.conversation-interface .settings-btn:hover,
.conversation-interface .sidebar-toggle:hover {
    background: #404040;
    color: #ffffff;
}

/* Dark mode styles for settings text */
.conversation-interface .setting-label {
    color: #d1d5db;
}

.conversation-interface .setting-description {
    color: #9ca3af;
}

.conversation-interface .voice-name {
    color: #ffffff;
}

.conversation-interface .voice-icon {
    background: #404040;
}

.conversation-interface .voice-option-card.selected .voice-icon {
    background: #525252;
}

.conversation-interface .voice-description {
    color: #d1d5db;
}

.conversation-interface .load-more-btn {
    color: #ffffff !important;
    background: #404040 !important;
    border: 1px solid #525252 !important;
}

.conversation-interface .load-more-btn:hover {
    color: #ffffff !important;
    background: #525252 !important;
    border-color: #6b7280 !important;
}

/* Futuristic Input Area Styles */
.futuristic-input-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 300px;
    margin: 0 auto;
    padding: 20px;
}

@media (min-width: 768px) {
    .futuristic-input-container {
        max-width: 100%;
    }
}

@media (max-width: 767px) {
    .futuristic-input-container {
        max-width: 100%;
    }
}

.input-bar {
    position: relative;
    display: flex;
    align-items: center;
    background: linear-gradient(145deg, #334155, #0f172a);
    border: 2px solid #404040;
    border-radius: 25px;
    padding: 8px 16px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    width: 100%;
}

.input-bar:focus-within {
    border-color: #22d3ee;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 0 3px rgba(34, 211, 238, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.mic-button-futuristic {
    background: linear-gradient(145deg, #22d3ee, #06b6d4);
    border: 2px solid #0891b2;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease;
    margin-right: 12px;
    box-shadow: 0 2px 4px rgba(34, 211, 238, 0.2);
    position: relative;
    z-index: 10;
    pointer-events: auto;
    animation: mic-pulse 2s infinite;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.mic-button-futuristic .mic-icon {
    font-size: 20px;
    line-height: 1;
}

.mic-button-futuristic:hover {
    background: linear-gradient(145deg, #06b6d4, #0891b2);
    color: #ffffff;
    box-shadow: 0 3px 6px rgba(34, 211, 238, 0.3);
}

.mic-button-futuristic.recording {
    background: linear-gradient(145deg, #ef4444, #dc2626);
    color: #ffffff;
    animation: pulse-recording 1.5s infinite;
}


.futuristic-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 16px;
    padding: 12px 16px;
    font-family: inherit;
    width: 100%;
    min-width: 0;
    position: relative;
    z-index: 5;
    pointer-events: auto;
}

.futuristic-input::placeholder {
    color: #6b7280;
    font-style: italic;
}

.futuristic-input:focus {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.send-button-futuristic {
    background: linear-gradient(145deg, #6b7280, #4b5563);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
}

.send-button-futuristic:hover {
    background: linear-gradient(145deg, #9ca3af, #6b7280);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.input-bar:focus-within .send-button-futuristic {
    background: linear-gradient(145deg, #22d3ee, #06b6d4);
    color: #ffffff;
    box-shadow: 0 4px 8px rgba(34, 211, 238, 0.3);
}

.input-bar:focus-within .send-button-futuristic:hover {
    background: linear-gradient(145deg, #06b6d4, #0891b2);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(34, 211, 238, 0.4);
}

.send-button-futuristic:active {
    transform: translateY(0);
}

.input-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(34, 211, 238, 0.1), transparent);
    border-radius: 25px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.char-counter {
    position: absolute;
    top: -18px;
    right: 8px;
    font-size: 0.6rem;
    color: #9ca3af;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.char-counter.show {
    opacity: 1;
    visibility: visible;
}

.char-counter.warning {
    color: #f59e0b !important;
}

.char-counter.danger {
    color: #ef4444 !important;
}

.input-bar:focus-within .input-glow {
    opacity: 1;
}

@keyframes pulse-recording {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes mic-pulse {
    0%, 100% { 
        transform: scale(1) translateZ(0);
        box-shadow: 0 2px 4px rgba(34, 211, 238, 0.2);
    }
    50% { 
        transform: scale(1.02) translateZ(0);
        box-shadow: 0 3px 6px rgba(34, 211, 238, 0.3);
    }
}

.conversation-interface .nav-button {
    background: #404040;
    color: #ffffff;
    border: 1px solid #525252;
}

.conversation-interface .nav-button:hover {
    background: #525252;
}

/* Dark Mode Styles for Cantonese Response Box */
.conversation-interface .cantonese-response-box {
    background: transparent !important;
}

.conversation-interface .cantonese-text {
    color: #22d3ee;
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.2;
    margin-bottom: 2px;
}

.conversation-interface .pronunciation-text {
    color: #d1d5db;
    font-size: 0.8rem;
    font-style: italic;
    margin-top: 0;
    margin-bottom: 4px;
    line-height: 1.2;
}

.conversation-interface .meaning-text {
    color: #d1d5db;
    font-size: 0.9rem;
    margin-top: 0;
    margin-bottom: 0;
    line-height: 1.3;
}

.conversation-interface .cantonese-word {
    color: #22d3ee;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.2s ease;
}

.conversation-interface .cantonese-word:hover {
    color: #06b6d4;
}

.conversation-interface .pronunciation-word {
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.2s ease;
}

.conversation-interface .pronunciation-word:hover {
    color: #6b7280;
}



/* AI Response Text */
.cantonese-text {
    font-size: 0.95rem;
    color: #1e293b;
    margin-bottom: 8px;
    line-height: 1.6;
}

.pronunciation-text {
    font-size: 0.85rem;
    color: #64748b;
    font-style: italic;
    margin-bottom: 6px;
    line-height: 1.4;
}

.meaning-text {
    font-size: 0.85rem;
    color: #64748b;
    font-style: italic;
    line-height: 1.4;
}

/* Word Highlighting */
.cantonese-word {
    display: inline-block;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.cantonese-word:hover {
    background: #3b82f6;
    color: white;
}

.cantonese-word.highlighted {
    background: #3b82f6;
    color: white;
    animation: highlightPulse 1s ease;
}

@keyframes highlightPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}



/* Unified Demo Container */
.unified-demo-container {
    max-width: 600px;
    margin: 0 auto 40px;
    position: relative;
    overflow: hidden;
    min-height: 400px;
}

.demo-caption {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 20px;
    min-height: 30px;
    transition: opacity 0.3s ease;
}

/* Demo Recording Indicator */
.demo-recording-indicator {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 320px;
    max-width: 90vw;
    margin: 0 auto;
}

.recording-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recording-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #374151;
    background: white;
    padding: 4px 8px;
    border-radius: 6px;
}

.status-pulse {
    animation: pulse 2s infinite;
}

.recording-timer {
    margin-left: auto;
    font-family: monospace;
    color: #059669;
    font-weight: bold;
}

.transcription-preview {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    min-height: 60px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.transcription-text {
    flex: 1;
    color: #374151;
    font-style: italic;
    /* Ensure visibility */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.transcription-status {
    font-size: 1.2rem;
    min-width: 24px;
    text-align: center;
}

.recording-hint {
    font-size: 0.8rem;
    color: #6b7280;
    text-align: center;
    border-top: 1px solid #f3f4f6;
    padding-top: 12px;
    margin-top: 8px;
}

/* Demo Play Button */
.demo-play-button {
    position: absolute !important;
    top: 20px !important;
    right: -80px !important;
    width: 50px !important;
    height: 50px !important;
    background-color: #ff0000 !important;
    border: 3px solid yellow !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 20px !important;
    z-index: 9999 !important;
    visibility: visible !important;
    opacity: 1 !important;
    cursor: pointer !important;
    transition: all 0.3s ease;
    animation: playPulse 2s infinite;
}

.demo-play-button:hover {
    background: #2563eb;
    transform: scale(1.1);
}

.demo-play-button.playing {
    background: #ef4444;
    animation: playingPulse 1s infinite;
}

@keyframes playPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes playingPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Word Highlighting - Match app style */
.cantonese-word {
    display: inline;
    transition: all 0.2s ease;
    background: transparent;
    color: #374151;
    font-weight: 500;
}

.cantonese-word.highlighted {
    background: #fff3cd !important;
    color: #856404 !important;
}

.pronunciation-word {
    display: inline;
    transition: all 0.2s ease;
}

.pronunciation-word.highlighted {
    background: #fff3cd !important;
    color: #856404 !important;
}

/* Structured AI Response Styles */
.ai-response-structured {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.response-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-left: 3px solid transparent;
}

.cantonese-section {
    border-left-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.pronunciation-section {
    border-left-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.meaning-section {
    border-left-color: #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

.section-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.cantonese-section .section-label {
    color: #1d4ed8;
}

.pronunciation-section .section-label {
    color: #059669;
}

/* MICROPHONE ERROR POPUP */
.mic-error-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.mic-error-popup {
    background: white;
    border-radius: 12px;
    padding: 0;
    max-width: 450px;
    width: 90%;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.mic-error-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.mic-error-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.mic-error-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.mic-error-close:hover {
    background: #e5e7eb;
    color: #374151;
}

.mic-error-content {
    padding: 20px;
}

.mic-error-icon {
    font-size: 36px;
    text-align: center;
    margin-bottom: 12px;
}

.mic-error-message {
    text-align: center;
    margin-bottom: 16px;
}

.mic-error-message p {
    margin: 0;
    color: #dc2626;
    font-weight: 500;
    font-size: 16px;
}

.mic-error-troubleshooting {
    margin-bottom: 16px;
}

.mic-error-troubleshooting h4 {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 600;
    color: #374151;
}

.mic-error-troubleshooting ul {
    margin: 0;
    padding-left: 20px;
    color: #6b7280;
    line-height: 1.6;
}

.mic-error-troubleshooting li {
    margin-bottom: 8px;
}

.mic-error-troubleshooting .more-steps {
    margin: 12px 0 0 0;
    font-size: 14px;
    color: #9ca3af;
    font-style: italic;
}

.mic-error-troubleshooting kbd {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 12px;
    font-family: monospace;
    color: #374151;
}

.mic-error-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.mic-error-retry,
.mic-error-close-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mic-error-retry {
    background: #3b82f6;
    color: white;
}

.mic-error-retry:hover {
    background: #2563eb;
    transform: translateY(-1px);
}


.mic-error-close-btn {
    background: #6b7280;
    color: white;
}

.mic-error-close-btn:hover {
    background: #4b5563;
    transform: translateY(-1px);
}

/* Mobile responsiveness for microphone error popup */
@media (max-width: 768px) {
    .mic-error-popup {
        width: 95%;
        margin: 10px;
        max-height: 85vh;
    }
    
    .mic-error-content {
        padding: 16px;
    }
    
    .mic-error-header {
        padding: 12px 16px;
    }
    
    .mic-error-header h3 {
        font-size: 16px;
    }
    
    .mic-error-icon {
        font-size: 32px;
        margin-bottom: 10px;
    }
    
    .mic-error-message p {
        font-size: 14px;
    }
    
    .mic-error-troubleshooting h4 {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .mic-error-troubleshooting li {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .mic-error-actions {
        flex-direction: column;
    }
    
    .mic-error-retry,
    .mic-error-close-btn {
        width: 100%;
        padding: 12px;
    }
}

/* Restart Recording Button Styles */
.reset-recording-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    border: 1.5px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(59, 130, 246, 0.1);
    backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.reset-recording-btn:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2), 0 0 0 2px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px) scale(1.05);
}

.reset-recording-btn:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3), 0 0 0 1px rgba(59, 130, 246, 0.2);
    background: linear-gradient(135deg, #bfdbfe 0%, #93c5fd 100%);
}

.reset-recording-btn svg {
    color: #475569;
    transition: all 0.3s ease;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.reset-recording-btn:hover svg {
    color: #1d4ed8;
    transform: rotate(15deg);
    filter: drop-shadow(0 2px 4px rgba(59, 130, 246, 0.3));
}

.reset-recording-btn:active svg {
    transform: rotate(30deg) scale(0.95);
}

.reset-recording-btn:focus {
    outline: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.reset-recording-btn:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.reset-recording-btn[disabled],
.recording-indicator.restarting .reset-recording-btn {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
    transform: none !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(148, 163, 184, 0.2);
    background: linear-gradient(135deg, #e2e8f0 0%, #f1f5f9 100%) !important;
}

.recording-indicator.restarting .reset-recording-btn svg {
    color: #94a3b8;
    transform: none !important;
    filter: none !important;
}


.char-counter.warning {
    color: #f59e0b !important;
}

.char-counter.danger {
    color: #ef4444 !important;
}

/* Mobile responsiveness for restart button */
@media (max-width: 768px) {
    .reset-recording-btn {
        width: 32px;
        height: 32px;
    }
    
    .reset-recording-btn svg {
        width: 14px;
        height: 14px;
    }
    
    .char-counter {
        font-size: 10px;
        bottom: -18px;
    }
}

/* Demo phases - hidden by default */
.demo-phase {
    display: none;
}

/* Footer styles */
.footer {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    color: #6c757d;
    font-size: 14px;
}

.footer-copyright {
    margin: 0 0 10px 0;
}

.footer-links {
    margin: 10px 0;
}

.footer-link {
    color: #6c757d;
    text-decoration: none;
    margin: 0 15px;
}

.footer-disclaimer {
    margin: 10px 0 0 0;
    font-size: 12px;
}

/* Agent Selection Styles - TypingMind dark theme inspired */
.agent-selection {
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
    background: #0f172a;
    border-radius: 16px;
}

@media (max-width: 768px) {
    .agent-selection {
        max-width: none;
        margin: 0;
        border-radius: 0;
    }
}

.brand-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 40px;
}

.brand-image-logo {
    height: 80px;
    width: auto;
    opacity: 0.95;
    transition: opacity 0.3s ease;
    background: transparent !important;
    border: none;
    outline: none;
    filter: brightness(1.1) contrast(1.2) saturate(0.8);
    mix-blend-mode: screen;
}

.brand-image-logo:hover {
    opacity: 1;
}

.brand-title {
    font-size: 32px;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.3px;
    opacity: 0.95;
}

.brand-canto {
    color: #ffffff;
}

.brand-ai {
    color: #5b9bd5;
}

.agent-header {
    margin-bottom: 24px;
}

.agent-header h2 {
    font-size: 18px;
    font-weight: 500;
    color: #e0e0e0;
    margin: 0 0 12px 0;
    text-align: left;
}

.header-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #404040, transparent);
    margin: 0;
    width: 100%;
}

.agent-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-width: 800px;
}

.agent-card {
    background: #0f172a;
    border: none;
    border-radius: 16px;
    padding: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.agent-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #404040, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.agent-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
    background: #1e293b;
}

.agent-card:hover::before {
    opacity: 1;
}

.agent-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    background: transparent;
    color: #ffffff;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.agent-icon.translate,
.agent-icon.chat,
.agent-icon.vocab,
.agent-icon.grammar {
    background: transparent;
    color: #ffffff;
}

.agent-card:hover .agent-icon {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.agent-info {
    flex: 1;
}

.agent-title {
    font-size: 18px;
    font-weight: 500;
    color: #ffffff;
    margin: 0 0 2px 0;
    transition: color 0.3s ease;
    text-align: left;
}

.agent-description {
    font-size: 13px;
    color: #b0b0b0;
    margin: 0;
    line-height: 1.3;
    transition: color 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-interface-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #334155 20%, #334155 80%, transparent 100%);
    margin-top: 24px;
}

.agent-card:hover .agent-title {
    color: #ffffff;
}

.agent-card:hover .agent-description {
    color: #d0d0d0;
}

/* Agent Interface Styles */
.agent-interface {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
    background: #0f172a;
    border-radius: 16px;
}

.agent-header-section {
    text-align: center;
    margin: 0;
    padding: 0;
}

.agent-icon-large {
    font-size: 48px;
    margin: 0;
    padding: 0;
    display: block;
    line-height: 1;
}

.agent-title-large {
    font-size: 28px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    padding: 0;
    letter-spacing: -0.5px;
}

.change-agent-link {
    display: inline-block;
    color: #5b9bd5;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    padding: 0;
    transition: color 0.3s ease;
}

.change-agent-link:hover {
    color: #7bb3e0;
    text-decoration: underline;
}

.agent-description-large {
    font-size: 14px;
    color: #b0b0b0;
    line-height: 1.5;
    margin: 0;
    padding: 0;
    max-width: 600px;
    margin: 0 auto;
}

.welcome-section {
    background: #0f172a;
    border-radius: 12px;
    padding: 24px;
    border: none;
    transition: background-color 0.3s ease;
}

.welcome-section:hover {
    background: #1e293b;
}

.welcome-message {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.welcome-icon {
    font-size: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.welcome-text {
    font-size: 16px;
    color: #e0e0e0;
    line-height: 1.5;
    flex: 1;
}

/* Mobile styles for agent interface */
@media (max-width: 768px) {
    .agent-interface {
        padding: 16px;
        margin: 0;
        border-radius: 0;
    }
    
    .agent-icon-large {
        font-size: 40px;
        margin-bottom: 12px;
    }
    
    .agent-title-large {
        font-size: 24px;
    }
    
    .agent-description-large {
        font-size: 15px;
    }
    
    .welcome-section {
        padding: 20px;
    }
    
    .welcome-message {
        gap: 12px;
    }
    
    .welcome-icon {
        font-size: 20px;
    }
    
    .welcome-text {
        font-size: 15px;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .agent-selection {
        padding: 12px;
        margin: 0;
        border-radius: 12px;
        width: 100vw;
        margin-left: calc(-50vw + 50%);
        margin-right: calc(-50vw + 50%);
        max-width: 100vw;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    .brand-header {
        margin-bottom: 32px;
        gap: 12px;
    }
    
    .brand-image-logo {
        height: 60px;
    }
    
    .brand-title {
        font-size: 24px;
    }
    
    .agent-header {
        padding: 0 8px 0 12px;
    }
    
    .agent-header h2 {
        font-size: 16px;
    }
    
    .agent-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .agent-card {
        padding: 16px;
        gap: 12px;
        min-height: 80px;
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .agent-icon {
        width: 44px;
        height: 44px;
    }
    
    .agent-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .agent-title {
        font-size: 18px;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    .agent-description {
        font-size: 14px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* Mixed response container styles for Grammar Guru and Vocab Builder */
.mixed-response-container {
    background: #0f172a;
    border-radius: 12px;
    padding: 20px;
    margin: 8px 0;
    border: 1px solid #334155;
}

/* When mixed-response-container is inside a warm-message, remove the double styling */
.message.warm-message .message-content .mixed-response-container {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    border-radius: 0;
}

/* When simple-response is inside a warm-message, remove the double styling */
.message.warm-message .message-content .simple-response {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    border-radius: 0;
}

.english-explanation {
    color: #e0e0e0;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 14px;
    white-space: pre-line;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.english-explanation h1, .english-explanation h2, .english-explanation h3 {
    color: #ffffff;
    margin: 12px 0 8px 0;
}

.english-explanation strong {
    color: #5b9bd5;
    font-weight: 600;
}

.english-explanation ul, .english-explanation ol {
    margin: 8px 0;
    padding-left: 20px;
}

.english-explanation li {
    margin: 4px 0;
    color: #e0e0e0;
}

.english-explanation code {
    background: #1e293b;
    color: #5b9bd5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.english-explanation em {
    color: #fbbf24;
    font-style: italic;
}

.english-explanation strong {
    color: #ffffff;
    font-weight: 600;
}

.english-explanation h2 {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    margin: 16px 0 8px 0;
    border-bottom: 1px solid #334155;
    padding-bottom: 4px;
}

.english-explanation h3 {
    color: #e0e0e0;
    font-size: 16px;
    font-weight: 500;
    margin: 12px 0 6px 0;
}

.english-explanation ol {
    margin: 8px 0;
    padding-left: 20px;
}

.english-explanation ol li {
    margin: 4px 0;
    color: #e0e0e0;
}

/* Section headers for better organization */
.english-explanation .section-header {
    color: #60a5fa;
    font-weight: 600;
    font-size: 16px;
    margin: 16px 0 8px 0;
    padding: 8px 0;
    border-bottom: 1px solid #475569;
}

/* Quoted examples with special styling */
.english-explanation .quoted-example {
    background: #1e293b;
    color: #fbbf24;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    border: 1px solid #475569;
}

/* Cantonese words in explanations */
.english-explanation .cantonese-word-in-text {
    color: #34d399;
    font-weight: 600;
    background: rgba(52, 211, 153, 0.15);
    padding: 1px 4px;
    border-radius: 3px;
}

/* Pronunciation in explanations */
.english-explanation .pronunciation-in-text {
    color: #c084fc;
    font-size: 12px;
    font-style: italic;
}

.cantonese-examples {
    margin-top: 16px;
}

.cantonese-examples .cantonese-response-box {
    margin: 12px 0;
    background: linear-gradient(145deg, #1e293b, #334155);
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cantonese-examples .cantonese-response-box:hover {
    background: linear-gradient(145deg, #334155, #475569);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ============================================================================
   LANDING PAGE - DARK FUTURISTIC THEME
   ============================================================================ */

/* Base Landing Page Styles */
body:has(.landing-page) {
    background-color: #0f172a;
    color: #d1d5db;
}

.landing-page {
    background-color: #0f172a;
    color: #ffffff;
    min-height: 100vh;
}

/* Navigation - Dark Theme */
.landing-navbar {
    background: #0f172a !important;
    border-bottom: 1px solid #404040 !important;
    padding: 16px 0;
}

.landing-navbar .logo {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
}

.landing-navbar .nav-button.secondary {
    background: transparent;
    color: #d1d5db;
    border: 2px solid #404040;
}

.landing-navbar .nav-button.secondary:hover {
    background: #404040;
    color: #ffffff;
    border-color: #525252;
}

.landing-navbar .nav-button.primary-cyan {
    background: linear-gradient(145deg, #22d3ee, #06b6d4);
    color: #ffffff;
    border: 2px solid #0891b2;
    box-shadow: 0 2px 8px rgba(34, 211, 238, 0.3);
}

.landing-navbar .nav-button.primary-cyan:hover {
    background: linear-gradient(145deg, #06b6d4, #0891b2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 211, 238, 0.4);
}

/* Hero Section - Dark Theme */
.landing-hero {
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    padding: 80px 20px;
    min-height: 90vh;
    display: flex;
    align-items: center;
}

.landing-hero .hero-container {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.landing-hero .hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    color: #ffffff;
    margin-bottom: 24px;
}

.hero-title-highlight {
    color: #22d3ee;
    background: linear-gradient(145deg, #22d3ee, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tts-icon {
    font-size: 0.95rem;
    opacity: 0.85;
    cursor: pointer;
}

.landing-hero .hero-subtitle {
    font-size: 1.25rem;
    line-height: 1.6;
    color: #d1d5db;
    margin-bottom: 32px;
}

.landing-hero .hero-ctas {
    margin-bottom: 24px;
}

.landing-hero .hero-button.primary-cyan {
    background: linear-gradient(145deg, #22d3ee, #06b6d4);
    color: #ffffff;
    border: 2px solid #0891b2;
    padding: 18px 36px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(34, 211, 238, 0.3);
    min-width: 220px;
}

.landing-hero .hero-button.primary-cyan:hover {
    background: linear-gradient(145deg, #06b6d4, #0891b2);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 211, 238, 0.5);
}

.landing-hero .hero-button.primary-cyan.large {
    padding: 20px 40px;
    font-size: 1.3rem;
    min-width: 280px;
}

.landing-hero .hero-guarantee {
    color: #9ca3af;
    font-size: 0.9rem;
    margin-top: 12px;
}

.landing-hero .hero-trust {
    margin-top: 32px;
}

.trust-badge {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.3);
    border-radius: 8px;
    color: #22d3ee;
    font-size: 0.9rem;
}

.trust-text {
    color: #9ca3af;
    font-size: 0.9rem;
    margin-top: 16px;
}

/* Hero Visual - Minimal Chat Preview */
.hero-visual {
    position: relative;
}

/* Align hero chat demo flush-left within its column to avoid perceived extra right padding */
.landing-hero .hero-visual { justify-content: center; width: 100%; }
.landing-hero .hero-chat-demo { width: 100%; margin-left: auto; margin-right: auto; display: flex; justify-content: center; }

.hero-gradient-orb {
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: blur(60px);
    z-index: 1;
}

.hero-chat-preview-minimal {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 320px;
}

.chat-bubble-user {
    background: #334155;
    color: #ffffff;
    padding: 12px 18px;
    border-radius: 18px 18px 18px 4px;
    font-size: 0.95rem;
    align-self: flex-end;
    max-width: 80%;
}

.chat-bubble-ai {
    background: linear-gradient(145deg, #1e293b, #334155);
    border: 1px solid rgba(34, 211, 238, 0.2);
    padding: 16px 20px;
    border-radius: 18px 18px 4px 18px;
    align-self: flex-end;
    max-width: 85%;
}

.cantonese-text-cyan {
    color: #22d3ee;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 6px;
}

.pronunciation-text-small {
    color: #9ca3af;
    font-size: 0.8rem;
    font-style: italic;
}

.beta-badge-hero {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.3);
    border-radius: 20px;
    margin-bottom: 24px;
}

.beta-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #22d3ee;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 4px 8px;
    background: rgba(34, 211, 238, 0.2);
    border-radius: 4px;
}

.beta-text {
    font-size: 0.85rem;
    color: #d1d5db;
}

.hero-trust-badges {
    display: flex;
    justify-content: flex-start;
    gap: 24px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.trust-badge-item {
    color: #9ca3af;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hero-chat-demo {
    position: relative;
    z-index: 2;
    max-width: 500px;
    margin: 0 auto;
}

.chat-demo-container {
    background: linear-gradient(145deg, #1e293b, #334155);
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 520px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.chat-message {
    display: flex;
    flex-direction: column;
}

.chat-message.demo-user { align-items: flex-end; }
.chat-message.demo-ai { align-items: flex-start; }

.chat-message:last-child {
    margin-bottom: 0;
}

.message-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #22d3ee;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.demo-user .message-label { text-align: right; width: 100%; }
.demo-ai .message-label { text-align: left; width: 100%; }

.demo-user .message-content {
    background: #334155;
    color: #ffffff;
    padding: 14px 18px;
    border-radius: 12px;
    max-width: 80%;
    align-self: flex-end;
}

.demo-ai .message-content {
    background: transparent;
    padding: 0;
    max-width: 100%;
    align-self: flex-start;
}

.demo-ai .cantonese-text-cyan {
    color: #22d3ee;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 6px;
}

.pronunciation-text {
    color: #9ca3af;
    font-size: 0.85rem;
    font-style: italic;
    margin: 8px 0;
}

.meaning-text {
    color: #eaf5ff; /* more visible on dark bg */
    font-size: 0.95rem;
    font-weight: 500;
    margin: 8px 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-chat-demo { max-width: 100%; }
    .chat-demo-container { padding: 14px; gap: 12px; }
    .demo-user .message-content { max-width: 100%; }
}

/* .voice-hint removed with new TTS icon in hero */

.feature-example {
    margin-top: 16px;
    padding: 12px;
    background: rgba(34, 211, 238, 0.05);
    border-left: 2px solid #22d3ee;
    border-radius: 4px;
}

.example-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #22d3ee;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.example-text {
    font-size: 0.9rem;
    color: #d1d5db;
    line-height: 1.5;
}

.landing-trust {
    background: #0f172a;
    padding: 80px 20px;
    border-top: 0;
}

.trust-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 48px;
    max-width: 900px;
    margin: 48px auto 0;
}

.trust-stat {
    text-align: center;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: #22d3ee;
    margin-bottom: 8px;
    line-height: 1;
}

.stat-label {
    font-size: 1rem;
    color: #d1d5db;
}

@media (max-width: 768px) {
    .trust-stats {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .hero-trust-badges {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }
}

/* Section Titles */
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    margin-bottom: 16px;
}

.section-title-caps {
    font-size: 1rem !important;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #22d3ee;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: 1.8rem;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
    margin-bottom: 2rem;
}

.section-subtitle-caps {
    font-size: 1.2rem !important;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #9ca3af;
    margin-bottom: 2rem;
}

.section-intro {
    font-size: 1.1rem;
    color: #9ca3af;
    text-align: center;
    max-width: 700px;
    margin: 0 auto 48px;
    line-height: 1.6;
}

/* Features Section */
.landing-features {
    background: #0f172a;
    padding: 100px 20px;
}

.features-header {
    text-align: center;
    margin-bottom: 64px;
}

.features-icon-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.features-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(145deg, #22d3ee, #06b6d4);
    border-radius: 12px;
    position: relative;
}

.features-icon::before {
    content: "💬";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
}

.landing-features .section-title {
    color: #ffffff;
    text-shadow: 0 0 16px rgba(34, 211, 238, 0.25);
}

.features-intro {
    font-size: 1.1rem;
    color: #d1d5db;
    margin-top: 16px;
}

.features-grid-typingmind {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-item-typingmind, .feature-item {
    padding: 32px;
    background: linear-gradient(145deg, #1e293b, #334155);
    border: 1px solid rgba(34, 211, 238, 0.1);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.feature-item-typingmind:hover, .feature-item:hover {
    border-color: rgba(34, 211, 238, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(34, 211, 238, 0.1);
}

.feature-item-typingmind h3, .feature-item h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #22d3ee;
    margin-bottom: 12px;
}

.feature-item-typingmind p, .feature-item p {
    color: #d1d5db;
    line-height: 1.6;
    font-size: 1rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
}

.dark-card {
    background: linear-gradient(145deg, #334155, #0f172a);
    border: 1px solid #404040;
    border-radius: 16px;
    padding: 28px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.dark-card:hover {
    transform: translateY(-4px);
    border-color: #22d3ee;
    box-shadow: 0 8px 24px rgba(34, 211, 238, 0.2);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.dark-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 12px;
}

.feature-description {
    color: #d1d5db;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 16px;
}

.feature-benefits {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-benefits li {
    color: #9ca3af;
    font-size: 0.95rem;
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
}

.feature-benefits li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: #22d3ee;
    font-weight: 600;
}

/* How It Works Section */
/* old how-it-works styles removed */

/* Use Cases Section */
.landing-use-cases {
    background: #1e293b;
    padding: 100px 20px;
}

.modes-tabs {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 24px auto 24px;
    flex-wrap: wrap;
}

.mode-tab {
    background: #0f172a;
    border: 1px solid rgba(34, 211, 238, 0.3);
    color: #d1d5db;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-tab:hover { border-color: rgba(34, 211, 238, 0.6); color: #ffffff; }
.mode-tab.active { background: linear-gradient(145deg, #1e293b, #334155); color: #22d3ee; }

.mode-panels { max-width: 1000px; margin: 0 auto; }
.mode-panel { display: none; }
.mode-panel.active { display: block; }

.mode-caption {
    text-align: center;
    color: #9ca3af;
    margin-top: 12px;
}

.use-case-media {
    width: 100%;
    max-width: 880px; /* larger but still contained */
    margin: 0 auto 20px;
    border-radius: 12px;
    overflow: hidden;
    background: #0b1220;
    aspect-ratio: 16 / 9; /* consistent, non-tall layout */
}

.use-case-screenshot {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain; /* avoid cropping UI */
}

.use-case-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain; /* keep full frame visible */
    background: #0b1220;
}

@media (min-width: 1280px) {
    .use-case-media { max-width: 960px; }
}

@media (min-width: 1440px) {
    .use-case-media { max-width: 1040px; }
}

@media (max-width: 768px) {
    /* Make videos taller on mobile for readability */
    .use-case-media {
        max-width: 100%;
        aspect-ratio: 3 / 2; /* taller */
        min-height: 360px;
    }
    .modes-tabs { gap: 8px; }
}

.use-case-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.use-case-subtitle {
    color: #22d3ee;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.use-case-description {
    color: #d1d5db;
    line-height: 1.6;
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.use-case-examples {
    list-style: none;
    padding: 0;
    margin: 0;
}

.use-case-examples li {
    color: #9ca3af;
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
}

.use-case-examples li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #22d3ee;
}

/* FAQ Section */
.landing-faq {
    background: #0f172a;
    padding: 100px 20px;
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid #404040;
    margin-bottom: 0;
}

.faq-question {
    width: 100%;
    background: transparent;
    border: none;
    padding: 24px 0;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ffffff;
    transition: color 0.2s ease;
}

.faq-question:hover {
    color: #22d3ee;
}

.faq-question h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.faq-icon {
    font-size: 1.5rem;
    font-weight: 300;
    color: #22d3ee;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 20px;
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0;
}

.faq-question[aria-expanded="true"] + .faq-answer {
    max-height: 1000px;
    padding: 0 0 24px 0;
}

.faq-answer p {
    color: #d1d5db;
    line-height: 1.7;
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Final CTA Section */
.landing-final-cta {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    padding: 100px 20px;
    text-align: center;
}

.landing-final-cta .section-title {
    margin-bottom: 16px;
}

.cta-subtitle {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
    margin: 0.5rem auto 1rem;
    line-height: 1.4;
}

.cta-benefit {
    font-size: 1.1rem;
    color: #d1d5db;
    text-align: center;
    max-width: 700px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

.cta-benefits {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.cta-benefit-item {
    color: #d1d5db;
    font-size: 1rem;
}

.cta-trust {
    color: #9ca3af;
    font-size: 0.9rem;
    margin-top: 24px;
}

/* Footer - Dark Theme */
.landing-footer {
    background: #0f172a;
    border-top: 1px solid #404040;
    padding: 60px 20px 30px;
}

.landing-footer .footer-content {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 40px;
}

.footer-section {
    display: flex;
    flex-direction: column;
}

.footer-brand .logo {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.footer-tagline {
    color: #9ca3af;
    font-size: 0.9rem;
    margin: 0;
}

.footer-heading {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.footer-legal {
    opacity: 0.6;
}

.footer-legal .footer-link {
    font-size: 0.85rem;
    color: #6b7280;
}

.footer-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links-list li {
    margin-bottom: 12px;
}

.footer-link {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #22d3ee;
}

.footer-bottom {
    padding-top: 0;
    text-align: center;
    margin-top: 20px;
}

.footer-copyright {
    color: #6b7280;
    font-size: 0.9rem;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .landing-hero .hero-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .features-grid,
    .use-cases-grid {
        grid-template-columns: 1fr;
    }
    
    .steps-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .landing-footer .footer-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

@media (max-width: 768px) {
    .landing-hero {
        padding: 60px 20px;
    }
    
    .landing-hero .hero-title {
        font-size: 2.5rem;
    }
    
    .landing-hero .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .landing-features,
    .landing-use-cases,
    .landing-faq,
    .landing-final-cta {
        padding: 60px 20px;
    }
    
    .features-grid-typingmind {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .dark-card {
        padding: 24px;
    }
    
    .cta-benefits {
        flex-direction: column;
        gap: 16px;
    }
    
    .landing-footer .footer-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .landing-hero .hero-title {
        font-size: 2rem;
    }
    
    .landing-hero .hero-button.primary-cyan {
        width: 100%;
        min-width: auto;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .dark-card {
        padding: 20px;
    }
}

