/* ==========================================================================
   NP Meeting Note Live Viewer Stylesheet
   ========================================================================== */

:root {
    --bg-primary: #07151e;
    --bg-secondary: #0c202c;
    --bg-card: #102a39;
    --bg-card-hover: #143547;
    --border-color: rgba(42, 154, 202, 0.22);
    --border-highlight: #2A9ACA;
    --text-main: #e2e8f0;
    --text-muted: #8ca4b3;
    --text-accent: #79c0ff;
    --accent-glow: rgba(42, 154, 202, 0.35);
    --success: #10b981;
    --ended: #ef4444;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* App Structure */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    background: var(--bg-primary);
}

/* Header */
.app-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 260px;
}

.brand-logo {
    width: 40px;
    height: 40px;
    background: rgba(42, 154, 202, 0.15);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--border-highlight);
    flex-shrink: 0;
}

.brand-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.brand-info h1 {
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ffffff;
}

.meta-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge-software {
    background: rgba(255, 255, 255, 0.08);
    color: #a0aec0;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.badge-status.status-live {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-status.status-ended {
    background: rgba(239, 68, 68, 0.15);
    color: var(--ended);
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
    animation: blink 1.5s infinite;
}

.badge-status.status-ended .status-dot {
    animation: none;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.badge-viewers {
    background: rgba(42, 154, 202, 0.1);
    color: var(--text-accent);
    border: 1px solid rgba(42, 154, 202, 0.25);
}

/* Header Controls */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.control-label {
    font-size: 12px;
    color: var(--text-muted);
}

.select-dropdown {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
}

.select-dropdown:focus, .select-dropdown:hover {
    border-color: var(--border-highlight);
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    font-size: 12px;
    color: var(--text-muted);
}

.toggle-switch input {
    accent-color: var(--border-highlight);
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    font-family: inherit;
}

.btn-secondary {
    background: rgba(42, 154, 202, 0.12);
    border-color: var(--border-color);
    color: var(--text-accent);
}

.btn-secondary:hover {
    background: rgba(42, 154, 202, 0.25);
    border-color: var(--border-highlight);
    color: #ffffff;
}

/* Main Viewport */
.transcript-viewport {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

/* Transcript List & Cards */
.transcript-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.transcript-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    transition: transform 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.transcript-card:hover {
    border-color: rgba(42, 154, 202, 0.45);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
}

.speaker-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.speaker-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    background: #2563eb;
    text-transform: uppercase;
    flex-shrink: 0;
}

.speaker-name {
    font-weight: 700;
    font-size: 13px;
    color: #93c5fd;
}

.speech-time {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 32px;
}

.original-text {
    font-size: 14px;
    line-height: 1.5;
    color: #cbd5e1;
    word-break: break-word;
}

.translated-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-accent);
    border-left: 2px solid var(--border-highlight);
    padding-left: 10px;
    word-break: break-word;
    margin-top: 2px;
}

/* Display Modes */
.mode-translated-only .original-text {
    display: none !important;
}

.mode-translated-only .translated-text {
    border-left: none;
    padding-left: 0;
}

.mode-original-only .translated-text {
    display: none !important;
}

/* Live Speaking In-Flight Card */
.live-speaking-card {
    background: rgba(16, 42, 57, 0.7);
    border: 1px dashed var(--border-highlight);
    box-shadow: 0 0 15px rgba(42, 154, 202, 0.15);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
    0%, 100% { border-color: rgba(42, 154, 202, 0.4); }
    50% { border-color: rgba(42, 154, 202, 1); }
}

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

.speaker-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #60a5fa;
}

.live-pulse {
    width: 8px;
    height: 8px;
    background: #3b82f6;
    border-radius: 50%;
    box-shadow: 0 0 8px #3b82f6;
    animation: live-ring 1.2s infinite;
}

@keyframes live-ring {
    0% { transform: scale(0.9); opacity: 0.8; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.8; }
}

.live-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-accent);
    background: rgba(42, 154, 202, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.live-card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.live-text {
    font-style: italic;
    opacity: 0.95;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    gap: 12px;
}

.empty-icon {
    font-size: 40px;
}

.empty-state h3 {
    font-size: 16px;
    color: #ffffff;
    font-weight: 600;
}

.empty-state p {
    font-size: 13px;
    max-width: 440px;
    line-height: 1.6;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-highlight);
    color: #ffffff;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: all 0.25s ease;
    z-index: 999;
}

.toast.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* QR Code Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 360px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.modal-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
}

.qr-code-box {
    background: #ffffff;
    padding: 14px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 200px;
    height: 200px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    box-sizing: border-box;
}

.qr-code-box svg {
    width: 100%;
    height: 100%;
    display: block;
}

.qr-target-options {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: var(--text-muted);
}

.qr-target-options label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.qr-target-options input[type="radio"] {
    accent-color: var(--border-highlight);
    cursor: pointer;
}

.qr-url-row {
    display: flex;
    width: 100%;
    gap: 6px;
}

.qr-url-row input {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-accent);
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: var(--font-mono);
    outline: none;
}

.modal-hint {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

/* Responsive */
@media (max-width: 640px) {
    .app-header {
        padding: 12px 14px;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .transcript-viewport {
        padding: 16px 12px;
    }

    .card-content {
        padding-left: 0;
    }
}
