/* Podcast Admin Styles - The American Record */

.podcast-admin {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
}

.podcast-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.podcast-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a2e);
    margin: 0;
}

.date-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-nav input[type="date"] {
    padding: 8px 12px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: background 0.15s;
}

.btn-icon:hover {
    background: var(--bg-hover, #f0f0f0);
}

.btn-sm {
    padding: 8px 14px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.15s;
}

.btn-sm:hover {
    background: var(--bg-hover, #f0f0f0);
}

/* Status */
.podcast-status {
    margin-bottom: 16px;
}

.status-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-empty { background: #f0f0f0; color: #666; }
.status-loading { background: #e8f4fd; color: #1976d2; }
.status-researching { background: #fff3e0; color: #e65100; }
.status-draft { background: #e8f5e9; color: #2e7d32; }
.status-edited { background: #e8f5e9; color: #2e7d32; }
.status-regenerating { background: #fff3e0; color: #e65100; }
.status-generating_audio { background: #ede7f6; color: #4527a0; }
.status-completed { background: #e0f2f1; color: #00695c; }
.status-published { background: #e8eaf6; color: #283593; }
.status-failed { background: #fce4ec; color: #c62828; }
.status-error { background: #fce4ec; color: #c62828; }

/* Actions */
.podcast-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.btn-primary {
    padding: 10px 20px;
    background: var(--primary-color, #2c3e50);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.15s;
}

.btn-primary:hover:not(:disabled) {
    opacity: 0.9;
}

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

.btn-secondary {
    padding: 10px 20px;
    background: white;
    color: var(--text-primary, #1a1a2e);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover, #f5f5f5);
}

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

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary, #666);
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color, #eee);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-content h3 {
    margin: 0 0 16px;
    font-size: 1.2rem;
}

.modal-content textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    font-size: 0.9rem;
    resize: vertical;
    margin-bottom: 16px;
}

.segment-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.segment-checkboxes label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    cursor: pointer;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Script Editor */
.script-editor {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color, #eee);
    padding: 24px;
    margin-bottom: 24px;
}

.script-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.script-editor-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.script-meta {
    display: flex;
    gap: 12px;
    align-items: center;
}

.word-count-total {
    font-size: 0.8rem;
    color: var(--text-secondary, #666);
}

.format-badge {
    padding: 4px 10px;
    background: #e8eaf6;
    color: #283593;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Segment panels */
.segment-panel {
    border: 1px solid var(--border-color, #eee);
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
}

.segment-panel.segment-skipped {
    opacity: 0.5;
}

.segment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    background: var(--bg-subtle, #fafafa);
    transition: background 0.15s;
}

.segment-header:hover {
    background: var(--bg-hover, #f0f0f0);
}

.segment-toggle {
    font-size: 0.75rem;
    color: var(--text-secondary, #999);
}

.segment-type {
    font-weight: 600;
    font-size: 0.85rem;
}

.persona-badge {
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.persona-anchor { background: #e3f2fd; color: #1565c0; }
.persona-historian { background: #fce4ec; color: #880e4f; }
.persona-storyteller { background: #f3e5f5; color: #6a1b9a; }
.persona-scientist { background: #e8f5e9; color: #2e7d32; }
.persona-correspondent { background: #fff3e0; color: #e65100; }

.segment-word-count {
    font-size: 0.75rem;
    color: var(--text-secondary, #999);
}

.segment-source-count {
    font-size: 0.75rem;
    color: var(--text-secondary, #999);
    background: #f5f5f5;
    padding: 2px 8px;
    border-radius: 8px;
}

.segment-body {
    padding: 16px;
    border-top: 1px solid var(--border-color, #eee);
}

.segment-text-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
}

.segment-char-count {
    text-align: right;
    font-size: 0.7rem;
    color: var(--text-secondary, #999);
    margin-top: 4px;
}

/* Preview boundary */
.preview-boundary-marker {
    text-align: center;
    padding: 8px;
    margin: 8px 0;
    border-top: 2px dashed #ff7043;
    border-bottom: 2px dashed #ff7043;
    font-size: 0.75rem;
    font-weight: 600;
    color: #ff7043;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Editor actions */
.editor-action-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

/* Version history */
.version-history-panel {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-subtle, #fafafa);
    border-radius: 8px;
}

.version-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
}

.version-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 4px;
}

.version-item.version-current {
    background: #e8f5e9;
}

.version-id { font-weight: 600; font-size: 0.85rem; }
.version-date { font-size: 0.8rem; color: var(--text-secondary, #666); }
.version-prompt { font-size: 0.8rem; color: var(--text-secondary, #666); font-style: italic; }
.current-label { font-size: 0.75rem; color: #2e7d32; font-weight: 600; }

/* Audio panel */
.audio-panel {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color, #eee);
    padding: 24px;
    margin-bottom: 24px;
}

.audio-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.audio-panel-header h3 { margin: 0; font-size: 1.1rem; }

.audio-player {
    width: 100%;
    margin: 8px 0;
}

.audio-player-row {
    margin-bottom: 16px;
}

.audio-player-row label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary, #666);
    margin-bottom: 4px;
}

/* Distribution panel */
.distribution-panel {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color, #eee);
    padding: 24px;
}

.distribution-header h3 { margin: 0 0 16px; font-size: 1.1rem; }

.transistor-status-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.transistor-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.transistor-not_published { background: #f5f5f5; color: #666; }
.transistor-pending { background: #fff3e0; color: #e65100; }
.transistor-published { background: #e8f5e9; color: #2e7d32; }
.transistor-failed { background: #fce4ec; color: #c62828; }

.transistor-url-row {
    margin-bottom: 12px;
}

.transistor-link {
    font-size: 0.8rem;
    color: #1976d2;
    word-break: break-all;
}

.distribution-actions {
    margin: 16px 0;
}

.ad-insertion-row {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color, #eee);
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    cursor: pointer;
}

.ad-insertion-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary, #999);
    margin-top: 4px;
    margin-left: 24px;
}

/* Utility buttons */
.btn-xs {
    padding: 4px 10px;
    font-size: 0.7rem;
    border-radius: 6px;
    border: 1px solid;
    cursor: pointer;
    font-weight: 500;
}

.btn-danger {
    border-color: #c62828;
    color: #c62828;
    background: white;
}

.btn-danger:hover {
    background: #fce4ec;
}

.skipped-badge {
    font-size: 0.7rem;
    color: #c62828;
    font-weight: 600;
    margin-left: auto;
}

/* Progress */
.audio-progress {
    text-align: center;
    padding: 24px;
}

.progress-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.progress-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #eee;
    border-top-color: var(--primary-color, #2c3e50);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.progress-elapsed {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary, #666);
}

/* Sources */
.segment-sources {
    margin-top: 12px;
}

.segment-sources summary {
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary, #666);
}

.sources-list {
    list-style: none;
    padding: 8px 0 0 0;
    margin: 0;
}

.source-item {
    padding: 6px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 0.8rem;
}

.source-archive {
    font-weight: 600;
    margin-right: 8px;
}

.source-url {
    color: #1976d2;
    font-size: 0.75rem;
    margin-left: 8px;
}
