/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-pink: #FF6B9D;
    --secondary-pink: #FFE1EC;
    --accent-pink: #FF9AC1;
    --text-primary: #1D1D1F;
    --text-secondary: #86868B;
    --background: #ffdaf1;
    --background-secondary: #FAF5F8;
    --surface: #FFFFFF;
    --surface-elevated: #FFFFFF;
    --border: #E5E5E7;
    --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-heavy: 0 8px 32px rgba(0, 0, 0, 0.12);
    --radius-small: 8px;
    --radius-medium: 12px;
    --radius-large: 16px;
    --radius-xl: 24px;
}

@font-face {
    font-family: 'Inter';
    src: local('Inter'), local('Inter-Regular');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Inter';
    src: local('Inter Bold'), local('Inter-Bold');
    font-weight: 700;
    font-style: normal;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, var(--background) 0%, var(--background-secondary) 50%, #f5b7dc 100%);
    background-size: 400% 400%;
    animation: gradientShift 12s ease-in-out infinite;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    font-feature-settings: 'kern' 1, 'liga' 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}



/* Visualizer */
#visualizer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.3;
}

/* Replace the existing pulse animation CSS with this stronger version for testing */

/* STRONGER pulse animation for testing - much more dramatic */
.audio-visualizer-container.pulse-only {
    animation: strongPulse 2s ease-in-out infinite;
    opacity: 0.7; /* More visible */
}

/* Remove the pulse animation when actively visualizing audio */
.audio-visualizer-container:not(.pulse-only) {
    animation: none;
    opacity: 1; /* Full opacity during active visualization */
}

/* MUCH stronger pulse keyframes for testing */
@keyframes strongPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0.5;
    }
    50% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* More dramatic background glow change */
.audio-visualizer-container.pulse-only {
    background: radial-gradient(circle at center, 
        rgba(255, 107, 157, 0.25) 0%, 
        rgba(255, 107, 157, 0.12) 50%, 
        rgba(255, 107, 157, 0.05) 100%);
}

/* Ensure smooth transitions between states */
.audio-visualizer-container {
    transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out;
}

/* Layout Components */
.app-container {
    position: relative;
    z-index: 1; /* Place above the background title */
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Center content vertically */
    padding: 40px 24px;
    box-sizing: border-box;
}

/* Background header */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    margin: 0;
    padding: 0;
    pointer-events: none;
    display: block;
    overflow: visible;
}

/* Title container */
.app-title {
    position: relative;
    width: 100%;
    height: 100vh;
    color: white;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.08em; /* Extremely tight letter spacing */
    display: block;
}

/* Base styles for both title lines */
.title-line {
    position: absolute;
    left: -5%; /* Extend beyond the container */
    width: 130%; /* Wider than container for extreme size */
    text-align: center;
    font-size: min(120vh, 150vw); /* MAXIMUM size */
    white-space: nowrap;
    font-weight: 900;
    line-height: 0.65; /* Ultra tight line height */
    transform: scale(1.2); /* Scale significantly beyond container */
    transform-origin: center center;
    display: block;
}




.title-line:first-child {
    position: absolute;
    top: -8vh; /* Push further beyond top edge */
    transform-origin: center top;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: min(25vh, 35vw); /* Larger size */
    white-space: nowrap;
    top: -5vh;
}

.title-line:last-child {
    position: absolute;
    bottom: -8vh; /* Push further beyond bottom edge */
    transform-origin: center bottom;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: min(25vh, 35vw); /* Larger size */
    white-space: nowrap;
    bottom: -1vh;
}



.form-label {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-pink);
    margin-bottom: 16px;
    text-align: center;
    width: 100%;
    display: block;
}

.form-select {
    width: 100%;
    max-width: 500px;
    padding: 14px 18px;
    border: 1px solid var(--primary-pink);
    border-radius: var(--radius-medium);
    background: rgba(255, 255, 255, 0.25);
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 24px;
    transition: all 0.3s ease;
    text-align: center;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-pink);
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.2);
}

/* Recording Indicator Styling */
.recording-indicator {
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: rgba(255, 128, 171, 0.15);
    border-radius: var(--radius-large);
    border: 2px solid var(--primary-pink);
    text-align: center;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-medium);
}

.indicator-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-pink);
    margin-bottom: 16px;
    letter-spacing: -0.1px;
}

.recording-pulse {
    width: 20px;
    height: 20px;
    background: var(--primary-pink);
    border-radius: 50%;
    margin: 0 auto;
    animation: pulse 1.5s ease-in-out infinite;
}

/* Button Styling (Confirm Mic & Stop Button) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius-medium);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    min-height: 54px;
    position: relative;
    overflow: hidden;
}

.btn-outline {
    background: transparent;
    color: var(--primary-pink);
    border: 2px solid var(--primary-pink);
    box-shadow: var(--shadow-light);
}

.btn-outline:hover {
    background: rgba(255, 107, 157, 0.1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-stop {
    background: transparent;
    color: var(--primary-pink);
    border: 2px solid var(--primary-pink);
    box-shadow: var(--shadow-light);
    margin: 5px auto;
    display: block;
    min-width: 200px;
    max-width: 200px;
    transition: all 0.2s ease;
}

.btn-stop:hover {
    background: rgba(255, 107, 157, 0.1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-stop:active {
    transform: translateY(0);
    background: rgba(255, 107, 157, 0.1);
}

/* Progress Section Styling */
.progress-section {
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-large);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.progress-label {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-align: center;
    letter-spacing: -0.1px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-pink) 0%, var(--accent-pink) 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}


/* Huge Pink Button Instead of Card */

/* Remove the existing main-card styles and replace with button styles */
.main-card {
    display: none; /* Hide the original card */
}

/* Create the huge button */
.huge-button {
    width: 100%;
    max-width: 2800px;
    margin: 0;
    background: #ffdaf1; /* Slightly brighter pink background */
    border-radius: var(--radius-xl);
    border: 2px solid var(--primary-pink); /* Same pink border as the BEGIN ADVENTURE button */
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    min-height: 400px;
    position: relative;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(255, 107, 157, 0.2);
}

.huge-button.hidden {
    display: none !important;
}

.huge-button:hover {
    transform: translateY(-5px) scale(1.02);
    background: rgba(255, 128, 171, 0.2); /* Slightly more opaque on hover */
    box-shadow: 
        0 12px 36px rgba(0, 0, 0, 0.15),
        0 0 0 2px rgba(255, 107, 157, 0.3);
}

.huge-button:active {
    transform: translateY(0) scale(0.98);
    background: rgba(255, 128, 171, 0.25); /* Even more opaque when clicked */
}

/* Style for the button text */
.button-text {
    font-size: 380px;
    font-weight: 900;
    color: var(--primary-pink);
    text-align: center;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.controls-container {
    position: fixed;
    bottom: 30px;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none; /* Let clicks pass through the container but not its children */
}

.controls-container > * {
    pointer-events: auto; /* Re-enable pointer events for children */
}



/* Story Section */
.story-section {
    padding: 40px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.story-text {
    font-size: 20px;
    line-height: 1.7;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 32px;
    font-weight: 400;
    letter-spacing: -0.2px;
}

/* Controls Section */
.controls-section {
    padding: 32px 40px;
    background: rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}



/* Improved Microphone Selector and Visualizer */

/* Device Selector Styling */
.device-selector {
    width: 100%;
    max-width: 800px;
    margin: 0 auto; /* CENTER the container */
    background: rgba(255, 128, 171, 0.15);
    border-radius: var(--radius-xl);
    border: 2px solid var(--primary-pink);
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: slideUp 0.6s ease-out;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(255, 107, 157, 0.2);
    text-align: center;
}

.form-group {
    display: flex;
    flex-direction: column;
    align-items: center; /* This centers the form elements */
    width: 100%;
}


/* Centered dropdown field with left-aligned text */
.form-select {
    width: 400px; /* Fixed width instead of 100% */
    max-width: 400px; /* Maximum width */
    padding: 14px 18px;
    border: 1px solid var(--primary-pink);
    border-radius: var(--radius-medium);
    background: rgba(255, 255, 255, 0.25);
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 24px;
    transition: all 0.3s ease;
    text-align: left; /* Keep text left-aligned */
    
    /* Center the dropdown field itself */
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-pink);
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.2);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-medium);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    letter-spacing: -0.1px;
    min-height: 48px;
    position: relative;
    overflow: hidden;
}

/* Button styling - already centered by the parent flexbox */
/* Button styling - already centered by the parent flexbox */
.btn-outline {
    background: transparent;
    color: var(--primary-pink);
    border: 2px solid var(--primary-pink);
    box-shadow: var(--shadow-light);
    padding: 14px 28px;
    border-radius: var(--radius-medium);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-outline:hover {
    background: rgba(255, 107, 157, 0.1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-outline:active {
    transform: translateY(0);
    background: rgba(255, 107, 157, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-pink) 0%, var(--accent-pink) 100%);
    color: white;
    box-shadow: var(--shadow-light);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

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

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-light);
}

.btn-secondary:hover {
    background: var(--background);
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.btn-stop {
    background: transparent;
    color: var(--primary-pink);
    border: 2px solid var(--primary-pink);
    box-shadow: var(--shadow-light);
}

.btn-stop:hover {
    background: rgba(255, 107, 157, 0.05);
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.btn-stop:active {
    transform: translateY(0);
    background: rgba(255, 107, 157, 0.1);
}

.control-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Recording Indicator */
.recording-indicator {
    display: none;
    text-align: center;
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(255, 107, 157, 0.1);
    border-radius: var(--radius-medium);
    border: 1px solid rgba(255, 107, 157, 0.2);
    opacity: 0;
    position: absolute;
}

.recording-indicator.active {
    display: block;
}

#indicatorText {
    display: none;
}

/* Enhanced Audio Visualizer Styles - Add these to your existing CSS */
/* Add these CSS updates to enhance the visualizer */

/* Enhanced Audio Visualizer Container */
.audio-visualizer-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    z-index: 5;
    display: none;
    pointer-events: none;
    background: radial-gradient(circle at center, 
        rgba(255, 107, 157, 0.08) 0%, 
        rgba(255, 107, 157, 0.03) 50%, 
        transparent 100%);
    border-radius: 50%;
    transition: all 0.3s ease-in-out;
}

.audio-visualizer-circle {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: visible; /* Allow glow effects to extend */
}





/* Canvas positioning and quality */
.audio-visualizer-circle canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    border-radius: 50%;
    will-change: transform;
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Enhanced animations */
@keyframes orbit {
    from {
        transform: rotate(0deg) scale(1);
        opacity: 0.6;
    }
    50% {
        opacity: 0.3;
        transform: rotate(180deg) scale(1.05);
    }
    to {
        transform: rotate(360deg) scale(1);
        opacity: 0.6;
    }
}

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

/* Active state for container */
.audio-visualizer-container.active {
    animation: containerBreath 4s ease-in-out infinite;
}

@keyframes containerBreath {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.02);
        opacity: 0.98;
    }
}

/* Ensure old bars are completely hidden */
.visualizer-bar {
    display: none !important;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .audio-visualizer-container {
        width: 450px;
        height: 450px;
    }
    
    .visualizer-center {
        width: 28px;
        height: 28px;
    }
    
    .audio-visualizer-circle canvas {
        image-rendering: optimizeSpeed;
        image-rendering: -webkit-optimize-contrast;
    }
    
    /* Reduce complexity on mobile */
    .visualizer-center::after {
        display: none;
    }
}

/* Add smooth fade transitions */
.audio-visualizer-container.fade-in {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.audio-visualizer-container.fade-out {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
}

.recording-pulse {
    width: 12px;
    height: 12px;
    background: var(--primary-pink);
    border-radius: 50%;
    margin: 0 auto;
    animation: pulse 1.5s ease-in-out infinite;
}

/* Progress Section */
.progress-section {
    width: 100%;
    max-width: 500px;
    margin: 10px auto;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-large);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.progress-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-align: center;
    letter-spacing: -0.1px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-pink) 0%, var(--accent-pink) 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Processing Animation - Sophisticated and High Design IQ */
.processing-animation {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 10;
}

.processing-container {
    text-align: center;
    animation: fadeInUp 0.4s ease-out;
}

.processing-orb {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
}

.orb-core {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--primary-pink), var(--accent-pink));
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: orbPulse 2s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(255, 107, 157, 0.3);
}

.orb-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 2px solid transparent;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: orbRotate 3s linear infinite;
}

.orb-ring-1 {
    width: 40px;
    height: 40px;
    border-top-color: rgba(255, 107, 157, 0.6);
    border-right-color: rgba(255, 107, 157, 0.3);
    animation-duration: 2s;
}

.orb-ring-2 {
    width: 60px;
    height: 60px;
    border-top-color: rgba(255, 107, 157, 0.4);
    border-left-color: rgba(255, 107, 157, 0.2);
    animation-duration: 3s;
    animation-direction: reverse;
}

.orb-ring-3 {
    width: 80px;
    height: 80px;
    border-top-color: rgba(255, 107, 157, 0.2);
    border-bottom-color: rgba(255, 107, 157, 0.1);
    animation-duration: 4s;
}

.processing-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: -0.2px;
    animation: textGlow 2s ease-in-out infinite alternate;
}

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

@keyframes orbPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.8;
    }
}

@keyframes orbRotate {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes textGlow {
    from {
        opacity: 0.7;
    }
    to {
        opacity: 1;
    }
}
.status-card {
    background: var(--surface);
    border-radius: var(--radius-large);
    padding: 24px;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border);
    text-align: center;
}

.status-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-pink) 0%, var(--accent-pink) 100%);
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.status-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.2px;
}

.status-description {
    font-size: 14px;
    color: var(--text-secondary);
    letter-spacing: -0.1px;
}

/* Animations */
@keyframes pulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1); 
    }
    50% { 
        opacity: 0.5; 
        transform: scale(1.1); 
    }
}

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

/* Loading States */
.loading-dots {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 20px;
}

.loading-dots div {
    position: absolute;
    top: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-pink);
    animation: loading-dots 1.2s linear infinite;
}

.loading-dots div:nth-child(1) { 
    left: 8px; 
    animation-delay: 0s; 
}

.loading-dots div:nth-child(2) { 
    left: 32px; 
    animation-delay: -0.4s; 
}

.loading-dots div:nth-child(3) { 
    left: 56px; 
    animation-delay: -0.8s; 
}

@keyframes loading-dots {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Elegant hover effects */
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

/* Focus states for accessibility */
.btn:focus-visible {
    outline: 2px solid var(--primary-pink);
    outline-offset: 2px;
}



/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        padding: 24px 16px;
        gap: 32px;
    }

    .app-title {
        font-size: clamp(60px, 12vw, 120px);
        margin-bottom: 16px;
    }

    .story-section {
        padding: 32px 24px;
        min-height: 300px;
    }

    .story-text {
        font-size: 18px;
        margin-bottom: 24px;
    }

    .controls-section {
        padding: 24px;
    }

    .progress-section {
        padding: 20px 24px;
    }

    .control-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
    .title-line {
        font-size: min(80vh, 90vw);
        transform: scale(1);
        left: 0;
        width: 100%;
        }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #F5F5F7;
        --text-secondary: #A1A1A6;
        --background: #1A1A1C;
        --background-secondary: #16161A;
        --surface: #2C2C2E;
        --surface-elevated: #3A3A3C;
        --border: #38383A;
    }

    body {
        background: linear-gradient(135deg, var(--background) 0%, var(--background-secondary) 50%, #1C1820 100%);
        background-size: 400% 400%;
        animation: gradientShift 12s ease-in-out infinite;
    }

    .app-title {
        color: rgba(245, 245, 247, 0.9);
    }

    .main-card {
        background: rgba(44, 44, 46, 0.15);
        box-shadow: 
            0 8px 32px rgba(0, 0, 0, 0.3),
            0 0 0 1px rgba(255, 255, 255, 0.05);
    }

    .controls-section {
        background: rgba(44, 44, 46, 0.1);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .progress-section {
        background: rgba(26, 26, 28, 0.1);
        border-top: 1px solid rgba(255, 255, 255, 0.05);
    }

    .processing-animation {
        background: rgba(44, 44, 46, 0.9);
    }
}

.status-description {
    font-size: 14px;
    color: var(--text-secondary);
    letter-spacing: -0.1px;
}

/* Animations */
@keyframes pulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1); 
    }
    50% { 
        opacity: 0.5; 
        transform: scale(1.1); 
    }
}

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

/* Loading States */
.loading-dots {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 20px;
}

.loading-dots div {
    position: absolute;
    top: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-pink);
    animation: loading-dots 1.2s linear infinite;
}

.loading-dots div:nth-child(1) { 
    left: 8px; 
    animation-delay: 0s; 
}

.loading-dots div:nth-child(2) { 
    left: 32px; 
    animation-delay: -0.4s; 
}

.loading-dots div:nth-child(3) { 
    left: 56px; 
    animation-delay: -0.8s; 
}

@keyframes loading-dots {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Elegant hover effects */
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

/* Focus states for accessibility */
.btn:focus-visible {
    outline: 2px solid var(--primary-pink);
    outline-offset: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        padding: 24px 16px;
        gap: 24px;
    }

    .app-title {
        font-size: 28px;
    }

    .app-subtitle {
        font-size: 16px;
    }

    .story-section {
        padding: 32px 24px;
        min-height: 300px;
    }

    .story-text {
        font-size: 18px;
        margin-bottom: 24px;
    }

    .controls-section {
        padding: 24px;
    }

    .progress-section {
        padding: 20px 24px;
    }

    .control-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #F5F5F7;
        --text-secondary: #A1A1A6;
        --background: #1D1D1F;
        --surface: #2C2C2E;
        --surface-elevated: #3A3A3C;
        --border: #38383A;
    }

    body {
        background: linear-gradient(135deg, var(--background) 0%, #000000 100%);
    }

    .main-card {
        background: rgba(44, 44, 46, 0.8);
    }

    .controls-section {
        background: rgba(44, 44, 46, 0.6);
    }

    .progress-section {
        background: rgba(29, 29, 31, 0.8);
    }
}