/* PKH Recordings - Styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --navy: #1a365d;
    --accent: #2b6cb0;
    --accent-light: #3182ce;
    --bg: #f7fafc;
    --white: #fff;
    --text: #2d3748;
    --muted: #718096;
    --border: #e2e8f0;
    --danger: #e53e3e;
    --success: #38a169;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-light); }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border: none; border-radius: var(--radius);
    font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-light); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--muted); }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-full { width: 100%; justify-content: center; padding: 10px; }
.btn-danger { background: var(--danger); color: #fff; }

/* Inputs */
.input {
    padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 14px; background: var(--white); color: var(--text);
    transition: border-color 0.15s;
}
.input:focus { outline: none; border-color: var(--accent); }
.input-date { width: 150px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 4px; font-size: 14px; font-weight: 500; color: var(--muted); }
.form-group input { width: 100%; padding: 10px 12px; }

/* Login Page */
.login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--navy) 0%, var(--accent) 100%);
}
.login-card {
    background: var(--white); border-radius: 12px; padding: 40px;
    width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo h1 { font-size: 36px; color: var(--navy); letter-spacing: 2px; }
.login-logo p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.error-msg { background: #fff5f5; color: var(--danger); padding: 8px 12px; border-radius: var(--radius); font-size: 14px; margin-bottom: 12px; }

/* App Layout */
.app-layout { min-height: 100vh; }

.topbar {
    background: var(--navy); color: #fff; padding: 0 24px; height: 56px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 100;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 16px; }
.logo { color: #fff; font-size: 20px; font-weight: 700; letter-spacing: 1px; }
.logo:hover { color: #fff; }
.nav-sep { width: 1px; height: 24px; background: rgba(255,255,255,0.2); }
.nav-link { color: rgba(255,255,255,0.7); font-size: 14px; padding: 4px 8px; border-radius: 4px; }
.nav-link:hover { color: #fff; }
.nav-link.active { color: #fff; background: rgba(255,255,255,0.1); }
.user-name { font-size: 13px; color: rgba(255,255,255,0.7); }
.topbar-right .btn-outline { color: rgba(255,255,255,0.7); border-color: rgba(255,255,255,0.2); }
.topbar-right .btn-outline:hover { color: #fff; border-color: rgba(255,255,255,0.5); }

.content { max-width: 1200px; margin: 0 auto; padding: 24px; }

.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-header h2 { font-size: 24px; color: var(--navy); }

.stats-bar { display: flex; gap: 24px; font-size: 13px; color: var(--muted); }
.stat-item { display: flex; align-items: center; gap: 4px; }
.stat-value { font-weight: 600; color: var(--text); }

/* Filters */
.filters-row {
    display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
    margin-bottom: 20px; padding: 16px; background: var(--white);
    border-radius: var(--radius); box-shadow: var(--shadow);
}
.toggle-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap; }

/* Recordings List */
.recordings-list { display: flex; flex-direction: column; gap: 8px; }

.recording-card {
    display: grid; grid-template-columns: 1fr auto auto auto auto;
    gap: 16px; align-items: center;
    background: var(--white); padding: 16px 20px; border-radius: var(--radius);
    box-shadow: var(--shadow); cursor: pointer; transition: box-shadow 0.15s;
}
.recording-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

.rec-info h4 { font-size: 15px; margin-bottom: 2px; color: var(--text); }
.rec-info p { font-size: 13px; color: var(--muted); }
.rec-meta { text-align: right; font-size: 13px; color: var(--muted); white-space: nowrap; }
.rec-meta strong { display: block; color: var(--text); }
.rec-clips {
    background: var(--accent); color: #fff; padding: 2px 8px;
    border-radius: 12px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.rec-clips.empty { background: var(--border); color: var(--muted); }
.rec-size { font-size: 13px; color: var(--muted); white-space: nowrap; }
.rec-type { font-size: 11px; padding: 2px 6px; border-radius: 4px; background: #edf2f7; color: var(--muted); }

/* Pagination */
.pagination {
    display: flex; justify-content: center; gap: 4px; margin-top: 24px; flex-wrap: wrap;
}
.pagination button {
    padding: 6px 12px; border: 1px solid var(--border); background: var(--white);
    border-radius: var(--radius); cursor: pointer; font-size: 13px; color: var(--text);
}
.pagination button:hover { border-color: var(--accent); color: var(--accent); }
.pagination button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination button:disabled { opacity: 0.4; cursor: default; }

/* Recording Detail */
.back-link { display: inline-block; margin-bottom: 16px; font-size: 14px; }
.recording-header { margin-bottom: 20px; }
.recording-header h2 { font-size: 22px; color: var(--navy); margin-bottom: 4px; }
.recording-header .meta { font-size: 14px; color: var(--muted); display: flex; gap: 16px; flex-wrap: wrap; }

.recording-layout {
    display: grid; grid-template-columns: 1fr 350px; gap: 24px;
    align-items: start;
}
@media (max-width: 900px) {
    .recording-layout { grid-template-columns: 1fr; }
}

.video-player {
    width: 100%; border-radius: var(--radius); background: #000;
    box-shadow: var(--shadow);
}

.clips-panel {
    background: var(--white); border-radius: var(--radius); padding: 20px;
    box-shadow: var(--shadow); max-height: 600px; overflow-y: auto;
}
.clips-panel h3 { font-size: 16px; color: var(--navy); margin-bottom: 12px; }

.clip-item {
    padding: 10px 0; border-bottom: 1px solid var(--border);
}
.clip-item:last-child { border-bottom: none; }
.clip-timestamp {
    display: inline-block; background: var(--navy); color: #fff;
    padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600;
    cursor: pointer; margin-right: 8px;
}
.clip-timestamp:hover { background: var(--accent); }
.clip-coach { font-size: 12px; color: var(--muted); }
.clip-note { font-size: 14px; margin-top: 4px; }
.no-clips { color: var(--muted); font-size: 14px; font-style: italic; }

.related-files { margin-top: 24px; }
.related-files h3 { font-size: 16px; color: var(--navy); margin-bottom: 12px; }
.related-file-item {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 16px; background: var(--white); border-radius: var(--radius);
    box-shadow: var(--shadow); margin-right: 8px; margin-bottom: 8px;
    font-size: 13px; cursor: pointer;
}
.related-file-item:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

/* Clips Dashboard */
.clips-dashboard-list { display: flex; flex-direction: column; gap: 8px; }

.clip-dashboard-card {
    background: var(--white); padding: 16px 20px; border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.clip-dashboard-card .clip-meeting {
    font-size: 14px; font-weight: 500; margin-bottom: 4px;
}
.clip-dashboard-card .clip-meeting a { color: var(--accent); }
.clip-dashboard-card .clip-meta {
    font-size: 13px; color: var(--muted); display: flex; gap: 12px; margin-bottom: 6px;
}
.clip-dashboard-card .clip-note { font-size: 14px; }

/* Settings */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 900px) { .settings-grid { grid-template-columns: 1fr; } }

.card {
    background: var(--white); border-radius: var(--radius); padding: 24px;
    box-shadow: var(--shadow);
}
.card h3 { font-size: 18px; color: var(--navy); margin-bottom: 16px; }
.card h4 { font-size: 15px; color: var(--text); margin: 12px 0 8px; }
.card hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

.coach-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 0; border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.coach-row:last-child { border-bottom: none; }
.coach-info .coach-name { font-weight: 500; }
.coach-info .coach-email { font-size: 12px; color: var(--muted); }
.coach-badge { font-size: 11px; padding: 2px 6px; border-radius: 4px; }
.coach-badge.admin { background: #ebf8ff; color: var(--accent); }
.coach-badge.coach { background: #f0fff4; color: var(--success); }
.coach-badge.inactive { background: #fff5f5; color: var(--danger); }

.add-coach-form { display: flex; flex-direction: column; gap: 8px; }
.add-coach-form .input { width: 100%; }

.msg { padding: 8px 12px; border-radius: var(--radius); font-size: 14px; margin-top: 8px; }
.msg.success { background: #f0fff4; color: var(--success); }
.msg.error { background: #fff5f5; color: var(--danger); }

.info-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--muted); }
.info-value { font-weight: 500; }

/* Transcript panel */
.transcript-panel {
    margin-top: 20px; background: var(--white); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 20px;
}
.transcript-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
}
.transcript-header h3 { font-size: 16px; color: var(--navy); }
.transcript-meta { font-size: 12px; color: var(--muted); }
.transcript-content { max-height: 500px; overflow-y: auto; }
.transcript-segment {
    display: flex; gap: 10px; padding: 6px 8px; border-radius: 4px;
    transition: background 0.15s; align-items: baseline;
}
.transcript-segment.active { background: #ebf8ff; }
.segment-time {
    flex-shrink: 0; font-size: 12px; font-weight: 600; color: var(--accent);
    cursor: pointer; min-width: 44px; font-variant-numeric: tabular-nums;
}
.segment-time:hover { color: var(--accent-light); text-decoration: underline; }
.segment-text { font-size: 14px; line-height: 1.6; }
.transcript-fulltext { font-size: 14px; line-height: 1.8; white-space: pre-wrap; }

/* Search match badges */
.match-badge {
    display: inline-block; font-size: 11px; padding: 1px 6px;
    border-radius: 4px; font-weight: 500; margin-top: 4px;
}
.match-badge.transcript { background: #ebf8ff; color: var(--accent); }
.match-badge.topic { background: #f0fff4; color: var(--success); }

/* Transcript snippet in search results */
.transcript-snippet {
    font-size: 13px; color: var(--muted); margin-top: 6px;
    line-height: 1.5; max-width: 600px;
}
.transcript-snippet mark {
    background: #fefcbf; color: var(--text); padding: 0 2px; border-radius: 2px;
}

/* Has-transcript indicator */
.rec-transcript-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; font-size: 10px; font-weight: 700;
    background: var(--accent); color: #fff; border-radius: 3px;
    margin-left: 6px; vertical-align: middle;
}

/* Loading */
.loading { text-align: center; padding: 40px; color: var(--muted); }
