/* Tampa City Council Transcripts - Main Stylesheet */

/* ============================================
   GLOBAL STYLES & VARIABLES
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #003f87;
    --secondary-color: #0066cc;
    --text-color: #333;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --border-color: #ddd;
    --highlight-color: #fff3cd;
    --active-segment: #e7f3ff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */

header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

header nav {
    margin-top: 0.5rem;
}

header nav a {
    color: white;
    text-decoration: none;
    margin-right: 1.5rem;
    opacity: 0.9;
    transition: opacity 0.2s;
}

header nav a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ============================================
   MAIN LAYOUT
   ============================================ */

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

/* ============================================
   FOOTER
   ============================================ */

footer {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 1.5rem;
    margin-top: 3rem;
}

footer p {
    opacity: 0.9;
    font-size: 0.9rem;
}

/* ============================================
   INDEX PAGE - HERO
   ============================================ */

.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 3rem 2rem;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.hero h1 {
    margin-bottom: 0.5rem;
    font-size: 2.5rem;
}

.hero p {
    opacity: 0.9;
    font-size: 1.1rem;
}

/* ============================================
   INDEX PAGE - MEETINGS GRID
   ============================================ */

.meetings-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
}

.meeting-card {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.meeting-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.meeting-thumbnail {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.meeting-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.meeting-thumbnail .placeholder-icon {
    font-size: 4rem;
    opacity: 0.5;
    color: white;
}

.meeting-card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.meeting-card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
}

.meeting-date {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-color);
}

.meeting-id {
    font-size: 0.85rem;
    color: #666;
    font-family: 'Courier New', monospace;
}

.meeting-type {
    font-size: 0.95rem;
    color: #444;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.meeting-stats {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    color: #666;
    font-size: 0.9rem;
    margin-top: auto;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-icon {
    font-size: 1.2rem;
}

.no-meetings {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--card-bg);
    border-radius: 8px;
}

.no-meetings h3 {
    color: #666;
    margin-bottom: 0.5rem;
}

/* ============================================
   TRANSCRIPT PAGE - LAYOUT
   ============================================ */

.transcript-container {
    display: grid;
    grid-template-columns: minmax(400px, 600px) minmax(600px, 1fr);
    gap: 2rem;
    margin-top: 1rem;
    max-width: 1800px;
    margin-left: auto;
    margin-right: auto;
}

.video-section {
    position: sticky;
    top: 1rem;
    height: fit-content;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}

.transcript-section {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* ============================================
   TRANSCRIPT PAGE - MEETING HEADER
   ============================================ */

.meeting-header {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.meeting-header h2 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.meeting-meta {
    color: #666;
    font-size: 0.9rem;
}

.meeting-meta span {
    margin-right: 1.5rem;
}

/* ============================================
   TRANSCRIPT PAGE - SEARCH
   ============================================ */

.search-container {
    margin-top: 1rem;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-results {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: var(--highlight-color);
}

.search-result-speaker {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.search-result-text {
    margin-top: 0.25rem;
    font-size: 0.9rem;
    color: var(--text-color);
}

.search-result-text mark {
    background-color: #ffeb3b;
    padding: 0.1rem 0.2rem;
    border-radius: 2px;
    font-weight: 600;
}

.search-stats {
    padding: 0.5rem 1rem;
    background: var(--bg-color);
    font-size: 0.85rem;
    color: #666;
    border-bottom: 1px solid var(--border-color);
}

.segment.search-highlight {
    background-color: #fff9c4;
    animation: highlight-pulse 0.6s ease-out;
}

@keyframes highlight-pulse {
    0% {
        background-color: #ffeb3b;
    }
    100% {
        background-color: #fff9c4;
    }
}

/* ============================================
   TRANSCRIPT PAGE - VIDEO TABS
   ============================================ */

.video-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.video-tab {
    padding: 0.75rem 1.5rem;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.video-tab:hover {
    background: var(--bg-color);
}

.video-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.video-tab-label {
    display: block;
    font-size: 0.85rem;
    opacity: 0.8;
}

/* ============================================
   TRANSCRIPT PAGE - VIDEO PLAYERS
   ============================================ */

.video-players {
    background: var(--card-bg);
    border-radius: 0 8px 8px 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.video-player {
    display: none;
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.video-player.active {
    display: block;
}

.video-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ============================================
   TRANSCRIPT PAGE - CHAPTERS
   ============================================ */

.chapters-section {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.chapters-section h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: var(--text-color);
    font-weight: 600;
}

.chapters-list {
    display: none;
}

.chapters-list.active {
    display: block;
}

.chapters-part-label {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.chapter-item {
    display: flex;
    align-items: baseline;
    padding: 0.5rem;
    margin-bottom: 0.25rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.chapter-item:hover {
    background-color: var(--highlight-color);
}

.chapter-timestamp {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 600;
    min-width: 70px;
    margin-right: 1rem;
}

.chapter-title {
    flex: 1;
    color: var(--text-color);
    font-size: 0.95rem;
}

/* ============================================
   TRANSCRIPT PAGE - SEGMENTS
   ============================================ */

.segment {
    margin-bottom: 2rem;
    padding: 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.segment.active {
    background-color: var(--active-segment);
    box-shadow: 0 0 0 2px var(--secondary-color);
}

.segment-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.speaker-name {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.timestamp {
    color: var(--secondary-color);
    text-decoration: none;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.timestamp:hover {
    background-color: var(--highlight-color);
    text-decoration: underline;
}

.segment-text {
    line-height: 1.8;
    color: var(--text-color);
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */

@media (max-width: 1200px) {
    .transcript-container {
        grid-template-columns: 500px 1fr;
    }
}

@media (max-width: 992px) {
    .transcript-container {
        grid-template-columns: 400px 1fr;
    }
}

@media (max-width: 768px) {
    /* Index page mobile */
    .hero h1 {
        font-size: 2rem;
    }

    .meetings-grid {
        grid-template-columns: 1fr;
    }

    .meeting-thumbnail {
        height: 200px;
    }

    .meeting-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .meeting-stats {
        gap: 1rem;
    }

    /* Transcript page mobile */
    .transcript-container {
        grid-template-columns: 1fr;
    }

    .video-section {
        position: sticky;
        top: 1rem;
        height: fit-content;
        z-index: 10;
        max-height: 50vh;
    }

    .transcript-section {
        max-height: none;
        padding: 1rem;
    }

    .video-tabs {
        flex-direction: column;
    }

    .video-tab {
        border-radius: 8px;
    }

    .video-players {
        border-radius: 8px;
    }

    .segment {
        padding: 0.75rem;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    header,
    footer {
        display: none;
    }

    body {
        background: white;
    }

    .video-section {
        display: none;
    }

    .transcript-container {
        grid-template-columns: 1fr;
    }

    .segment {
        page-break-inside: avoid;
    }

    .timestamp {
        color: #666;
    }
}
