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

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --accent-color: #3b82f6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-glass: rgba(255, 255, 255, 0.95);
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --transition: all 0.2s ease;
    --font-size-base: 1rem;
    --font-size-sm: 0.875rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
}

/* Background Image */
.background-image {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    font-size: var(--font-size-base);
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

/* Navigation Bar */
.navbar {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

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

.nav-brand .logo {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.nav-brand .logo i {
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background: var(--bg-secondary);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
}

.nav-toggle:hover {
    background: var(--bg-secondary);
}

/* Header Styles */
.header {
    background: var(--bg-secondary);
    padding: 3rem 0;
    margin-bottom: 2rem;
    text-align: center;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
}

.page-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.subtitle {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    font-weight: 400;
}

/* Main Content */
.main-content {
    display: grid;
    gap: 3rem;
    grid-template-columns: 1fr;
}

/* Welcome Section */
.welcome-section {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg);
    padding: 3rem;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
}

.welcome-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

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

.welcome-text {
    text-align: center;
    margin-bottom: 3rem;
}

.welcome-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-description {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.8;
}

/* Audio Section */
.audio-section {
    margin-bottom: 3rem;
}

.audio-player-container {
    margin: 1rem 0;
}



/* Quick Actions */
.quick-actions {
    text-align: center;
}

.quick-actions h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.action-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem 2rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 200px;
    position: relative;
    overflow: hidden;
}

.action-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;
}

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

.action-btn.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border-color: transparent;
}

.action-btn.secondary {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.action-btn:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.action-btn i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.action-btn span {
    font-size: var(--font-size-lg);
    font-weight: 600;
}

.action-btn small {
    font-size: var(--font-size-sm);
    opacity: 0.8;
}

/* Features Section */
.features-section {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg);
    padding: 3rem;
    box-shadow: var(--shadow-xl);
}

.features-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 3rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.feature-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 2rem;
    box-shadow: var(--shadow-md);
}

.feature-card h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Instructions Section */
.instructions-section {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg);
    padding: 3rem;
    box-shadow: var(--shadow-xl);
}

.instructions-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 3rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.instructions-content {
    display: grid;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    transition: var(--transition);
}

.instruction-item:hover {
    transform: translateX(10px);
    box-shadow: var(--shadow-md);
}

.instruction-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xl);
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
}

.instruction-text h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.instruction-text p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Control Panel */
.control-panel {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.75rem;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transition: var(--transition);
}

.control-panel:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

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

.control-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: var(--font-size-sm);
}

.control-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.control-btn:active {
    transform: scale(0.95);
}

.control-btn i {
    font-size: 1rem;
}

/* Footer */
.footer {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    margin-top: 3rem;
    padding: 2rem 0;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    text-align: center;
}

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

.accessibility-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.accessibility-info i {
    color: var(--primary-color);
}

/* Modal Styles */
.modal {
    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: 2000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: var(--font-size-2xl);
    font-weight: 600;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
}

.close-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.shortcut-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.shortcut-item kbd {
    background: var(--text-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-family: monospace;
    font-weight: 600;
    min-width: 80px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.shortcut-item span {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Loading Overlay */
.loading-overlay {
    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(5px);
}

.loading-spinner {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    padding: 3rem;
    border-radius: var(--border-radius-lg);
    text-align: center;
    box-shadow: var(--shadow-xl);
}

.loading-spinner i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.loading-spinner p {
    color: var(--text-primary);
    font-weight: 500;
    font-size: var(--font-size-lg);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .logo {
        font-size: var(--font-size-3xl);
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .welcome-section,
    .features-section,
    .instructions-section {
        padding: 2rem;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .action-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .instruction-item {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .control-panel {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }
    
    .control-buttons {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .welcome-section,
    .features-section,
    .instructions-section {
        padding: 1.5rem;
    }
    
    .logo {
        font-size: var(--font-size-2xl);
    }
    
    .welcome-title,
    .features-title,
    .instructions-title {
        font-size: var(--font-size-2xl);
    }
    
    
    .control-btn {
        min-width: 50px;
        padding: 0.5rem;
    }
    
    .control-btn span {
        font-size: 0.75rem;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --bg-glass: white;
        --text-primary: #000;
        --text-secondary: #333;
        --border-color: #000;
    }
    
    .welcome-section,
    .features-section,
    .instructions-section,
    .header,
    .footer {
        border: 2px solid #000;
    }
}

/* Focus indicators for keyboard navigation */
button:focus,
input:focus,
select:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

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

/* Text size controls */
body.text-small {
    --font-size-base: 0.75rem;
    --font-size-sm: 0.625rem;
    --font-size-lg: 0.875rem;
    --font-size-xl: 1rem;
    --font-size-2xl: 1.125rem;
    --font-size-3xl: 1.25rem;
    --font-size-4xl: 1.5rem;
}

body.text-large {
    --font-size-base: 1.25rem;
    --font-size-sm: 1.125rem;
    --font-size-lg: 1.375rem;
    --font-size-xl: 1.5rem;
    --font-size-2xl: 1.875rem;
    --font-size-3xl: 2.25rem;
    --font-size-4xl: 3rem;
}

body.text-extra-large {
    --font-size-base: 1.5rem;
    --font-size-sm: 1.25rem;
    --font-size-lg: 1.75rem;
    --font-size-xl: 2rem;
    --font-size-2xl: 2.25rem;
    --font-size-3xl: 2.75rem;
    --font-size-4xl: 3.5rem;
}

body.text-huge {
    --font-size-base: 1.875rem;
    --font-size-sm: 1.5rem;
    --font-size-lg: 2.25rem;
    --font-size-xl: 2.5rem;
    --font-size-2xl: 3rem;
    --font-size-3xl: 3.5rem;
    --font-size-4xl: 4rem;
}

body.text-giant {
    --font-size-base: 2.25rem;
    --font-size-sm: 1.875rem;
    --font-size-lg: 2.75rem;
    --font-size-xl: 3rem;
    --font-size-2xl: 3.5rem;
    --font-size-3xl: 4rem;
    --font-size-4xl: 4.5rem;
}