/* Retro newsroom/cassette inspired theme */
:root {
    --font-mono: 'IBM Plex Mono', monospace;
    --font-body: Georgia, serif;
    --font-code: 'Source Code Pro', monospace;
    
    /* Granicus theme colors */
    --granicus-primary: #2c3e50;
    --granicus-secondary: #e74c3c;
    --granicus-accent: #3498db;
    --granicus-light: #ecf0f1;
    --granicus-dark: #2c3e50;
}

body {
    font-family: var(--font-body);
    background-color: #f8f9fa;
    line-height: 1.6;
    color: #3F3F3F;
}

/* Headers */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-body);
    font-weight: 600;
    color: #2c3e50;
    letter-spacing: normal;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

/* Transcript segments */
.transcript-segments {
    font-family: var(--font-body);
    line-height: 1.6;
    color: #333;
    max-width: 900px;
    margin: 0 auto;
}

.transcript-segment {
    padding: 0.75rem 0;
    transition: background-color 0.2s ease;
}

.transcript-segment:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.segment-timestamp {
    color: #6c757d;
    font-family: var(--font-mono);
    font-size: 0.9em;
    margin-bottom: 0.25rem;
}

.segment-speaker {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.segment-text {
    line-height: 1.6;
    word-wrap: break-word;
}

/* Make timestamps more subtle */
.text-muted {
    opacity: 0.8;
    font-size: 0.9em;
}

/* Add some spacing between segments */
.transcript-segment + .transcript-segment {
    margin-top: 0.5rem;
}

/* Code and UI elements */
code, pre, kbd, samp, .code {
    font-family: var(--font-code);
    font-size: 0.9em;
}

/* Forms and inputs */
input, textarea, select, button {
    font-family: var(--font-body);
}

/* Protected brand styling - keeps original look */
.brand-protected {
    font-family: 'Courier New', monospace !important;
    /* Any other brand-specific styles that should be preserved */
}

.card {
    border: none;
    border-radius: 0;
    background-color: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Navbar-specific heading */
.navbar h1,
.dymo-label {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Main content heading */
#transcriptContainer h1,
#transcriptTitleContainer h1,
.main-content h1 {
    font-family: var(--font-body);
    font-weight: 600;
    color: #2c3e50;
    text-transform: none;
    letter-spacing: normal;
    margin-bottom: 1rem;
}

.btn-primary {
    background-color: #2c3e50;
    border-color: #2c3e50;
    border-radius: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

.btn-primary:hover {
    background-color: #34495e;
    border-color: #34495e;
}

.progress {
    border-radius: 0;
    background-color: #eee;
}

.progress-bar {
    background-color: #2c3e50;
}

.list-group-item {
    border-radius: 0;
    border-left: none;
    border-right: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.list-group-item:hover {
    background-color: #f8f9fa;
}

.list-group-item.nav-tabs {
    border-bottom: 0;
    display: flex;
    gap: 0.5rem;
    background: transparent;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.nav-tabs .nav-item {
    margin-bottom: 0;
}

.nav-tabs {
    border-bottom: 2px solid #e0d7b8;
    margin-bottom: 0;
}

.nav-tabs .nav-link {
    border: none;
    border-radius: 0;
    background: transparent;
    color: #6c757d;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 1rem;
    letter-spacing: normal;
    padding: 0.75rem 1.5rem;
    margin: 0;
    position: relative;
    transition: all 0.2s ease;
    outline: none;
    white-space: nowrap;
    z-index: 1;
    border-bottom: 3px solid transparent;
}

.nav-tabs .nav-link:focus {
    background: rgba(0, 0, 0, 0.03);
    color: #2c3e50;
    z-index: 3;
}

.nav-tabs .nav-link.active, 
.nav-tabs .nav-link[aria-selected="true"] {
    background: transparent;
    color: #2c3e50;
    font-weight: 600;
    border-bottom: 3px solid #2c3e50;
    margin-bottom: -1px;
    z-index: 2;
    box-shadow: none;
}

.nav-tabs .nav-link:not(.active):hover {
    background: rgba(0, 0, 0, 0.03);
    color: #2c3e50;
    border-bottom: 3px solid #e9ecef;
}

.list-group-item.active {
    background-color: #2c3e50;
    border-color: #2c3e50;
}

#transcriptText {
    font-family: 'Courier New', monospace;
    line-height: 1.6;
    max-height: 400px;
    overflow-y: auto;
}

#transcript-display {
    font-family: 'Courier New', monospace;
    line-height: 1.6;
    max-height: 400px;
    overflow-y: auto;
}

/* Cassette tape animation for loading states */
@keyframes cassette-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.cassette-reel-spinning {
    animation: cassette-spin 0.8s linear infinite;
    transform-origin: 50% 50%;
}

.loading::after {
    content: "\2699";
    display: inline-block;
    margin-left: 8px;
    animation: cassette-spin 2s linear infinite;
}

/* Cassette tape button styles */
.navbar-cassette-icon {
    display: inline-flex;
    align-items: center;
    background: none;
    border-radius: 6px;
    /* box-shadow removed for subtle look */
    padding: 2px 6px 2px 2px;
    margin-right: 0.5rem;
    height: 22px;
}

.dymo-label {
    background: #b71c1c;
    color: #fff;
    border-radius: 0;
    padding: 0.22em 1.15em 0.18em 1.15em;
    font-family: 'Courier New', monospace;
    font-size: 1.22rem;
    font-weight: bold;
    letter-spacing: 0.11em;
    /* box-shadow and yellow halo removed for subtlety */
    box-shadow: none;
    text-shadow: 0 2px 2px #7b1010, 0 -1px 1px #7b1010;
    margin-left: 0.1rem;
    margin-right: 0.1rem;
    display: inline-block;
    line-height: 1.2;
    border: 2px solid #a84b00;
}

.cassette-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    background: #fff;
    color: #222426;
    border: 2px solid #222;
    border-radius: 7px;
    font-family: 'Courier New', monospace;
    font-size: 1.13rem;
    font-weight: bold;
    padding: 0.54rem 1.3rem 0.54rem 1.3rem;
    box-shadow: none;
    cursor: pointer;
    transition: background 0.16s, color 0.16s, border 0.16s;
    outline: none;
    margin-bottom: 0.5rem;
}

.cassette-btn:disabled {
    background: #f5f5f5;
    color: #bbb;
    border-color: #ddd;
    cursor: not-allowed;
    opacity: 0.7;
}

.cassette-btn:hover, .cassette-btn:focus {
    background: #f3f3f3;
    color: #111;
    border-color: #111;
}

.cassette-svg-container {
    display: flex;
    align-items: center;
    height: 36px;
}

.cassette-svg {
    display: block;
    height: 36px;
    width: 90px;
}
.cassette-label {
    font-family: inherit;
    font-size: 1.08rem;
    color: #222426 !important;
    text-shadow: none !important;
    letter-spacing: 1.5px;
    margin-left: 0.5rem;
    background: none !important;
}
.cassette-btn:active .cassette-label,
.cassette-btn:hover .cassette-label {
    color: #fffbe6;
    text-shadow: 0 2px 6px #b7a77a;
}
.cassette-btn:active .cassette-label,
.cassette-btn:hover .cassette-label {
    color: #fffbe6;
    text-shadow: 0 2px 6px #b7a77a;
}
.cassette-reel circle {
    transition: filter 0.2s;
}
.cassette-btn:active .cassette-reel circle,
.cassette-btn:hover .cassette-reel circle {
    filter: drop-shadow(0 0 4px #ffe6a1);
}
/* Reel spin animation */
@keyframes reel-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.cassette-btn:active .cassette-reel,
.cassette-btn:hover .cassette-reel {
  animation: reel-spin 0.8s linear infinite;
  transform-origin: 50% 50%;
}

.input-group, .input-group {
    align-items: stretch;
}
.input-group > .form-control, .input-group > .cassette-btn {
    height: 48px;
    min-height: 48px;
    font-size: 1.12rem;
    box-shadow: none;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}
.input-group > .form-control {
    border-radius: 7px 0 0 7px;
}
.input-group > .cassette-btn {
    border-radius: 0 7px 7px 0;
    margin-left: 0;
    margin-right: 0;
    display: flex;
    align-items: center;
    font-size: 1.13rem;
    box-shadow: none;
}

.choose-wisely-row {
    margin-bottom: 2rem !important;
    font-size: 1.13rem;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
    align-items: center;
}
.choose-wisely-label {
    color: #a84b00;
    background: #ffe6a1;
    border-radius: 7px;
    padding: 0.2rem 0.85rem 0.2rem 0.7rem;
    box-shadow: 0 2px 8px #ffe6a1;
    font-weight: bold;
    margin-right: 0.5rem;
}
.choose-wisely-row svg {
    vertical-align: -0.18em;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 1px 4px #ffe6a1;
    transition: box-shadow 0.18s;
}
.choose-wisely-row svg:focus, .choose-wisely-row svg:active {
    outline: 2px solid #a84b00;
    box-shadow: 0 0 0 3px #ffe6a1, 0 1px 4px #ffe6a1;
}

.alert-success, .cc-detected-box {
    background: #fffbe6;
    border: 1px solid #ffe6a1;
    color: #222;
    margin: 0;
    box-shadow: none;
}

/* De-emphasize secondary button after parse */
.btn-secondary {
    background-color: #b0bec5 !important;
    color: #444 !important;
    border-color: #b0bec5 !important;
    box-shadow: none !important;
    margin: 0 !important;
    border-radius: 8px !important;
    font-family: 'Courier New', monospace !important;
    font-size: 1.04rem !important;
}

/* --- MODERN, SUBTLE CASSETTE BUTTON VARIANTS --- */
.cassette-btn-window {
    position: relative;
    background: #fff;
    border: 2px solid #222426;
    overflow: visible;
}
.cassette-btn-window::before {
    content: '';
    position: absolute;
    left: 18%; right: 18%; top: 50%; height: 1.3em;
    transform: translateY(-50%);
    background: #f5f5f5;
    border: 1.2px solid #e0e0e0;
    border-radius: 0.18rem;
    z-index: 1;
    opacity: 0.92;
}
.cassette-btn-window .cassette-label { position: relative; z-index: 2; }

.cassette-btn-soft {
    border-radius: 1.1rem;
    box-shadow: 0 2px 8px 0 #dedede;
    background: #fafafa;
    border: 2px solid #e2e2e2;
}

.cassette-btn-embossed {
    box-shadow: inset 0 2.5px 7px 0 #cfcfcf, 0 1.5px 7px 0 #22242612;
    background: linear-gradient(180deg, #f8f8f8 70%, #e7e7e7 100%);
    border: 2.5px solid #b8b8b8;
    color: #444;
}
.cassette-btn-embossed .cassette-label {
    font-weight: 500;
    letter-spacing: 1.7px;
    color: #222426;
    text-shadow: 0 1px 0 #fff, 0 1.5px 1.5px #bbb;
}

.cassette-btn-minimal {
    border-radius: 0.7rem;
    border: 1.5px solid #bbb;
    background: #fff;
    box-shadow: 0 1.5px 6px 0 #e5e5e5;
    transition: border 0.14s, box-shadow 0.14s;
}
.cassette-btn-minimal:hover, .cassette-btn-minimal:focus {
    border: 1.5px solid #a84b00;
    box-shadow: 0 2.5px 10px 0 #ffe6a155;
}

/* Transcript text styling */
.transcript-text {
    font-family: var(--font-body);
    line-height: 1.8;
    color: #333;
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem;
}

.transcript-text p {
    margin-bottom: 1.5rem;
    text-align: justify;
    hyphens: auto;
}

/* Ensure consistent styling for both segment-based and plain text transcripts */
#transcript-display,
#latest-display {
    font-family: var(--font-body);
    line-height: 1.8;
    color: #333;
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Style for segment timestamps */
.segment-timestamp {
    color: #666;
    font-size: 0.85em;
    margin-right: 0.5rem;
    font-family: var(--font-mono);
}

/* Style for transcript segments */
.transcript-segment {
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.transcript-segment:hover {
    background-color: #f8f9fa;
}

/* Transcript Styling */
.transcript-segments {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

.transcript-segment {
    border-left: 3px solid var(--granicus-accent, #3498db);
    padding: 0.5rem 0 0.5rem 1rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.transcript-segment:hover {
    background-color: #f8f9fa;
    border-left-color: var(--granicus-secondary, #e74c3c);
}

.segment-timestamp {
    color: #6c757d;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
    font-family: var(--font-mono);
}

.segment-text {
    line-height: 1.5;
    color: #333;
}

/* Highlight the current segment being played */
.transcript-segment.playing {
    background-color: #f0f7ff;
    border-left-color: var(--granicus-primary, #2c3e50);
}

/* Make timestamps clickable for seeking */
.segment-timestamp {
    cursor: pointer;
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.segment-timestamp:hover {
    background-color: #e9ecef;
}

/* Granicus Metadata Card */
.granicus-metadata {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 1.5rem;
}

.granicus-metadata:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.1);
}

.granicus-metadata .card-header {
    background-color: var(--granicus-primary);
    color: white;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.granicus-metadata .card-body {
    padding: 1.25rem;
    background-color: #fff;
}

.granicus-metadata .card-title {
    color: var(--granicus-primary);
    margin-bottom: 1rem;
    font-weight: 600;
}

.granicus-metadata .badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    margin-right: 0.5em;
    margin-bottom: 0.5em;
    text-transform: capitalize;
}

.granicus-metadata .btn {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Loading spinner */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 0.2em solid var(--granicus-light);
    border-radius: 50%;
    border-top-color: var(--granicus-primary);
    animation: spin 1s ease-in-out infinite;
    margin-right: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .granicus-metadata .btn {
        width: 100%;
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .granicus-metadata .btn:last-child {
        margin-bottom: 0;
    }
}

/* Animation for metadata loading */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.metadata-enter {
    animation: fadeIn 0.3s ease-out forwards;
}

/* Status messages */
.status-message {
    padding: 1rem;
    border-radius: 0.25rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.status-message .spinner-border {
    margin-right: 0.5rem;
}

/* Tooltip styles */
.tooltip-inner {
    max-width: 300px;
    padding: 0.5rem 1rem;
    background-color: var(--granicus-dark);
    font-size: 0.875rem;
    font-family: var(--font-body);
}

.bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow::before, 
.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: var(--granicus-dark);
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Tooltip Banner Styles */
.tooltip-banner {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px 20px;
    margin-bottom: 20px;
    position: relative;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.tooltip-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #6c757d;
}

.tooltip-close:hover {
    color: #343a40;
}

.tooltip-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

.tooltip-content p {
    margin-bottom: 0.5rem;
}

.tooltip-content p:last-child {
    margin-top: 1rem;
    margin-bottom: 0;
    font-style: italic;
}
