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

:root {
    --bg-dark: #080b11;
    --card-bg: rgba(16, 22, 35, 0.65);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.35);
    --neon-blue: #00f2fe;
    --neon-purple: #4facfe;
    --neon-green: #10b981;
    --neon-green-glow: rgba(16, 185, 129, 0.3);
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --font-mono: 'Fira Code', monospace;
    --radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
    padding: 20px;
}

/* Background Glow Effects */
.glow-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.glow-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.15;
}

.gc1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--neon-blue) 0%, transparent 80%);
    top: -100px;
    left: -100px;
}

.gc2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--neon-purple) 0%, transparent 80%);
    bottom: -150px;
    right: -150px;
}

/* App Container */
.container {
    width: 100%;
    max-width: 1100px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Header */
.app-header {
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo-icon {
    font-size: 2.5rem;
    color: var(--neon-blue);
    filter: drop-shadow(0 0 10px var(--accent-glow));
    animation: pulse 2.5s infinite alternate;
}

.app-header h1 {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #fff 30%, var(--neon-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.accent-text {
    background: linear-gradient(135deg, var(--neon-blue) 0%, var(--neon-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px rgba(0, 242, 254, 0.4));
}

.tagline {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Main Workspace */
.workspace {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.control-panel {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 25px;
}

@media (max-width: 900px) {
    .control-panel {
        grid-template-columns: 1fr;
    }
}

/* Card Styles (Glassmorphism) */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 45px rgba(0, 242, 254, 0.05);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 12px;
}

.card-header h2 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h2 i {
    color: var(--neon-blue);
}

.char-counter {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Text Input Card */
.text-card {
    min-height: 380px;
}

.input-wrapper {
    flex-grow: 1;
    display: flex;
}

textarea {
    width: 100%;
    min-height: 220px;
    background: rgba(8, 12, 20, 0.5);
    border: 1px solid var(--card-border);
    border-radius: calc(var(--radius) - 4px);
    padding: 16px;
    color: var(--text-primary);
    font-size: 1.05rem;
    line-height: 1.6;
    resize: none;
    outline: none;
    transition: var(--transition);
}

textarea:focus {
    border-color: var(--neon-blue);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.15);
    background: rgba(8, 12, 20, 0.7);
}

.input-actions {
    display: flex;
    gap: 15px;
}

/* Settings Card */
.settings-card {
    justify-content: space-between;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.setting-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Custom Select Dropdown */
.select-wrapper {
    position: relative;
    width: 100%;
}

select {
    width: 100%;
    background: rgba(8, 12, 20, 0.6);
    border: 1px solid var(--card-border);
    border-radius: calc(var(--radius) - 6px);
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: var(--transition);
}

select:focus {
    border-color: var(--neon-blue);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.1);
}

.select-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: var(--transition);
}

select:focus + .select-arrow {
    color: var(--neon-blue);
    transform: translateY(-50%) rotate(180deg);
}

/* Sliders */
.sliders-grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slider-badge {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--neon-blue);
    font-weight: 600;
}

.neon-slider {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    outline: none;
    border-radius: 10px;
    appearance: none;
    -webkit-appearance: none;
    overflow: hidden;
}

.neon-slider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--neon-blue);
    cursor: pointer;
    box-shadow: 0 0 10px var(--neon-blue), -300px 0 0 300px var(--neon-purple);
    transition: var(--transition);
}

.neon-slider::-webkit-slider-thumb:hover {
    transform: scale(1.25);
    background: #fff;
    box-shadow: 0 0 15px var(--neon-blue), -300px 0 0 300px var(--neon-blue);
}

/* Buttons */
button {
    font-family: var(--font-body);
    font-weight: 600;
    cursor: pointer;
    border: none;
    outline: none;
    transition: var(--transition);
}

.primary-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--neon-blue) 0%, var(--neon-purple) 100%);
    color: #fff;
    padding: 15px;
    border-radius: calc(var(--radius) - 4px);
    font-size: 1.1rem;
    box-shadow: 0 4px 20px var(--accent-glow);
    position: relative;
    overflow: hidden;
}

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

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

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 242, 254, 0.4);
}

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

.secondary-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.success-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    padding: 14px 28px;
    border-radius: calc(var(--radius) - 6px);
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 15px var(--neon-green-glow);
    transition: var(--transition);
}

.success-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

/* Output Card & Status */
.output-card {
    border-color: rgba(0, 242, 254, 0.2);
}

.hidden {
    display: none !important;
}

.progress-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
}

#statusText {
    color: var(--text-primary);
    font-weight: 500;
}

#progressPercent {
    font-family: var(--font-mono);
    color: var(--neon-blue);
    font-weight: 600;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.progress-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple));
    box-shadow: 0 0 10px var(--neon-blue);
    border-radius: 10px;
    transition: width 0.2s ease;
}

/* Audio Player Section */
.audio-player-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    padding-top: 10px;
}

/* Audio Controls Override */
audio {
    width: 100%;
    max-width: 500px;
    outline: none;
}

audio::-webkit-media-controls-panel {
    background-color: rgba(8, 12, 20, 0.85);
    border: 1px solid var(--card-border);
    border-radius: 30px;
}

audio::-webkit-media-controls-play-button,
audio::-webkit-media-controls-mute-button {
    background-color: var(--neon-blue);
    border-radius: 50%;
}

/* Audio Wave Animation */
.player-visuals {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.wave-animation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 40px;
}

.wave-animation .bar {
    width: 4px;
    height: 10px;
    background-color: var(--neon-blue);
    border-radius: 4px;
    animation: none;
    transition: var(--transition);
}

.wave-animation.playing .bar {
    animation: waveBounce 1.2s ease-in-out infinite alternate;
}

.wave-animation.playing .bar:nth-child(1) { animation-delay: 0.1s; }
.wave-animation.playing .bar:nth-child(2) { animation-delay: 0.2s; }
.wave-animation.playing .bar:nth-child(3) { animation-delay: 0.3s; }
.wave-animation.playing .bar:nth-child(4) { animation-delay: 0.4s; }
.wave-animation.playing .bar:nth-child(5) { animation-delay: 0.5s; }
.wave-animation.playing .bar:nth-child(6) { animation-delay: 0.4s; }
.wave-animation.playing .bar:nth-child(7) { animation-delay: 0.3s; }
.wave-animation.playing .bar:nth-child(8) { animation-delay: 0.2s; }
.wave-animation.playing .bar:nth-child(9) { animation-delay: 0.1s; }
.wave-animation.playing .bar:nth-child(10) { animation-delay: 0.2s; }

/* Footer */
.app-footer {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 20px;
    margin-top: 15px;
}

.app-footer i {
    color: #ef4444;
}

/* Keyframes */
@keyframes pulse {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 5px var(--accent-glow));
    }
    100% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 15px var(--neon-blue));
    }
}

@keyframes waveBounce {
    0% {
        height: 10px;
        background-color: var(--neon-blue);
    }
    100% {
        height: 40px;
        background-color: var(--neon-purple);
    }
}
