/**
 * Followcast Main Stylesheet
 *
 * All CSS consolidated from inline <style> blocks for better maintainability.
 * Usage: <link rel="stylesheet" href="/static/css/main.css">
 */

/* ============================================
   CSS Variables (Design Tokens)
   ============================================ */
:root {
    /* Colors */
    --color-primary: #4a90a4;
    --color-primary-dark: #3a7a94;
    --color-primary-light: #5aa0b4;
    --color-success: #28a745;
    --color-success-dark: #218838;
    --color-warning: #ffc107;
    --color-danger: #dc3545;
    --color-info: #17a2b8;

    /* Grays */
    --color-gray-100: #f8f9fa;
    --color-gray-200: #e9ecef;
    --color-gray-300: #dee2e6;
    --color-gray-400: #ced4da;
    --color-gray-500: #adb5bd;
    --color-gray-600: #6c757d;
    --color-gray-700: #495057;
    --color-gray-800: #343a40;
    --color-gray-900: #212529;

    /* Background */
    --bg-body: #f5f7fa;
    --bg-card: #ffffff;
    --bg-sidebar: #2c3e50;

    /* Text */
    --text-primary: #333;
    --text-secondary: #666;
    --text-muted: #999;
    --text-light: #fff;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 50%;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
}

/* ============================================
   Base Styles
   ============================================ */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ============================================
   Layout Components
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-md);
}

.main-content {
    padding: var(--spacing-lg);
}

/* ============================================
   Card Component
   ============================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--color-gray-200);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

/* ============================================
   Button Component
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--text-light);
}

.btn-primary:hover {
    background: var(--color-primary-dark);
}

.btn-success {
    background: var(--color-success);
    color: var(--text-light);
}

.btn-success:hover {
    background: var(--color-success-dark);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--color-gray-400);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background: var(--color-gray-100);
}

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.75rem;
}

.btn-lg {
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 1rem;
}

.btn-full {
    width: 100%;
    padding: 12px;
    font-size: 1em;
}

/* ============================================
   Badge Component
   ============================================ */
.badge {
    display: inline-block;
    padding: 0.2em 0.5em;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

.badge-primary {
    background: var(--color-primary);
    color: var(--text-light);
}

.badge-success {
    background: var(--color-success);
    color: var(--text-light);
}

.badge-warning {
    background: var(--color-warning);
    color: var(--text-primary);
}

.badge-followed {
    background: #e7f5e7;
    color: #28a745;
}

.badge-info {
    background: #17a2b8;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75em;
    margin-left: 8px;
}

.badge-verified {
    background: #28a745;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75em;
    margin-left: 8px;
}

.badge-pending {
    background: #ffc107;
    color: #333;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75em;
    margin-left: 8px;
}

.badge-youtube {
    background: #ff0000;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75em;
    margin-left: 8px;
}

/* ============================================
   Table Component
   ============================================ */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--color-gray-200);
}

.table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.table tr:hover {
    background: var(--color-gray-100);
}

/* ============================================
   Form Components
   ============================================ */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: border-color var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 164, 0.1);
}

/* ============================================
   Grid System
   ============================================ */
.grid {
    display: grid;
    gap: var(--spacing-md);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Utility Classes
   ============================================ */
/* Spacing */
.m-0 { margin: 0; }
.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.p-1 { padding: var(--spacing-sm); }
.p-2 { padding: var(--spacing-md); }

/* Text */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-bold { font-weight: 600; }

/* Display */
.d-flex { display: flex; }
.d-none { display: none; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: var(--spacing-sm); }
.gap-2 { gap: var(--spacing-md); }

/* ============================================
   Section Headers (reusable layout pattern)
   ============================================ */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}
.section-header-20 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}
.section-title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-subtitle {
    color: #666;
    margin: 4px 0 0;
    font-size: 0.9em;
}
.section-icon {
    font-size: 1.2em;
}

/* ============================================
   Banner Notifications
   ============================================ */
.banner {
    margin-bottom: 20px;
}
.banner-info {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
}
.banner-warning {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
}
.banner-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.banner-content-center {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ============================================
   Result Cards (JS-generated search results)
   ============================================ */
.result-card {
    border-radius: 8px;
    padding: 16px;
}
.result-card-success {
    background: #d4edda;
    border: 1px solid #28a745;
}
.result-card-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
}
.result-card-error {
    background: #f8d7da;
    border: 1px solid #dc3545;
}
.result-card h3,
.result-card h4 {
    margin: 0 0 8px;
}
.result-card-success h3,
.result-card-success h4 {
    color: #28a745;
}
.result-card-warning h3,
.result-card-warning h4 {
    color: #856404;
}
.result-card-error h3,
.result-card-error h4 {
    color: #dc3545;
}

/* ============================================
   Progress Bar
   ============================================ */
.progress-bar-track {
    width: 100%;
    max-width: 300px;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    margin: 16px auto 0;
    overflow: hidden;
}
.progress-bar-fill {
    width: 0%;
    height: 100%;
    background: #ff6b35;
    transition: width 0.3s ease;
}

/* ============================================
   Recent Episodes Table
   ============================================ */
.episodes-table {
    width: 100%;
    border-collapse: collapse;
}
.episodes-table thead tr {
    border-bottom: 2px solid #e0e0e0;
    text-align: left;
}
.episodes-table th {
    padding: 8px 12px;
    font-weight: 600;
    color: #666;
}
.episodes-table td {
    padding: 10px 12px;
}

/* ============================================
   Refresh Modal
   ============================================ */
.refresh-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}
.refresh-modal-overlay.active {
    display: flex;
}
.refresh-modal {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    max-width: 450px;
    width: 90%;
    text-align: center;
}
.refresh-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid #4da6ff;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: refreshSpin 1s linear infinite;
}
.refresh-title {
    margin: 0 0 10px;
    font-size: 1.4em;
    color: #333;
}
.refresh-status {
    color: #666;
    margin-bottom: 10px;
    font-size: 1.1em;
}
.refresh-details {
    font-size: 0.9em;
    color: #999;
}
.refresh-result-icon {
    font-size: 64px;
    margin-bottom: 15px;
}
.refresh-result-icon-success {
    color: #28a745;
}
.refresh-result-icon-error {
    color: #dc3545;
}
.refresh-result-title {
    margin: 0 0 10px;
    font-size: 1.4em;
}
.refresh-result-title-success {
    color: #28a745;
}
.refresh-result-title-error {
    color: #dc3545;
}
.refresh-result-msg {
    color: #666;
    margin-bottom: 15px;
    font-size: 1.1em;
}
.refresh-close-btn {
    background: #fff;
    border: 1px solid #ddd;
    padding: 10px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
}

/* ============================================
   Podcast Modal
   ============================================ */
.podcast-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.podcast-modal-close {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #666;
}
.podcast-modal-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 4px;
}
.podcast-modal-group {
    padding: 10px 15px;
    font-weight: 600;
    border-bottom: 1px solid #eee;
}
.podcast-modal-group-new {
    background: #e8f5e9;
    color: #2e7d32;
    border-bottom-color: #c8e6c9;
}
.podcast-modal-group-other {
    background: #f5f5f5;
    color: #666;
    cursor: pointer;
}
.podcast-modal-footer {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ============================================
   Modal Component (shared)
   ============================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.modal-overlay.active {
    display: flex;
}
.modal {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1001;
}

/* ============================================
   Animations (shared)
   ============================================ */
@keyframes refreshSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes digest-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes audio-digest-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   Loading/Skeleton States
   ============================================ */
.skeleton {
    background: linear-gradient(90deg,
        var(--color-gray-200) 25%,
        var(--color-gray-100) 50%,
        var(--color-gray-200) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 1em;
    margin-bottom: var(--spacing-xs);
}

.skeleton-card {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    height: 100px;
    border-radius: 8px;
}

.loading {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

/* ============================================
   Empty States
   ============================================ */
.empty-state {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-muted);
}

.empty-state p {
    margin-bottom: var(--spacing-md);
}

/* ============================================
   Stat Card (podcast_detail)
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

/* ============================================
   Error/Success Messages
   ============================================ */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* ============================================
   Auth Pages (login, register, forgot-password)
   ============================================ */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.auth-card {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.auth-card h1 {
    margin-bottom: 5px;
    color: #1a1a2e;
    text-align: center;
}

.auth-subtitle {
    color: #666;
    text-align: center;
    margin-bottom: 30px;
}

.auth-card .form-group {
    margin-bottom: 20px;
}

.auth-card .form-group input {
    max-width: 100%;
    width: 100%;
}

.auth-links {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9em;
}

.auth-links .separator {
    color: #ccc;
    margin: 0 10px;
}

@media (max-width: 480px) {
    .auth-card {
        padding: 25px;
    }
}

/* ============================================
   Admin: Invites Page
   ============================================ */
.modal h3 {
    margin-bottom: 20px;
    color: #1a1a2e;
}

.copy-field {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: stretch;
}
.copy-field input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
    background: #f8f9fa;
}
.copy-field button {
    padding: 12px 16px;
    background: #4da6ff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.copy-field button:hover {
    background: #3d96ef;
}
.copy-field button.copied {
    background: #28a745;
}
.copy-icon {
    width: 16px;
    height: 16px;
}
.modal-close {
    margin-top: 20px;
    width: 100%;
    padding: 12px;
    background: #6c757d;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.modal-close:hover {
    background: #5a6268;
}

/* ============================================
   Guest Detail Page
   ============================================ */
.tracked-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    margin-right: 6px;
}
.discovered-icon {
    margin-right: 6px;
    font-size: 14px;
}
.timeline-discovered {
    border-left-color: #17a2b8 !important;
    background: #f8f9fa;
}
.yt-icon-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #ff0000;
    color: white;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    margin-right: 6px;
}
.timeline-youtube {
    border-left-color: #ff0000 !important;
    background: #fff5f5;
}
.btn-favorite-detail {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    border-radius: 50%;
    background: #fff;
    color: #ccc;
    font-size: 1.3em;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}
.btn-favorite-detail:hover {
    border-color: #e74c3c;
    color: #e74c3c;
}
.btn-favorite-detail.active {
    background: #fff0f0;
    border-color: #e74c3c;
    color: #e74c3c;
}
.btn-favorite-detail:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* ============================================
   Audio Digest Page
   Scoped under #episodeList for conflicting classes
   ============================================ */
#episodeList .episode-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: background 0.2s;
}
#episodeList .episode-item:hover {
    background: #f9f9f9;
}
#episodeList .episode-item.selected {
    background: #f0f7ff;
    border-color: #cce0ff;
}
.episode-checkbox {
    margin-top: 4px;
}
#episodeList .episode-info {
    flex: 1;
    min-width: 0;
}
#episodeList .episode-title {
    font-weight: 500;
    margin: 0 0 4px;
    word-wrap: break-word;
}
#episodeList .episode-meta {
    font-size: 0.85em;
    color: #666;
    margin: 0;
}
.episode-status {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
}
.status-ready {
    background: #e8f5e9;
    color: #2e7d32;
}
.status-pending {
    background: #fff3e0;
    color: #e65100;
}
.status-processing {
    background: #e3f2fd;
    color: #1565c0;
}
.process-btn {
    padding: 4px 12px;
    font-size: 0.8em;
    background: #ff6b35;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.process-btn:hover {
    background: #e55a2b;
}
.process-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ============================================
   Discover Page
   ============================================ */
.discovery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.discovery-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s, transform 0.2s;
}

.discovery-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.discovery-card.added {
    opacity: 0.6;
    background: #f8fff8;
    border-color: #4caf50;
}

.discovery-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}

.discovery-title h3 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
}

.discovery-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 600;
    margin-top: 6px;
}

.discovery-badge.new {
    background: #fff3e0;
    color: #e65100;
}

.btn-add-podcast {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #4caf50, #43a047);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.btn-add-podcast:hover {
    background: linear-gradient(135deg, #43a047, #388e3c);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.btn-add-podcast:active {
    transform: translateY(0);
}

.btn-add-podcast.disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-add-podcast.adding {
    background: #ff9800;
    cursor: wait;
}

.btn-add-podcast.success {
    background: #4caf50;
    cursor: default;
}

.btn-view-podcast {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #1976d2, #1565c0);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
}

.btn-view-podcast:hover {
    background: linear-gradient(135deg, #1565c0, #0d47a1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.4);
    color: white;
}

.discovery-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-ignore {
    padding: 10px 14px;
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ignore:hover {
    background: #ffebee;
    border-color: #ef9a9a;
    color: #c62828;
}

.btn-restore {
    padding: 6px 12px;
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #90caf9;
    border-radius: 4px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-restore:hover {
    background: #bbdefb;
    border-color: #64b5f6;
}

.btn-icon {
    font-size: 1.2em;
    font-weight: bold;
}

.discovery-guests {
    margin-bottom: 15px;
}

.discovery-label {
    display: block;
    font-size: 0.8em;
    color: #666;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.discovery-guest-tag {
    display: inline-block;
    padding: 4px 10px;
    background: linear-gradient(135deg, #fff8e1, #fff3e0);
    border: 1px solid #ffe0b2;
    color: #e65100;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 500;
    margin-right: 6px;
    margin-bottom: 4px;
}

.discovery-episodes {
    border-top: 1px solid #f0f0f0;
    padding-top: 15px;
}

.discovery-episode {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
}

.discovery-episode:last-of-type {
    border-bottom: none;
}

/* Scoped episode classes for discover page */
.discovery-episode .episode-info {
    flex: 1;
    min-width: 0;
}

.discovery-episode .episode-link {
    display: block;
    color: #1976d2;
    text-decoration: none;
    font-size: 0.9em;
    line-height: 1.4;
    word-wrap: break-word;
}

.discovery-episode .episode-link:hover {
    text-decoration: underline;
}

.discovery-episode .episode-meta {
    display: block;
    font-size: 0.8em;
    color: #888;
    margin-top: 2px;
}

.episode-actions {
    display: flex;
    gap: 4px;
    margin-left: 10px;
    flex-shrink: 0;
}

.btn-mini {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid #ddd;
    background: #f5f5f5;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    line-height: 22px;
    text-align: center;
    color: #666;
    transition: all 0.2s;
}

.btn-mini:hover {
    background: #e0e0e0;
    color: #333;
}

.btn-mini.btn-dismiss:hover {
    background: #ffebee;
    border-color: #ef9a9a;
    color: #c62828;
}

.discovery-more {
    font-size: 0.85em;
    color: #888;
    padding: 8px 0;
    font-style: italic;
}

@media (max-width: 480px) {
    .discovery-grid {
        grid-template-columns: 1fr;
    }

    .discovery-header {
        flex-direction: column;
    }

    .btn-add-podcast {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   People Page
   ============================================ */
/* Following Hero Card */
.following-card {
    background: linear-gradient(135deg, #fff9e6 0%, #fff 100%);
    border: 1px solid #e0d6b8;
    border-left: 4px solid #ffc107;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.following-card-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 16px;
}

/* Favorite rows */
.favorite-row {
    background: #fff5f5;
    border-left: 3px solid #e74c3c;
}
.favorite-row:hover {
    background: #ffeded;
}

/* Divider between favorites and non-favorites */
.favorites-divider td {
    padding: 0;
    border-bottom: 2px solid #eee;
    height: 4px;
}

/* Following empty state */
.following-empty-state {
    text-align: center;
    padding: 30px 20px;
    color: #888;
}
.following-empty-state p {
    margin-bottom: 12px;
    font-size: 1em;
}

/* Find People Card */
.find-people-card {
    background: #fff;
    border: 1px solid #ddd;
    border-left: 4px solid #ccc;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.find-people-content {
    padding: 0;
}

/* Follow Button */
.btn-follow {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border: 1px solid #ddd;
    border-radius: 16px;
    background: #fff;
    color: #666;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-follow:hover {
    border-color: #28a745;
    color: #28a745;
}
.btn-follow.following {
    background: #28a745;
    border-color: #28a745;
    color: #fff;
}
.btn-follow.following:hover {
    background: #dc3545;
    border-color: #dc3545;
}
.btn-follow .star {
    font-size: 1.1em;
}
.btn-follow:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* Favorite Button */
.btn-favorite {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    border-radius: 50%;
    background: #fff;
    color: #ccc;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.2s ease;
    vertical-align: middle;
    margin-right: 4px;
    padding: 0;
    line-height: 1;
}
.btn-favorite:hover {
    border-color: #e74c3c;
    color: #e74c3c;
}
.btn-favorite.active {
    background: #fff0f0;
    border-color: #e74c3c;
    color: #e74c3c;
}
.btn-favorite:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* No results discovery */
.no-results-discovery {
    text-align: center;
    padding: 30px 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Responsive */
@media (max-width: 480px) {
    .last-seen-col {
        display: none;
    }
    #peopleTabs .filter-chip {
        font-size: 0.8em;
        padding: 5px 10px;
    }
}

/* ============================================
   Dashboard: Onboarding
   ============================================ */
.onboarding-card {
    text-align: center;
    padding: 50px 30px;
    background: linear-gradient(135deg, #f8fbff 0%, #fff 100%);
    border: 2px solid #4da6ff;
}
.onboarding-card h2 {
    margin: 0 0 8px;
    font-size: 1.8em;
    color: #1a1a2e;
}
.onboarding-card .subtitle {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 30px;
}
.onboarding-steps {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}
.step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    text-align: left;
    max-width: 200px;
}
.step-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: #4da6ff;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.95em;
}
.step-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.step-content strong {
    color: #333;
}
.step-content span {
    font-size: 0.85em;
    color: #666;
}
@media (max-width: 600px) {
    .onboarding-steps {
        flex-direction: column;
        align-items: center;
    }
    .step {
        max-width: 280px;
    }
}

/* ============================================
   Dashboard: Stats Inline Bar
   ============================================ */
.stats-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9em;
}
.stat-inline {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 6px;
}
.stat-inline:hover {
    color: #007bff;
}
.stat-number {
    font-weight: 700;
    font-size: 1.2em;
    color: #333;
}
.stat-inline:hover .stat-number {
    color: #007bff;
}
.stat-label {
    color: #666;
}
.stat-divider {
    color: #ddd;
}

/* ============================================
   Dashboard: Weekly Digest Section
   ============================================ */
.digest-section {
    border: 2px solid #9c27b0;
    border-radius: 12px;
    background: linear-gradient(135deg, #faf5ff 0%, #fff 100%);
}
.digest-text {
    line-height: 1.8;
    color: #333;
    white-space: pre-wrap;
}
.digest-text strong {
    color: #9c27b0;
}
.digest-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e0e0e0;
    border-top: 3px solid #9c27b0;
    border-radius: 50%;
    animation: digest-spin 1s linear infinite;
    margin: 0 auto;
}

/* ============================================
   Dashboard: Audio Digest Section + Modal
   ============================================ */
.audio-digest-section {
    border: 2px solid #ff6b35;
    border-radius: 12px;
    background: linear-gradient(135deg, #fff8f5 0%, #fff 100%);
}
.audio-digest-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e0e0e0;
    border-top: 3px solid #ff6b35;
    border-radius: 50%;
    animation: audio-digest-spin 1s linear infinite;
    margin: 0 auto;
}
.audio-digest-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.audio-digest-modal-content {
    background: #fff;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.audio-digest-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}
.audio-digest-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    line-height: 1;
}
.audio-digest-modal-close:hover {
    color: #333;
}
.audio-digest-modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}
.audio-digest-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #eee;
}
.audio-digest-episode-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 8px;
}
.audio-digest-episode-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}
.audio-digest-episode-item:last-child {
    border-bottom: none;
}
.audio-digest-episode-item:hover {
    background: #f8f9fa;
}
.audio-digest-episode-item input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}
.audio-digest-episode-info {
    flex: 1;
    min-width: 0;
}
.audio-digest-episode-title {
    font-weight: 500;
    color: #333;
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.audio-digest-episode-meta {
    font-size: 0.85em;
    color: #666;
    margin: 0;
}
.audio-digest-cost-summary {
    margin-top: 16px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.9em;
}

/* ============================================
   Dashboard: Followed Section
   ============================================ */
.followed-section {
    border: 2px solid #007bff;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8fbff 0%, #fff 100%);
}
.appearances-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (max-width: 768px) {
    .appearances-grid {
        grid-template-columns: 1fr;
    }
}
.appearance-card {
    background: #fff;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-left: 4px solid #ffc107;
}
.appearance-card-favorite {
    border-left-color: #e74c3c;
    background: linear-gradient(135deg, #fff5f5 0%, #fff 100%);
}
.fav-icon {
    color: #e74c3c;
    font-size: 1.1em;
    margin-right: 6px;
    flex-shrink: 0;
}
.appearance-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}
.star-icon {
    color: #ffc107;
    font-size: 1.1em;
    margin-right: 6px;
    flex-shrink: 0;
}
.guest-name {
    font-weight: 700;
    font-size: 1em;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
}
.guest-name:hover {
    color: #007bff;
}
.appearance-count {
    font-size: 0.8em;
    color: #999;
    margin-left: 6px;
    font-weight: 400;
    flex-shrink: 0;
}
.more-episodes-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
    margin-top: 2px;
    font-size: 0.8em;
    color: #007bff;
    cursor: pointer;
    user-select: none;
}
.more-episodes-toggle:hover {
    color: #0056b3;
    text-decoration: underline;
}
.more-episodes-toggle .toggle-icon {
    font-size: 0.7em;
    transition: transform 0.2s ease;
}
.more-episodes-toggle.expanded .toggle-icon {
    transform: rotate(90deg);
}
.more-episodes {
    border-top: 1px dashed #e0e0e0;
    margin-top: 6px;
    padding-top: 6px;
}
.appearance-episodes {
    padding-left: 20px;
}
.toggle-icon {
    display: inline-block;
    font-size: 0.7em;
    margin-right: 4px;
}

/* Scoped episode classes for dashboard followed section */
.appearance-episodes .episode-item {
    padding: 4px 0;
}
.appearance-episodes .episode-item.discovered {
    background: #f0faff;
    margin: 2px -8px;
    padding: 4px 8px;
    border-radius: 4px;
}
.appearance-episodes .episode-title {
    color: #333;
    font-weight: 500;
    font-size: 0.9em;
    display: block;
    line-height: 1.3;
}
.appearance-episodes .episode-title:hover {
    color: #007bff;
}
.appearance-episodes .episode-meta {
    font-size: 0.78em;
    color: #666;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.appearance-episodes .episode-meta .podcast-name {
    color: #666;
}
.appearance-episodes .episode-meta .date {
    color: #999;
}
.appearance-episodes .episode-link {
    text-decoration: none;
    display: block;
}
.appearance-episodes .episode-link:hover .episode-item {
    background: #f8f9fa;
    border-radius: 4px;
    margin: 0 -8px;
    padding: 4px 8px;
}
.appearance-episodes .episode-link:hover .episode-title {
    color: #007bff;
}

.new-badge {
    background: linear-gradient(135deg, #17a2b8, #0d8a9d);
    color: white;
    font-size: 0.6em;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 3px;
    margin-right: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}
.youtube-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: #ff0000;
    color: white;
    font-size: 0.55em;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 3px;
    margin-right: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}
.youtube-badge svg {
    width: 10px;
    height: 10px;
    fill: white;
}

/* ============================================
   Dashboard: Recent Podcasts Section
   ============================================ */
.recent-podcasts-section {
    border: 2px solid #28a745;
    border-radius: 12px;
    background: linear-gradient(135deg, #f5fff7 0%, #fff 100%);
    margin-top: 20px;
}
.podcast-episodes-table table tr:hover {
    background: #f8f9fa;
}
/* Highlight rows with followed guests */
.followed-guest-row {
    background: linear-gradient(90deg, #fff3cd 0%, #fff9e6 100%) !important;
    border-left: 4px solid #ffc107 !important;
}
.followed-guest-row:hover {
    background: linear-gradient(90deg, #ffecb3 0%, #fff3cd 100%) !important;
}
.followed-guest-badge {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 8px;
    background: linear-gradient(135deg, #ffc107, #ff9800);
    color: #333;
    font-size: 0.75em;
    font-weight: 600;
    border-radius: 12px;
}

/* ============================================
   Dashboard: Discover Section
   ============================================ */
.discover-section {
    border: 2px solid #28a745;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8fff8 0%, #fff 100%);
}
.discover-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
@media (max-width: 768px) {
    .discover-grid {
        grid-template-columns: 1fr;
    }
}
.discover-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border-left: 4px solid #28a745;
}
.discover-info {
    flex: 1;
    min-width: 0;
}
.discover-info .podcast-name {
    font-size: 0.95em;
    color: #333;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.discover-guests {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}
.guest-tag {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 6px;
    background: #fff8e1;
    border-radius: 10px;
    font-size: 0.75em;
    color: #666;
}
.guest-tag .star {
    color: #ffc107;
}
.more-guests {
    font-size: 0.75em;
    color: #999;
    padding: 2px 0;
}
.discover-btn {
    font-size: 0.8em;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 8px;
    padding: 6px 12px;
}
@media (max-width: 600px) {
    .discover-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .discover-btn {
        margin-left: 0;
        width: 100%;
    }
}

/* ============================================
   Dashboard: Podcast Modal
   ============================================ */
.podcast-item:last-child {
    border-bottom: none;
}
.podcast-item:hover {
    background: #f8f9fa;
}
