/**
 * Podcast Submission App - Styles
 * "Eu Só Queria Transar"
 * 
 * Design System: Clean, Modern, Mobile-First
 */

/* ================================================================
   CSS Reset & Variables
   ================================================================ */

:root {
    /* Colors - Dark Mode (default) */
    --color-primary: #667eea;
    --color-primary-dark: #5a67d8;
    --color-secondary: #764ba2;
    --gradient-primary: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);

    --color-success: #4ade80;
    --color-warning: #fbbf24;
    --color-error: #ef4444;
    --color-info: #3b82f6;

    --color-bg: #0f0f1a;
    --color-bg-secondary: #1a1a2e;
    --color-bg-card: rgba(255, 255, 255, 0.03);
    --color-bg-input: rgba(255, 255, 255, 0.05);

    --color-text: #ffffff;
    --color-text-secondary: rgba(255, 255, 255, 0.7);
    --color-text-muted: rgba(255, 255, 255, 0.5);

    --color-border: rgba(255, 255, 255, 0.1);
    --color-border-focus: rgba(102, 126, 234, 0.5);

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;

    /* Layout */
    --max-width: 730px;
    --safe-area: 16px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 25px 50px rgba(0, 0, 0, 0.3);

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

/* ================================================================
   Light Mode Theme
   ================================================================ */

[data-theme="light"] {
    --color-bg: #f8f9fc;
    --color-bg-secondary: #eef1f6;
    --color-bg-card: rgba(0, 0, 0, 0.02);
    --color-bg-input: rgba(0, 0, 0, 0.03);

    --color-text: #1a1a2e;
    --color-text-secondary: rgba(26, 26, 46, 0.7);
    --color-text-muted: rgba(26, 26, 46, 0.5);

    --color-border: rgba(0, 0, 0, 0.08);
    --color-border-focus: rgba(102, 126, 234, 0.4);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 25px 50px rgba(0, 0, 0, 0.12);
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* ================================================================
   App Container
   ================================================================ */

html,
body {
    min-height: 100vh;
    overflow-x: hidden;
}

/* ================================================================
   App Container (Scrollable Area)
   ================================================================ */

.app-container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--spacing-xl) var(--safe-area);
    padding-bottom: 132px; /* Space for sticky bar + 64px gap */
    position: relative;
    z-index: 10;
}

/* Extra spacing before sticky bar */
.platforms-section {
    margin-bottom: 64px;
}

/* ================================================================
   Header
   ================================================================ */

.app-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    margin-bottom: var(--spacing-sm);
}

.logo-icon {
    font-size: 2.5rem;
}

.logo h1 {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-subtitle {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.tagline {
    color: var(--color-text-secondary);
    font-size: var(--font-size-base);
}

/* ================================================================
   Flash Messages
   ================================================================ */

.flash-message {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    font-weight: 500;
    text-align: center;
    animation: slideDown 0.3s ease;
}

.flash-success {
    background: rgba(74, 222, 128, 0.15);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: var(--color-success);
}

.flash-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--color-error);
}

.flash-warning {
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: var(--color-warning);
}

.flash-info {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--color-info);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Error States */
.input-error {
    border-color: var(--color-error) !important;
    background: rgba(239, 68, 68, 0.05) !important;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* ================================================================
   Tabs
   ================================================================ */

.tabs {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    background: var(--color-bg-card);
    padding: var(--spacing-xs);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.tab-btn:hover {
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.tab-icon {
    width: 20px;
    height: 20px;
}

/* ================================================================
   Tips Box
   ================================================================ */

.tips-box {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.tips-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--color-text);
}

.tips-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.tips-list li {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.tips-list li::before {
    content: '•';
    color: var(--color-primary);
    font-weight: bold;
    flex-shrink: 0;
}

/* ================================================================
   Tab Content
   ================================================================ */

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ================================================================
   Audio Recorder
   ================================================================ */

.audio-recorder {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
}

/* Visualizer Container */
.recorder-visualizer-container {
    position: relative;
    margin-bottom: var(--spacing-lg);
    height: 160px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="dark"] .recorder-visualizer-container {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Simple Animated Waveform */
.simple-waveform {
    height: 120px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-lg);
    border: 2px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 24px;
    overflow: hidden;
}

[data-theme="light"] .simple-waveform {
    background: rgba(0, 0, 0, 0.05);
}

.wave-bar {
    width: 6px;
    height: 8px;
    background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    border-radius: 3px;
    transition: height 0.1s ease;
}

/* Animação ativa quando gravando */
.simple-waveform.recording .wave-bar {
    animation: waveAnimation 1.2s ease-in-out infinite;
}

/* Delay diferente para cada barra criar efeito de onda */
.simple-waveform.recording .wave-bar:nth-child(1) {
    animation-delay: 0s;
}

.simple-waveform.recording .wave-bar:nth-child(2) {
    animation-delay: 0.06s;
}

.simple-waveform.recording .wave-bar:nth-child(3) {
    animation-delay: 0.12s;
}

.simple-waveform.recording .wave-bar:nth-child(4) {
    animation-delay: 0.18s;
}

.simple-waveform.recording .wave-bar:nth-child(5) {
    animation-delay: 0.24s;
}

.simple-waveform.recording .wave-bar:nth-child(6) {
    animation-delay: 0.30s;
}

.simple-waveform.recording .wave-bar:nth-child(7) {
    animation-delay: 0.36s;
}

.simple-waveform.recording .wave-bar:nth-child(8) {
    animation-delay: 0.42s;
}

.simple-waveform.recording .wave-bar:nth-child(9) {
    animation-delay: 0.48s;
}

.simple-waveform.recording .wave-bar:nth-child(10) {
    animation-delay: 0.54s;
}

.simple-waveform.recording .wave-bar:nth-child(11) {
    animation-delay: 0.60s;
}

.simple-waveform.recording .wave-bar:nth-child(12) {
    animation-delay: 0.54s;
}

.simple-waveform.recording .wave-bar:nth-child(13) {
    animation-delay: 0.48s;
}

.simple-waveform.recording .wave-bar:nth-child(14) {
    animation-delay: 0.42s;
}

.simple-waveform.recording .wave-bar:nth-child(15) {
    animation-delay: 0.36s;
}

.simple-waveform.recording .wave-bar:nth-child(16) {
    animation-delay: 0.30s;
}

.simple-waveform.recording .wave-bar:nth-child(17) {
    animation-delay: 0.24s;
}

.simple-waveform.recording .wave-bar:nth-child(18) {
    animation-delay: 0.18s;
}

.simple-waveform.recording .wave-bar:nth-child(19) {
    animation-delay: 0.12s;
}

.simple-waveform.recording .wave-bar:nth-child(20) {
    animation-delay: 0.06s;
}

@keyframes waveAnimation {

    0%,
    100% {
        height: 8px;
    }

    25% {
        height: 60px;
    }

    50% {
        height: 100px;
    }

    75% {
        height: 40px;
    }
}

/* Estado pausado - barras menores */
.simple-waveform.paused .wave-bar {
    animation: pausedAnimation 2s ease-in-out infinite;
}

@keyframes pausedAnimation {

    0%,
    100% {
        height: 8px;
    }

    50% {
        height: 20px;
    }
}

/* Recording Indicator */
.recording-indicator {
    display: none;
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(239, 68, 68, 0.9);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    align-items: center;
    gap: 8px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.recording-dot {
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.recorder-display {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

/* Timestamp Counter */
.recorder-time-container {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 4px;
    margin-bottom: var(--spacing-xs);
}

.recorder-time {
    font-size: 3.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: color 0.3s;
}

.recorder-time.warning {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.recorder-time.critical {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.recorder-time-max {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.recorder-status {
    color: var(--color-text-secondary);
    font-size: var(--font-size-base);
    margin-top: var(--spacing-xs);
}

.recorder-status.recording {
    color: var(--color-error);
    font-weight: 500;
}

.recorder-limit {
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    margin-top: var(--spacing-xs);
}

/* Social Network Checkboxes */
.social-options-multi {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.social-option-checkbox {
    flex: 1;
    min-width: 120px;
    cursor: pointer;
}

.social-option-checkbox input[type="checkbox"] {
    display: none;
}

.social-option-checkbox .social-option-content {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--color-bg-input);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all 0.3s;
}

.social-option-checkbox input[type="checkbox"]:checked+.social-option-content {
    border-color: var(--color-primary);
    background: rgba(102, 126, 234, 0.1);
}

.social-option-checkbox .social-icon {
    width: 24px;
    height: 24px;
}

.social-option-checkbox .social-name {
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.recorder-controls {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
}

.recorder-btn {
    min-width: 80px;
    height: auto;
    padding: 16px 24px;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-normal);
}

.recorder-btn svg {
    width: 28px;
    height: 28px;
}

.recorder-btn .btn-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Recorder Buttons */
.recorder-btn#btnRecord {
    background: rgba(255, 255, 255, 0.05);
    color: #fca5a5;
    /* Red-300 - softer red */
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.recorder-btn#btnRecord:hover {
    background: rgba(244, 63, 94, 0.1);
    /* Rose-500 low opacity */
    transform: scale(1.05);
    border-color: rgba(244, 63, 94, 0.4);
}

.recorder-btn#btnRecord.recording {
    background: #e11d48;
    /* Rose-600 - softer than pure red */
    color: white;
    border-color: #e11d48;
    box-shadow: 0 4px 20px rgba(225, 29, 72, 0.4);
    animation: pulse 1.5s infinite;
}

.recorder-btn#btnRecord.paused {
    background: #d97706;
    /* Amber-600 - softer warning color */
    color: white;
    border-color: #d97706;
    box-shadow: 0 4px 20px rgba(217, 119, 6, 0.4);
    animation: pulse-yellow 1.5s infinite;
}

/* .recorder-btn .material-icons removed - using SVG now */

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.7);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(225, 29, 72, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(225, 29, 72, 0);
    }
}

@keyframes pulse-yellow {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.7);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(217, 119, 6, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(217, 119, 6, 0);
    }
}

.recorder-btn#btnStop {
    background: rgba(255, 255, 255, 0.05);
    color: #e5e7eb;
    /* Gray-200 */
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.recorder-btn#btnStop:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.recorder-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Light Mode - Recorder Buttons */
[data-theme="light"] .recorder-btn#btnRecord {
    background: white;
    color: #e11d48;
    border: 2px solid #e11d48;
}

[data-theme="light"] .recorder-btn#btnRecord:hover {
    background: #fff1f2;
    /* Rose-50 */
    transform: scale(1.05);
}

[data-theme="light"] .recorder-btn#btnRecord.recording {
    background: #e11d48;
    color: white;
    border: 2px solid #e11d48;
}

[data-theme="light"] .recorder-btn#btnRecord.paused {
    background: #d97706;
    color: white;
    border-color: #d97706;
}

[data-theme="light"] .recorder-btn#btnStop {
    background: white;
    color: #374151;
    /* Gray-700 */
    border: 2px solid #e5e7eb;
    /* Gray-200 */
}

[data-theme="light"] .recorder-btn#btnStop:hover:not(:disabled) {
    background: #f9fafb;
    /* Gray-50 */
    border-color: #d1d5db;
    /* Gray-300 */
    color: #111827;
    /* Gray-900 */
}

[data-theme="light"] .recorder-btn:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    border-color: #e5e7eb;
    opacity: 0.7;
}

/* ================================================================
   Audio List
   ================================================================ */

.audio-list {
    margin-bottom: var(--spacing-md);
}

.audio-list-empty {
    text-align: center;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    padding: var(--spacing-lg);
}

.audio-item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

/* Linha 1: Player de áudio */
.audio-item-player-row {
    width: 100%;
}

.audio-item-player-row .custom-player {
    margin-top: 0;
}

/* Linha 2: Meta info e ações */
.audio-item-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.audio-item-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.audio-item-name {
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.audio-item-duration {
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
}

.audio-item-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* Status badges */
.audio-status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.audio-status-badge.success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.audio-status-badge.error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.audio-status-badge.uploading {
    background: rgba(102, 126, 234, 0.15);
    color: var(--color-primary);
}

.audio-item-player {
    flex: 2;
}

.audio-item-player audio {
    width: 100%;
    height: 36px;
}

.audio-item-delete {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: none;
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-error);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.audio-item-delete:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: scale(1.05);
}

.audio-item-delete:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* Upload progress */
.upload-progress-track {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    width: 100%;
}

.upload-progress-fill {
    height: 100%;
    background: var(--color-primary);
    transition: width 0.2s;
}

.audio-counter {
    text-align: center;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

/* ================================================================
   Bottom Sheet
   ================================================================ */

.bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    transition: background 0.3s ease;
}

.bottom-sheet-overlay.active {
    background: rgba(0, 0, 0, 0.6);
}

.bottom-sheet {
    background: var(--color-bg-secondary, #1a1a2e);
    border-radius: 20px 20px 0 0;
    padding: 16px 24px 32px;
    width: 100%;
    max-width: 500px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.bottom-sheet-overlay.active .bottom-sheet {
    transform: translateY(0);
}

.bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 0 auto 20px;
}

.bottom-sheet-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-text);
}

.bottom-sheet-message {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.bottom-sheet-actions {
    display: flex;
    gap: 12px;
}

.bottom-sheet-btn {
    flex: 1;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.bottom-sheet-btn.cancel {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text-secondary);
}

.bottom-sheet-btn.cancel:hover {
    background: rgba(255, 255, 255, 0.15);
}

.bottom-sheet-btn.confirm {
    background: var(--gradient-primary);
    color: white;
}

.bottom-sheet-btn.danger {
    background: #ef4444;
    color: white;
}

.bottom-sheet-btn.danger:hover {
    background: #dc2626;
}

/* ================================================================
   Text Editor
   ================================================================ */

.text-editor {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--spacing-md);
}

.editor-toolbar {
    display: flex;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--color-border);
}

.toolbar-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-base);
    transition: all var(--transition-fast);
}

.toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text);
}

.toolbar-btn.active {
    background: var(--color-primary);
    color: white;
}

.editor-content {
    min-height: 250px;
    max-height: 400px;
    overflow-y: auto;
    padding: var(--spacing-lg);
    font-size: var(--font-size-base);
    line-height: 1.8;
    color: var(--color-text);
    outline: none;
}

.editor-content:empty::before {
    content: attr(data-placeholder);
    color: var(--color-text-muted);
    pointer-events: none;
}

.editor-content:focus {
    background: rgba(102, 126, 234, 0.03);
}

.autosave-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.autosave-status.visible {
    opacity: 1;
}

/* ================================================================
   Form Elements
   ================================================================ */

.form-section {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.section-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
    color: var(--color-text);
}

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
}

.form-input {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--color-bg-input);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    transition: all var(--transition-fast);
}

.form-input::placeholder {
    color: var(--color-text-muted);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-border-focus);
    background: rgba(102, 126, 234, 0.05);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ================================================================
   Social Options
   ================================================================ */

.social-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
}

@media (max-width: 480px) {
    .social-options {
        grid-template-columns: 1fr;
    }
}

.social-option {
    cursor: pointer;
}

.social-option input {
    display: none;
}

.social-option-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: var(--color-bg-input);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.social-option input:checked+.social-option-content {
    border-color: var(--color-primary);
    background: rgba(102, 126, 234, 0.1);
}

.social-option:hover .social-option-content {
    border-color: rgba(102, 126, 234, 0.3);
}

.social-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.social-name {
    font-size: var(--font-size-sm);
    font-weight: 500;
}

/* ================================================================
   Checkbox Options
   ================================================================ */

.checkbox-option {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    cursor: pointer;
    padding: 8px 0;
    margin-bottom: 8px;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.checkbox-option:hover {
    background: rgba(255, 255, 255, 0.02);
}

.checkbox-option input {
    display: none;
}

.checkbox-custom {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.checkbox-option input:checked+.checkbox-custom {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.checkbox-option input:checked+.checkbox-custom::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.checkbox-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.checkbox-terms {
    margin-top: 0;
    padding: 0;
}

.terms-section .form-section {
    margin-bottom: var(--spacing-lg);
}

/* ================================================================
   reCAPTCHA
   ================================================================ */

.recaptcha-container {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-lg);
}

.recaptcha-container>div {
    transform-origin: center;
}

@media (max-width: 400px) {
    .recaptcha-container>div {
        transform: scale(0.9);
    }
}

/* ================================================================
   Submit Button
   ================================================================ */

.btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-submit:active:not(:disabled) {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-submit .btn-loading {
    display: none;
}

.btn-submit.loading .btn-text {
    display: none;
}

.btn-submit.loading .btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ================================================================
   Footer
   ================================================================ */

.app-footer {
    text-align: center;
    padding: var(--spacing-xl) 0;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.footer-spacer {
    height: 64px;
}

/* ================================================================
   Toast Messages
   ================================================================ */

.toast-container {
    position: fixed;
    bottom: var(--spacing-lg);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    width: calc(100% - var(--spacing-xl));
    max-width: 400px;
}

.toast {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
}

.toast.toast-out {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

.toast-icon {
    font-size: 1.25rem;
}

.toast-message {
    flex: 1;
    font-size: var(--font-size-sm);
}

.toast-success {
    border-left: 3px solid var(--color-success);
}

.toast-error {
    border-left: 3px solid var(--color-error);
}

.toast-info {
    border-left: 3px solid var(--color-info);
}

/* ================================================================
   Upload Progress
   ================================================================ */

.upload-progress {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--spacing-sm);
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

/* ================================================================
   Responsive Adjustments
   ================================================================ */

@media (max-width: 768px) {
    .logo h1 {
        font-size: var(--font-size-xl);
    }

    .recorder-time {
        font-size: 2.5rem;
    }

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

    .audio-item {
        flex-wrap: wrap;
    }

    .audio-item-player {
        flex: 1 1 100%;
        order: 3;
        margin-top: var(--spacing-md);
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: var(--spacing-lg) var(--safe-area);
    }

    .tab-btn {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: var(--font-size-sm);
    }

    .tab-btn .tab-icon {
        display: none;
    }

    .recorder-btn {
        width: 56px;
        height: 56px;
    }

    .recorder-btn svg {
        width: 24px;
        height: 24px;
    }
}

/* ================================================================
   Hidden Utility
   ================================================================ */

.hidden {
    display: none !important;
}

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

/* ================================================================
   Avatar
   ================================================================ */

.avatar-container {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-lg);
}

.avatar-img {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
    transition: transform var(--transition-normal);
}

.avatar-img:hover {
    transform: scale(1.05);
}

/* ================================================================
   Podcast Platforms
   ================================================================ */

.platforms-section {
    margin-top: var(--spacing-2xl);
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--color-border);
    text-align: center;
}

.platforms-title {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-md);
}

.platforms-grid {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.platform-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    transition: all var(--transition-normal);
    text-decoration: none;
}

.platform-link:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.platform-link:active {
    transform: translateY(0);
}

.platform-icon {
    width: 24px;
    height: 24px;
    transition: all var(--transition-fast);
}

/* Light mode: icons need more contrast */
[data-theme="light"] .platform-icon {
    filter: brightness(0.3);
}

[data-theme="light"] .platform-link:hover .platform-icon {
    filter: brightness(0.1);
}

/* Dark mode: icons slightly dimmed until hover */
[data-theme="dark"] .platform-icon,
:root .platform-icon {
    opacity: 0.7;
}

[data-theme="dark"] .platform-link:hover .platform-icon,
:root .platform-link:hover .platform-icon {
    opacity: 1;
}

/* Upload Overlay */
.upload-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 15, 26, 0.9);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.upload-overlay.active {
    display: flex;
    opacity: 1;
}

.upload-modal {
    background: #1e1e2d;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 32px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.upload-overlay.active .upload-modal {
    transform: translateY(0);
}

.upload-icon-container {
    margin-bottom: 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-spinner {
    width: 50px;
    height: 50px;
    color: var(--color-primary);
    animation: spin 1s linear infinite;
}

.upload-error-icon {
    font-size: 3rem;
    color: var(--color-error);
}

.upload-success-icon {
    font-size: 3rem;
    color: var(--color-success);
}

.upload-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #fff;
}

.upload-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.progress-container {
    margin-bottom: 20px;
}

.progress-bar-track {
    background: rgba(255, 255, 255, 0.1);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-fill {
    height: 100%;
    background: var(--gradient-primary);
    width: 0%;
    transition: width 0.2s ease;
}

.progress-text {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: right;
}

.upload-error-details {
    text-align: left;
    background: rgba(0, 0, 0, 0.3);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.error-label {
    font-size: 0.75rem;
    color: rgba(239, 68, 68, 0.8);
    margin-bottom: 4px;
    font-weight: 600;
}

.upload-error-details code {
    display: block;
    font-family: monospace;
    font-size: 0.8rem;
    color: #ef4444;
    word-break: break-all;
    margin-bottom: 16px;
}

.btn-close-error {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    font-weight: 600;
}

.btn-close-error:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ================================================================
   WIZARD MODE & NEW UX
   ================================================================ */

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-bg);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s;
}

.preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

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

.logo-pulse {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-md);
    animation: preloaderPulse 2s infinite ease-in-out;
}

.logo-pulse img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

@keyframes preloaderPulse {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4);
    }

    70% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 0 15px rgba(102, 126, 234, 0);
    }

    100% {
        transform: scale(0.95);
        opacity: 0.8;
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

.loading-bar-container {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto 8px;
}

.loading-bar {
    height: 100%;
    width: 30%;
    background: var(--gradient-primary);
    animation: loadingBarAnim 1.5s infinite linear;
}

@keyframes loadingBarAnim {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(300%);
    }
}

/* Wizard Steps */
.wizard-step {
    display: none;
    animation: fadeInStep 0.4s ease forwards;
}

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

@keyframes fadeInStep {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.step-header h2 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-xs);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.step-header p {
    color: var(--color-text-muted);
}

/* Progress Indicator */
.wizard-progress {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: var(--spacing-xl);
    padding: 0 var(--spacing-lg);
}

.step-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-border);
    transition: all 0.3s ease;
}

.step-dot.active {
    background: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
}

.step-line {
    flex: 1;
    height: 2px;
    background: var(--color-border);
    margin: 0 8px;
    max-width: 60px;
}

/* Type Cards (Audio vs Text) */
.story-type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.type-card {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
}

.type-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.3);
}

.type-card.selected {
    background: rgba(102, 126, 234, 0.08);
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Large Type Cards for Step 1 */
.story-type-selector-large {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.type-card-large {
    padding: var(--spacing-lg);
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
    gap: var(--spacing-lg);
    align-items: center;
}

.type-card-large .card-icon-64 {
    width: 64px;
    height: 64px;
    min-width: 64px;
    min-height: 64px;
    flex-shrink: 0;
}

.type-card-large .card-icon-64 svg {
    width: 100%;
    height: 100%;
}

.type-card-large .card-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.type-card-large .card-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.type-card-large .card-desc {
    font-size: 0.875rem;
    opacity: 0.7;
    line-height: 1.4;
}

/* Type Badge for Step 2 */
.step-type-badge {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md) var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.step-type-badge .badge-icon {
    font-size: 1.5rem;
}

.step-type-badge .badge-text {
    flex: 1;
    font-weight: 600;
    color: var(--color-text);
}

.step-type-badge .badge-change {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--color-text-muted);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.step-type-badge .badge-change:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--color-text);
}

.hidden-radio {
    display: none;
}

.card-icon svg {
    width: 40px;
    height: 40px;
    color: var(--color-text-muted);
    transition: color 0.3s;
}

.type-card.selected .card-icon svg {
    color: var(--color-primary);
}

.card-title {
    font-weight: 600;
    font-size: 1.1rem;
    display: block;
}

.card-desc {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    line-height: 1.4;
}

/* Toggle Switch */
.toggle-switch-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    transition: border-color 0.2s;
}

.toggle-switch-container:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--color-border);
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--color-primary);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

/* Social Radio Cards */
.social-option-radio-card {
    flex: 1;
    min-width: 100px;
    cursor: pointer;
}

.social-option-radio-card input {
    display: none;
}

.social-card-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.social-option-radio-card input:checked+.social-card-content {
    background: rgba(102, 126, 234, 0.1);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary);
}

.social-option-radio-card:hover .social-card-content {
    border-color: rgba(255, 255, 255, 0.3);
}

/* Hidden Height Animation */
.hidden-height {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(0, 1, 0, 1), opacity 0.4s ease;
}

.hidden-height.open {
    max-height: 500px;
    /* Arbitrary large value */
    opacity: 1;
    transition: max-height 0.6s ease-in-out, opacity 0.4s ease;
    margin-top: var(--spacing-md);
}

/* Step Actions */
/* Sticky Action Bar (Global) */
.sticky-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    padding: var(--spacing-sm) var(--spacing-lg);
    padding-bottom: calc(var(--spacing-sm) + env(safe-area-inset-bottom, 0px));
    z-index: 100;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.step-actions-group {
    display: none;
    gap: var(--spacing-md);
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
}

.step-actions-group.active {
    display: flex;
}

/* Single button - right aligned */
.step-actions-group.single-action {
    justify-content: flex-end;
}

/* Two buttons - space between */
.step-actions-group.two-actions {
    justify-content: space-between;
}

.step-actions-group .btn-prev,
.step-actions-group .btn-next,
.step-actions-group .btn-submit {
    flex: 0 0 auto;
    width: auto;
    min-width: 120px;
}

/* On two-actions, buttons take equal space */
.step-actions-group.two-actions .btn-prev,
.step-actions-group.two-actions .btn-next,
.step-actions-group.two-actions .btn-submit {
    flex: 0 1 auto;
    min-width: 100px;
    max-width: 45%;
}

.btn-next,
.btn-prev {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-next {
    background: var(--gradient-primary);
    color: white;
}

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

.btn-next:hover,
.btn-prev:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-prev:hover {
    background: rgba(255, 255, 255, 0.05);
}

.content-wrapper {
    display: none;
}

.content-wrapper.active {
    display: block;
    animation: fadeIn 0.3s;
}

/* Responsive */
@media (max-width: 480px) {
    .story-type-selector {
        grid-template-columns: 1fr;
    }
}

/* Validation Styles */
.form-input.error {
    border-color: #ef4444 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ef4444'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z' /%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
    animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

.error-message {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

.error-message.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* Preloader Logo Adjustment */
.preloader-logo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    margin-bottom: var(--spacing-md);
}

/* ================================================================
   Custom Audio Player
   ================================================================ */

.custom-player {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-top: 8px;
    transition: background 0.2s;
    box-sizing: border-box;
}

.custom-player:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Reset for player internal elements */
.custom-player,
.custom-player * {
    box-sizing: border-box;
}

.player-btn-play {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
    padding: 0;
    flex-shrink: 0;
}

.player-btn-play:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.5);
}

/* Loading State */
.player-btn-play.loading {
    cursor: wait;
    background: rgba(102, 126, 234, 0.6);
}

.player-btn-play.loading:hover {
    transform: none;
}

.player-loading {
    animation: player-spin 1s linear infinite;
}

@keyframes player-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.player-timeline {
    flex: 1 !important;
    position: relative !important;
    height: 8px !important;
    background: rgba(255, 255, 255, 0.15) !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    min-width: 100px !important;
    overflow: visible !important;
    display: block !important;
}

/* Expand timeline on hover for easier interaction */
.custom-player:hover .player-timeline {
    height: 10px;
}

/* Ensure progress bar is visible */
.player-timeline .player-progress,
.player-timeline .player-buffer {
    display: block;
}

.player-progress {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    height: 100% !important;
    background: linear-gradient(90deg, #667eea, #764ba2) !important;
    border-radius: 4px !important;
    z-index: 2 !important;
    pointer-events: none !important;
    transition: width 0.1s linear !important;
    display: block !important;
}

.player-buffer {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    height: 100% !important;
    background: rgba(255, 255, 255, 0.25) !important;
    border-radius: 4px !important;
    z-index: 1 !important;
    pointer-events: none !important;
    transition: width 0.3s ease !important;
    display: block !important;
}

.player-seek {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    margin: 0;
    z-index: 10;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}

.player-seek:focus {
    outline: none;
}

.player-seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s ease;
    margin-top: -4px;
}

.player-seek::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.player-seek::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.player-seek::-webkit-slider-runnable-track {
    height: 8px;
    background: transparent;
    border-radius: 4px;
}

.player-seek::-moz-range-track {
    height: 8px;
    background: transparent;
    border-radius: 4px;
}

.player-time {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    font-variant-numeric: tabular-nums;
    min-width: 90px;
    text-align: right;
    white-space: nowrap;
}

.player-time .current {
    color: #ffffff;
    font-weight: 500;
}

/* Material Icons Integration */
.player-btn-play .material-icons {
    font-size: 22px;
}