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

body {
    font-family: 'Segoe UI', sans-serif;
    background: linear-gradient(to right, #24243e, #302b63, #0f0c29);
    background-attachment: fixed;
    color: #ccd6f6;
    min-height: 100vh;
    padding: 2rem 1rem;
}

.page {
    max-width: 600px;
    margin: 0 auto;
}

/* Header */
.header {
    margin-bottom: 1.5rem;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 6px;
}

.header p {
    font-size: 14px;
    color: #888;
}

/* Cards */
.card {
    background: rgba(36, 36, 62, 0.65);
    border: 1px solid rgba(0, 174, 255, 0.15);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.section-label {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed #2a2a3a;
    border-radius: 12px;
    padding: 2.5rem 1rem;
    text-align: center;
    background: rgba(15, 12, 41, 0.6);
    cursor: pointer;
    transition: border-color 0.2s;
}

.upload-zone:hover {
    border-color: #3B82F6;
}

.upload-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.upload-title {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 6px;
}

.upload-sub {
    font-size: 13px;
    color: #666;
    margin-bottom: 14px;
}

.upload-btn {
    display: inline-block;
    padding: 8px 20px;
    border: 1px solid #2a2a3a;
    border-radius: 8px;
    font-size: 13px;
    color: #aaa;
    background: rgba(36, 36, 62, 0.6);
}

.file-selected {
    display: none;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 14px;
    background: #0d2d1a;
    border-radius: 8px;
    font-size: 13px;
    color: #4ade80;
}

.file-selected.visible {
    display: flex;
}

/* Settings */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 1rem;
}

.setting-item {
    margin-bottom: 1rem;
}

.setting-item label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 6px;
}

select {
    width: 100%;
    padding: 10px 12px;
    background: rgba(15, 12, 41, 0.6);
    border: 1px solid #2a2a3a;
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: #3B82F6;
}

input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    background: rgba(15, 12, 41, 0.6);
    border: 1px solid #2a2a3a;
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
}

input[type="text"]:focus {
    outline: none;
    border-color: #3B82F6;
}

input[type="text"]::placeholder {
    color: #444;
}

input[type="range"] {
    width: 100%;
    accent-color: #3B82F6;
    margin-top: 4px;
}

/* Generate Button */
.generate-btn {
    width: 100%;
    padding: 13px;
    background: #3B82F6;
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 4px;
}

.generate-btn:hover { background: #2563EB; }
.generate-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Status and Error */
.status-bar {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #0d1f3a;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #60a5fa;
}

.status-bar.visible { display: flex; }

.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(59,130,246,0.3);
    border-top-color: #3B82F6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

.error-bar {
    display: none;
    padding: 10px 14px;
    background: #2d0f0f;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #f87171;
}

.error-bar.visible { display: block; }

/* Player */
.player-section { display: none; }
.player-section.visible { display: block; }

.book-info {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 1.5rem;
}

.book-cover {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: rgba(30, 42, 74, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.book-meta h2 {
    font-size: 17px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
}

.book-meta p {
    font-size: 13px;
    color: #888;
}

/* Progress */
.progress-area { margin-bottom: 1.5rem; }

.progress-track {
    height: 4px;
    background: #2a2a3a;
    border-radius: 2px;
    cursor: pointer;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: #3B82F6;
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s;
}

.time-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
}

/* Controls */
.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    margin-bottom: 1.5rem;
}

.ctrl-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    font-size: 13px;
    font-weight: 500;
    padding: 6px;
    transition: color 0.2s;
}

.ctrl-btn:hover { color: #ffffff; }

.play-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    color: #000000;
    transition: transform 0.2s;
}

.play-btn:hover { transform: scale(1.05); }

/* Download */
.download-row {
    display: flex;
    gap: 8px;
}

.download-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid #2a2a3a;
    border-radius: 8px;
    background: none;
    font-size: 13px;
    color: #aaa;
    cursor: pointer;
    transition: all 0.2s;
}

.download-btn:hover {
    border-color: #3B82F6;
    color: #ffffff;
}