/* Copycat Meet & AI Truth Sentinel Stylesheet */

:root {
    --meet-bg: #0b0f19;
    --meet-surface: #111827;
    --meet-surface-2: #1f2937;
    --meet-border: rgba(255, 255, 255, 0.08);
    --meet-primary: #6366f1;
    --meet-primary-hover: #4f46e5;
    --meet-success: #10b981;
    --meet-warning: #f59e0b;
    --meet-danger: #ef4444;
    --meet-text: #f3f4f6;
    --meet-text-muted: #9ca3af;
}

body.meet-body {
    background-color: var(--meet-bg);
    color: var(--meet-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.meet-header {
    height: 52px;
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--meet-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    z-index: 100;
}

.badge-online {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--meet-success);
    margin-left: 12px;
}

.peer-pill {
    font-size: 0.8rem;
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 4px 10px;
    border-radius: 9999px;
    font-weight: 500;
}

/* Main Layout */
.meet-main {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
}

/* Video Stage Section */
.video-stage-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 14px;
    overflow-y: auto;
    background: radial-gradient(circle at 50% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 60%);
}

/* Screen Share Stage */
.screen-stage {
    background: #000;
    border-radius: 12px;
    border: 1px solid var(--meet-border);
    margin-bottom: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 480px;
    transition: all 0.3s ease;
}

.screen-stage.hidden {
    display: none;
}

.screen-stage-header {
    background: rgba(31, 41, 55, 0.9);
    padding: 8px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: #e5e7eb;
}

.screen-video-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
}

.screen-video-wrapper video {
    max-width: 100%;
    max-height: 420px;
    object-fit: contain;
}

/* Video Grid */
.video-grid {
    flex: 1;
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    align-items: center;
    justify-content: center;
    min-height: 280px;
}

.video-grid.single-peer {
    max-width: 820px;
    margin: 0 auto;
    width: 100%;
}

.video-card {
    position: relative;
    background: #1e293b;
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--meet-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Mirror local video */
}

.video-card .hud-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    transform: scaleX(-1);
}

.video-card-top-hud {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.hud-pill {
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f8fafc;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.hud-emotion {
    background: rgba(99, 102, 241, 0.4);
    border-color: rgba(99, 102, 241, 0.6);
    color: #e0e7ff;
}

.video-card-bottom-hud {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}

.hud-stat-group {
    display: flex;
    gap: 6px;
}

.hud-mini-stat {
    background: rgba(15, 23, 42, 0.7);
    color: #cbd5e1;
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Sound Wave Animation */
.hud-audio-indicator {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
}

.sound-wave {
    width: 3px;
    background: var(--meet-success);
    border-radius: 2px;
    height: 4px;
    transition: height 0.1s ease;
}

.hud-audio-indicator.speaking .sound-wave:nth-child(1) { height: 12px; }
.hud-audio-indicator.speaking .sound-wave:nth-child(2) { height: 16px; }
.hud-audio-indicator.speaking .sound-wave:nth-child(3) { height: 8px; }

/* Remote Placeholder */
.remote-placeholder-card {
    background: rgba(30, 41, 59, 0.4);
    border: 2px dashed rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    aspect-ratio: 16 / 9;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
}

.placeholder-icon {
    font-size: 2.2rem;
    margin-bottom: 8px;
    opacity: 0.6;
}

.remote-placeholder-card h3 {
    margin: 0 0 6px 0;
    font-size: 1.1rem;
    color: #f1f5f9;
}

.remote-placeholder-card p {
    font-size: 0.85rem;
    color: var(--meet-text-muted);
    max-width: 380px;
    margin: 0 0 14px 0;
}

.share-url-box {
    display: flex;
    gap: 6px;
    width: 100%;
    max-width: 380px;
}

.share-url-box input {
    flex: 1;
    background: #0f172a;
    border: 1px solid var(--meet-border);
    color: #e2e8f0;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
}

/* Floating Call Controls Toolbar */
.call-controls-bar {
    position: sticky;
    bottom: 12px;
    margin: 16px auto 0 auto;
    background: rgba(17, 24, 39, 0.9);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    border-radius: 9999px;
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 50;
}

.control-circle-btn {
    background: #1f2937;
    color: #f3f4f6;
    border: 1px solid var(--meet-border);
    border-radius: 12px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 64px;
}

.control-circle-btn:hover {
    background: #374151;
    transform: translateY(-2px);
}

.control-circle-btn.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.5);
    color: #818cf8;
}

.control-circle-btn.muted, .control-circle-btn.off {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fca5a5;
}

.control-circle-btn.btn-danger {
    background: #ef4444;
    border-color: #dc2626;
    color: #ffffff;
}

.control-circle-btn.btn-danger:hover {
    background: #dc2626;
}

.ctrl-icon {
    font-size: 1.15rem;
}

.ctrl-label {
    font-size: 0.65rem;
    font-weight: 600;
    margin-top: 2px;
    letter-spacing: 0.3px;
}

/* Sidebar & Panels */
.meet-sidebar {
    width: 380px;
    background: var(--meet-surface);
    border-left: 1px solid var(--meet-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-tabs {
    display: flex;
    background: #0f172a;
    border-bottom: 1px solid var(--meet-border);
}

.sidebar-tab {
    flex: 1;
    padding: 10px 6px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--meet-text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.sidebar-tab:hover {
    color: #e2e8f0;
}

.sidebar-tab.active {
    color: var(--meet-primary);
    border-bottom-color: var(--meet-primary);
    background: rgba(99, 102, 241, 0.06);
}

.sidebar-panel {
    flex: 1;
    display: none;
    flex-direction: column;
    overflow-y: auto;
    padding: 16px;
}

.sidebar-panel.active {
    display: flex;
}

/* Panel 1: Truth Sentinel */
.sentinel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.sentinel-header h4 {
    margin: 0;
    font-size: 0.95rem;
    color: #f1f5f9;
}

.ai-pulse-indicator {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--meet-success);
    letter-spacing: 0.5px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.veracity-gauge-card {
    background: #1e293b;
    border-radius: 12px;
    border: 1px solid var(--meet-border);
    padding: 16px;
    text-align: center;
    margin-bottom: 14px;
}

.gauge-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 8px;
}

.gauge-score {
    font-size: 2.2rem;
    font-weight: 800;
    color: #818cf8;
}

.gauge-caption {
    font-size: 0.65rem;
    letter-spacing: 1px;
    font-weight: 700;
    color: var(--meet-text-muted);
}

.veracity-bar-wrapper {
    height: 8px;
    background: #0f172a;
    border-radius: 9999px;
    overflow: hidden;
    margin: 8px 0 12px 0;
}

.veracity-fill-bar {
    height: 100%;
    background: linear-gradient(90deg, #ef4444 0%, #f59e0b 50%, #10b981 100%);
    border-radius: 9999px;
    transition: width 0.4s ease;
}

.verdict-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.verdict-truthful {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.verdict-uncertain {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.verdict-deception {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.veracity-summary-text {
    font-size: 0.75rem;
    color: #94a3b8;
    margin: 8px 0 0 0;
    line-height: 1.4;
}

/* Telemetry Grid */
.telemetry-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
}

.telemetry-item {
    background: #0f172a;
    border: 1px solid var(--meet-border);
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
}

.tel-label {
    font-size: 0.65rem;
    color: var(--meet-text-muted);
    font-weight: 600;
}

.tel-value {
    font-size: 0.8rem;
    color: #e2e8f0;
    margin-top: 2px;
}

/* Transcript Feed */
.transcript-feed-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 200px;
    margin-bottom: 12px;
}

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

.feed-header h5 {
    margin: 0;
    font-size: 0.85rem;
    color: #e2e8f0;
}

.statement-feed-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 260px;
    padding-right: 4px;
}

.statement-card {
    background: #1e293b;
    border-radius: 8px;
    padding: 10px;
    border-left: 3px solid #64748b;
    font-size: 0.8rem;
    animation: fadeIn 0.25s ease;
}

.statement-card.truthful { border-left-color: var(--meet-success); }
.statement-card.uncertain { border-left-color: var(--meet-warning); }
.statement-card.suspect_deception { border-left-color: var(--meet-danger); }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.stmt-time {
    font-size: 0.7rem;
    color: var(--meet-text-muted);
}

.badge-mini {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.badge-truth { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.badge-hesitant { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.badge-deception { background: rgba(239, 68, 68, 0.2); color: #f87171; }

.stmt-text {
    color: #f1f5f9;
    font-style: italic;
    margin-bottom: 6px;
    line-height: 1.3;
}

.stmt-markers {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.marker-pill {
    background: #0f172a;
    color: #94a3b8;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Manual Statement Box */
.manual-statement-box {
    background: #0f172a;
    border: 1px solid var(--meet-border);
    border-radius: 8px;
    padding: 10px;
}

.manual-statement-box label {
    display: block;
    font-size: 0.75rem;
    color: var(--meet-text-muted);
    margin-bottom: 6px;
    font-weight: 600;
}

.input-with-button {
    display: flex;
    gap: 6px;
}

.input-with-button input {
    flex: 1;
    background: #1e293b;
    border: 1px solid var(--meet-border);
    color: #fff;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
}

/* Panel 2: Media Share Hub */
.media-hub-header h4 {
    margin: 0 0 2px 0;
    font-size: 0.95rem;
}

.sub-label {
    font-size: 0.75rem;
    color: var(--meet-text-muted);
}

.media-dropzone {
    margin-top: 12px;
    border: 2px dashed rgba(99, 102, 241, 0.4);
    background: rgba(99, 102, 241, 0.04);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}

.media-dropzone.dragover {
    border-color: var(--meet-primary);
    background: rgba(99, 102, 241, 0.12);
}

.dropzone-icon {
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.dropzone-text {
    font-size: 0.8rem;
    margin: 0 0 8px 0;
    color: #cbd5e1;
}

.dropzone-browse-btn {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.8rem;
    cursor: pointer;
}

.dropzone-hint {
    display: block;
    font-size: 0.7rem;
    color: var(--meet-text-muted);
    margin-top: 8px;
}

.upload-progress-box {
    margin-top: 10px;
    background: #0f172a;
    border-radius: 6px;
    padding: 8px;
}

.progress-bar {
    height: 4px;
    background: #334155;
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--meet-primary);
    transition: width 0.2s;
}

.shared-files-section {
    margin-top: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.shared-files-section h5 {
    margin: 0 0 8px 0;
    font-size: 0.85rem;
    color: #e2e8f0;
}

.shared-files-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.empty-files-hint {
    font-size: 0.8rem;
    color: var(--meet-text-muted);
    text-align: center;
    padding: 24px 8px;
}

.media-card {
    background: #1e293b;
    border: 1px solid var(--meet-border);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.media-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.media-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.badge-image { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.badge-audio { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.badge-video { background: rgba(99, 102, 241, 0.2); color: #818cf8; }
.badge-document { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }

.media-name {
    flex: 1;
    font-size: 0.8rem;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-card-preview {
    width: 100%;
}

.media-img-thumbnail {
    width: 100%;
    max-height: 140px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s;
}

.media-img-thumbnail:hover {
    transform: scale(1.02);
}

.media-audio-player, .media-video-player {
    width: 100%;
    border-radius: 6px;
}

/* Panel 3: Collaborative Scratchpad */
.notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.notes-header h4 {
    margin: 0;
    font-size: 0.95rem;
}

.sync-status {
    font-size: 0.7rem;
    color: var(--meet-success);
    display: block;
}

.scratchpad-editor-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.scratchpad-editor-wrapper textarea {
    flex: 1;
    width: 100%;
    background: #0f172a;
    border: 1px solid var(--meet-border);
    border-radius: 8px;
    padding: 12px;
    color: #f3f4f6;
    font-family: inherit;
    font-size: 0.85rem;
    line-height: 1.5;
    resize: none;
    box-sizing: border-box;
}

.scratchpad-editor-wrapper textarea:focus {
    outline: none;
    border-color: var(--meet-primary);
}

.scratchpad-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--meet-text-muted);
}

/* Lightbox Modal */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.lightbox-modal.hidden {
    display: none;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    background: #111827;
    border: 1px solid var(--meet-border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.lightbox-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #1f2937;
    color: #e2e8f0;
    font-size: 0.9rem;
    font-weight: 600;
}

.lightbox-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.1rem;
    cursor: pointer;
}

.lightbox-body {
    padding: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: auto;
}

.lightbox-body img {
    max-width: 80vw;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 6px;
}

/* Responsive adjustments for Tablets and Mobile */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 490;
    transition: opacity 0.25s ease;
}

.sidebar-backdrop.hidden {
    display: none;
}

.sidebar-close-btn {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #cbd5e1;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    margin-left: auto;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.sidebar-close-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

@media (max-width: 992px) {
    .meet-header {
        padding: 0 10px;
    }

    .meet-header .logo-area .main-logo span:first-child {
        display: none;
    }

    .meet-header .nav-tools {
        gap: 4px;
    }

    .meet-header .nav-tools .tool-btn {
        padding: 5px 8px;
        font-size: 0.78rem;
    }

    .badge-online {
        display: none;
    }

    .meet-main {
        flex-direction: column;
    }

    /* Video stage takes full screen */
    .video-stage-section {
        padding: 8px 8px 80px 8px;
        height: 100%;
        flex: 1;
    }

    .video-grid.single-peer {
        min-height: calc(100vh - 150px);
    }

    .video-card {
        max-height: calc(100vh - 160px);
    }

    /* Sidebar transforms into a slide-over mobile drawer */
    .sidebar-close-btn {
        display: flex;
    }

    .meet-sidebar {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 380px;
        max-width: 100vw;
        height: 100vh !important;
        background: #111827;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.7);
        z-index: 500;
        transform: translateX(100%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        border-left: 1px solid var(--meet-border);
    }

    .meet-sidebar.open {
        transform: translateX(0);
    }

    /* Floating call controls bar adapted for mobile touch */
    .call-controls-bar {
        bottom: 10px;
        padding: 6px 10px;
        gap: 6px;
        max-width: 96vw;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .call-controls-bar::-webkit-scrollbar {
        display: none;
    }

    .control-circle-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        padding: 0;
        gap: 0;
    }

    .control-circle-btn .ctrl-label {
        display: none;
    }

    .control-circle-btn .ctrl-icon {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .video-card-top-hud {
        padding: 8px;
    }

    .hud-stat-group {
        gap: 4px;
    }

    .hud-mini-stat {
        font-size: 0.65rem;
        padding: 2px 6px;
    }

    .telemetry-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .telemetry-item {
        padding: 6px 8px;
    }

    .tel-value {
        font-size: 0.75rem;
    }
}
