:root {
    --primary: #facc15;
    /* Nano Banana Yellow */
    --primary-light: #fef08a;
    --accent: #f59e0b;
    --bg-dark: #18181b;
    /* Sleek dark */
    --bg-card: rgba(39, 39, 42, 0.8);
    --text-main: #f8fafc;
    --text-muted: #a1a1aa;
    --glass-border: rgba(250, 204, 21, 0.15);
    /* Yellow tinted glass */
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

body.sepia-mode {
    --bg-dark: #f4ecd8;
    --bg-card: rgba(230, 220, 200, 0.7);
    --text-main: #433422;
    --text-muted: #7d6b5d;
    --primary: #8b4513;
    --glass-border: rgba(0, 0, 0, 0.1);
}

body.dark-mode {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: radial-gradient(circle at 0% 0%, rgba(250, 204, 21, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(245, 158, 11, 0.15) 0%, transparent 50%);
}

.glass-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.logo h1 span {
    color: var(--primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.theme-controls {
    display: flex;
    gap: 0.5rem;
}

.theme-controls button {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.theme-controls button:hover {
    background: var(--glass-border);
    transform: translateY(-2px);
}

.status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    /* red by default */
}

.dot.online {
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
}

main {
    max-width: 1000px;
    margin: 4rem auto;
    padding: 0 1rem;
}

section {
    display: none;
}

section.active {
    display: block;
    animation: fadeIn 0.5s ease-out;
}

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

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

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

.hero-text h2 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.hero-text h2 span {
    background: linear-gradient(to right, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-text p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.drop-zone {
    background: var(--bg-card);
    border: 2px dashed var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--primary);
    background: rgba(250, 204, 21, 0.05);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.drop-zone h3 {
    margin-bottom: 0.5rem;
}

.drop-zone p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

button {
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

#browse-btn,
.primary-btn {
    background: var(--primary);
    color: #18181b;
    /* Dark text for contrast on yellow */
    padding: 0.8rem 2rem;
    border-radius: 12px;
    font-weight: 800;
    /* Bolder */
    font-size: 1rem;
}

#browse-btn:hover,
.primary-btn:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(250, 204, 21, 0.4);
}

.text-input-container {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 1.5rem;
    border: 1px solid var(--glass-border);
}

textarea {
    width: 100%;
    height: 150px;
    background: transparent;
    border: none;
    color: var(--text-main);
    resize: none;
    padding: 1rem;
    font-size: 1rem;
    outline: none;
}

.reader-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.reader-viewport {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 24px;
    padding: 3rem;
    height: 60vh;
    overflow-y: auto;
    line-height: 1.8;
    font-size: 1.2rem;
    border: 1px solid var(--glass-border);
}

.word {
    display: inline;
    padding: 0.05rem 0.2rem;
    border-radius: 4px;
    transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.word.highlight {
    background: rgba(250, 204, 21, 0.3);
    color: var(--primary-light);
    box-shadow: 0 0 10px rgba(250, 204, 21, 0.2);
    border-radius: 4px;
}

/* Player Styles */
#audio-player-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 800px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 1.5rem 2.5rem;
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.player-hidden {
    bottom: -150px !important;
}

.player-content {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.track-info {
    flex-grow: 1;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin-top: 0.5rem;
    position: relative;
    cursor: pointer;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--primary), var(--accent));
    border-radius: 3px;
    width: 0%;
}

.controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.play-btn {
    width: 60px;
    /* Slightly larger */
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
    color: #18181b;
    /* Dark text */
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(250, 204, 21, 0.3);
    transition: all 0.2s;
}

.play-btn:hover {
    transform: scale(1.05);
    background: var(--primary-light);
}

.control-btn {
    background: transparent;
    color: var(--text-muted);
    font-size: 1.5rem;
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.speed-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.speed-container #speed-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--bg-dark);
    background: var(--primary);
    padding: 0.15rem 0.5rem;
    border-radius: 8px;
    min-width: 2.5rem;
    text-align: center;
    white-space: nowrap;
}

.speed-container input[type="range"] {
    width: 80px;
}

input[type="range"] {
    accent-color: var(--primary);
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Progress Enhancements */
.progress-bar:hover #progress-fill::after {
    content: '';
    position: absolute;
    right: -5px;
    top: -5px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary);
}