/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

/* Layout */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    border-bottom: 1px solid #ddd;
    padding: 20px 0;
    margin-bottom: 40px;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #222;
    text-decoration: none;
}

nav a {
    color: #555;
    text-decoration: none;
    margin-left: 20px;
}

nav a:hover {
    color: #000;
    text-decoration: underline;
}

/* Protected Content Wrapper */
#protected-content {
    display: none;
}

#protected-content.authenticated {
    display: block;
}

/* Login Page */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
}

.login-container h1 {
    font-size: 28px;
    margin-bottom: 30px;
    font-weight: normal;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    font-size: 16px;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: #666;
}

button[type="submit"] {
    width: 100%;
    padding: 12px;
    background-color: #333;
    color: #fff;
    border: none;
    font-size: 16px;
    cursor: pointer;
    font-family: inherit;
}

button[type="submit"]:hover {
    background-color: #000;
}

.error-message {
    color: #c00;
    font-size: 14px;
    margin-top: 10px;
    display: none;
}

/* Search Page */
.search-container {
    text-align: center;
    padding: 60px 0;
}

.search-container h1 {
    font-size: 32px;
    margin-bottom: 40px;
    font-weight: normal;
}

.search-box {
    display: flex;
    max-width: 600px;
    margin: 0 auto 40px;
    gap: 10px;
}

.search-box input[type="text"] {
    flex: 1;
    padding: 15px;
    font-size: 18px;
    border: 1px solid #ccc;
    font-family: inherit;
}

.search-box input[type="text"]:focus {
    outline: none;
    border-color: #666;
}

.search-box button {
    flex: 0 0 auto;
    width: 120px;         /* Fixed width */
    /* or */
    min-width: 100px;     /* Minimum width, can grow if needed */
}

.search-box button:hover {
    background-color: #000;
}

.search-box button:disabled {
    background-color: #999;
    cursor: not-allowed;
}

/* Results */
.results-container {
    max-width: 700px;
    margin: 0 auto;
    text-align: left;
}

.result-box {
    background-color: #f9f9f9;
    border-left: 3px solid #333;
    padding: 25px;
    margin-bottom: 20px;
    line-height: 1.8;
}

.result-box p {
    margin-bottom: 15px;
}

.result-box p:last-child {
    margin-bottom: 0;
}

.result-box .loading {
    color: #666;
    font-style: italic;
}

/* Array results (for later version) */
.result-item {
    background-color: #f9f9f9;
    border-left: 3px solid #333;
    padding: 20px 25px;
    margin-bottom: 15px;
}

.result-item h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.result-item p {
    font-size: 15px;
    color: #555;
}

/* Result Cards */
.result-card {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #333;
    padding: 25px;
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
}

.result-card:last-child {
    margin-bottom: 0;
}

/* Card Header */
.card-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.episode-title {
    font-size: 18px;
    font-weight: bold;
    color: #222;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.episode-date {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.title-link {
    color: #222;
    text-decoration: none;
    font-weight: bold;
}

.title-link:hover {
    color: #000;
    text-decoration: underline;
    cursor: pointer;
}

/* Response */
.card-response {
    font-size: 16px;
    line-height: 1.7;
    color: #333;
    margin-bottom: 20px;
}

.card-response p {
    margin-bottom: 12px;
}

.card-response p:last-child {
    margin-bottom: 0;
}

/* Quote Block */
.card-quote {
    background-color: #f0f0f0;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-left: 3px solid #666;
}

.quote-timestamp {
    font-size: 13px;
    color: #888;
    margin: 0 0 8px 0;
    font-family: monospace;
}

.card-quote blockquote {
    margin: 0;
    padding: 0;
    font-style: italic;
    color: #444;
    line-height: 1.6;
}

.card-quote blockquote::before {
    content: '"';
    color: #999;
    font-size: 1.4em;
    margin-right: 2px;
}

.card-quote blockquote::after {
    content: '"';
    color: #999;
    font-size: 1.4em;
    margin-left: 2px;
}

/* Footer */
.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}

/* Audio Player */
.audio-player {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

/* SHARED BASE: All play buttons */
.play-btn {
    padding: 6px 14px;
    background-color: #333;
    color: #fff;
    border: none;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.play-btn:hover {
    background-color: #000;
}

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

/* Button content spans */
.play-btn .btn-text,
.play-btn .btn-spinner {
    display: inline-block;
}

.play-btn .btn-spinner.hidden {
    display: none;
}

.audio-label {
    font-size: 13px;
    color: #666;
}

/* Show Notes Link */
.show-notes-link {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 16px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.show-notes-link:hover {
    background-color: #f0f0f0;
    text-decoration: none;
}

/* Responsive */
@media (max-width: 600px) {
    .card-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .card-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Admin Panel */
.admin-container h1 {
    margin-bottom: 30px;
    font-weight: normal;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.admin-card {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    padding: 25px;
}

.admin-card h3 {
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: normal;
}

.admin-card p {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.admin-card button {
    padding: 10px 20px;
    background-color: #333;
    color: #fff;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.admin-card button:hover {
    background-color: #000;
}

.admin-card button.running {
    background-color: #666;
}

/* Utility */
.hidden {
    display: none !important;
}

.logout-btn {
    color: #999;
    font-size: 14px;
}

.logout-btn:hover {
    color: #333;
}

/* Responsive */
@media (max-width: 600px) {
    .search-box {
        flex-direction: column;
    }
    
    .search-box button {
        width: 100%;
    }
    
    header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    nav a {
        margin: 0 10px;
    }
}

/* Spinner animation */
.spinner {
    width: 12px;
    height: 12px;
    border: 2px solid #ccc;
    border-top-color: #333;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Pending indicator styles */
.pending-indicator {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 14px;
    border: 1px dashed #ccc;
    margin: 20px 0;
    background-color: #fafafa;
}

.pending-indicator .spinner {
    width: 14px;
    height: 14px;
    margin-right: 8px;
}

.stream-complete {
    border-top: 1px solid #e0e0e0;
    padding-top: 15px;
    margin-top: 10px;
}


/* Search Status Bar */
.search-status {
    text-align: center;
    padding: 15px;
    margin: 0 auto 20px;
    max-width: 600px;
    background-color: #f5f5f5;
    border-radius: 4px;
    border-left: 3px solid #666;
    color: #555;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.search-status.hidden {
    display: none;
}

.search-status.complete {
    background-color: #f0f8f0;
    border-left-color: #4a4;
    color: #363;
}

.status-spinner {
    width: 14px;
    height: 14px;
    border-width: 2px;
}

.search-status.complete .status-spinner,
.search-status.hidden .status-spinner {
    display: none;
}

/* Result counter highlight */
.result-count {
    font-weight: bold;
    color: #333;
}

/* Transcript links */
/* Card Actions Container */
.card-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Transcript Link — matches Show Notes styling */
.transcript-link {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 16px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.transcript-link:hover {
    background-color: #f0f0f0;
}


/* Transcript Page Styles */

.transcript-header {
    max-width: 800px;
    margin: 0 auto 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.transcript-header .episode-title {
    font-size: 24px;
    margin-bottom: 10px;
}

.transcript-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.transcript-meta .episode-date {
    color: #666;
    font-size: 14px;
}

/* Turns Container */
.turns-container {
    max-width: 800px;
    margin: 0 auto;
}

/* Turn Block - Base Styles */
.turn-block {
    margin-bottom: 20px;
    padding: 20px;
    background-color: #fafafa;
    border-left: 4px solid #999;
}
.turn-block .play-btn {
    min-width: 70px;
}

.turn-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.turn-audio {
    display: flex;
    align-items: center;
    gap: 10px;
}

.turn-audio .play-btn {
    padding: 6px 14px;
    font-size: 13px;
    background-color: #333;
    color: #fff;
    border: none;
    cursor: pointer;
}

.turn-audio .play-btn:hover {
    background-color: #000;
}

.turn-timestamp {
    font-family: monospace;
    font-size: 13px;
    color: #666;
}

.turn-speaker {
    font-weight: bold;
    font-size: 14px;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.turn-text {
    font-size: 16px;
    line-height: 1.7;
    color: #333;
}

/* Speaker Border Colors - Option A */
.speaker-0 { border-left-color: #2c5282; }  /* Navy blue */
.speaker-1 { border-left-color: #276749; }  /* Forest green */
.speaker-2 { border-left-color: #c05621; }  /* Rust orange */
.speaker-3 { border-left-color: #553c9a; }  /* Deep purple */

/* Responsive */
@media (max-width: 600px) {
    .turn-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .transcript-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}
