/* Ansage TTS - PhoneData Style */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #0d1117;
    color: #e6edf3;
    min-height: 100vh;
}

header {
    background: linear-gradient(135deg, #6A5F91 0%, #4A3B7A 100%);
    padding: 1.5rem 1rem;
    text-align: center;
}

.logo {
    height: 48px;
    opacity: 0.95;
    margin-bottom: 0.5rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

header h1 {
    font-size: 1.1rem;
    margin: 0 0 0.15rem;
    font-weight: 600;
    letter-spacing: -0.3px;
}

header .tagline {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.55);
    margin: 0;
}

header p:not(.tagline) {
    display: none;
}

main {
    max-width: 700px;
    margin: 2rem auto;
    padding: 0 1rem;
}

section {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.field {
    margin-bottom: 1rem;
}

.field label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: #8b949e;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

textarea, select {
    width: 100%;
    padding: 0.75rem;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    color: #e6edf3;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
}

textarea:focus, select:focus {
    outline: none;
    border-color: #6A5F91;
    box-shadow: 0 0 0 2px rgba(106, 95, 145, 0.3);
}

.char-count {
    text-align: right;
    font-size: 0.8rem;
    color: #484f58;
    margin-top: 0.25rem;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 600px) {
    .field-row { grid-template-columns: 1fr; }
}

.actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

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

.btn-primary {
    background: #6A5F91;
    color: white;
    flex: 1;
}

.btn-primary:hover:not(:disabled) {
    background: #8B82B9;
}

.btn-secondary {
    background: #21262d;
    color: #e6edf3;
    border: 1px solid #30363d;
}

.btn-secondary:hover:not(:disabled) {
    background: #30363d;
}

.btn-download {
    background: #238636;
    color: white;
    width: 100%;
}

.btn-download:hover {
    background: #2ea043;
}

.result-section {
    text-align: center;
}

.result-section h2 {
    margin-bottom: 1rem;
    color: #8b949e;
}

audio {
    width: 100%;
    margin-bottom: 1rem;
}

.download-actions {
    margin-top: 0.5rem;
}

.status {
    text-align: center;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.95rem;
    min-height: 2.5rem;
}

.status.info {
    color: #58a6ff;
}

.status.error {
    color: #f85149;
    background: rgba(248, 81, 73, 0.1);
}

.voice-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.voice-row select { flex: 1; }

.voice-row .btn {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    white-space: nowrap;
}

.voice-row .btn-mini {
    padding: 0.75rem 0.75rem;
    font-size: 0.95rem;
}

.genre-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.genre-tab {
    padding: 0.35rem 0.75rem;
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 20px;
    color: #8b949e;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.genre-tab.active {
    background: #6A5F91;
    border-color: #6A5F91;
    color: white;
}

.genre-tab:hover:not(.active) {
    border-color: #6A5F91;
    color: #e6edf3;
}

.music-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
}

.music-card {
    padding: 0.5rem 0.75rem;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.music-card:hover {
    border-color: #6A5F91;
}

.music-card.selected {
    border-color: #6A5F91;
    background: rgba(106, 95, 145, 0.15);
}

.music-card.unavailable {
    opacity: 0.4;
}

.music-card-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: #e6edf3;
}

.music-card-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.15rem;
}

.music-card-source {
    font-size: 0.7rem;
    color: #484f58;
}

.btn-play {
    padding: 0.15rem 0.4rem;
    background: #6A5F91;
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 0.7rem;
    cursor: pointer;
}

.btn-play:hover { background: #8B82B9; }

.volume-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.vol-label {
    min-width: 4rem;
    font-size: 0.85rem;
    color: #8b949e;
}

.vol-val {
    min-width: 2.5rem;
    font-size: 0.8rem;
    color: #6A5F91;
    font-weight: 600;
}

.volume-row input[type="range"] {
    flex: 1;
    accent-color: #6A5F91;
}

.hint {
    font-size: 0.75rem;
    color: #484f58;
    margin-top: 0.5rem;
}

.link-muted {
    color: #484f58;
    font-size: 0.8rem;
}

.link-muted:hover { color: #6A5F91; }

.player-controls {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.text-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.25rem;
}

.btn-mini {
    padding: 0.25rem 0.75rem;
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #e6edf3;
    font-size: 0.8rem;
    cursor: pointer;
}

.btn-mini:hover {
    background: #30363d;
}

.slider-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.slider-row input[type="range"] {
    flex: 1;
    accent-color: #6A5F91;
}

.slider-row span {
    min-width: 2rem;
    font-weight: 600;
    color: #8b949e;
}

.structure-preview {
    background: #0d1117;
    border-radius: 8px;
    padding: 0.75rem;
    margin: 1rem 0;
    text-align: center;
}

.structure-preview label {
    color: #484f58;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.flow {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.flow-item {
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-weight: 600;
}

.flow-item.music {
    background: rgba(106, 95, 145, 0.2);
    color: #8B82B9;
}

.flow-item.voice {
    background: rgba(35, 134, 54, 0.2);
    color: #3fb950;
}

.flow-arrow {
    color: #484f58;
}

footer {
    text-align: center;
    padding: 2rem;
    color: #484f58;
    font-size: 0.85rem;
}
