/* ==============================================================================
   Electra Videoperitaciones - Consola Pericial de Escritorio
   ============================================================================== */

:root {
    --perito-bg: #0f141c;
    --perito-card-bg: #182230;
    --perito-card-header: #1f2b3e;
    --perito-border: #2c3b52;
    --perito-primary: #0d6efd;
    --perito-danger: #dc3545;
    --perito-success: #198754;
    --perito-warning: #ffc107;
}

body.perito-body {
    background-color: var(--perito-bg);
    color: #e2e8f0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Barra Superior */
.perito-navbar {
    background: var(--perito-card-bg);
    border-bottom: 1px solid var(--perito-border);
    padding: 10px 20px;
}

/* Área de Video Principal */
.video-stage-card {
    background: #000;
    border: 1px solid var(--perito-border);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    aspect-ratio: 16 / 9;
    max-height: 68vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#remoteVideo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #05070a;
    cursor: default;
}

#remoteVideo.laser-active {
    cursor: crosshair;
}

/* Overlays en el Video */
.video-badge-overlay {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

.rec-indicator {
    background: rgba(220, 53, 69, 0.9);
    color: white;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: blinkRec 1.5s infinite;
}

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

.timer-indicator {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-family: monospace;
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 20px;
}

/* Barra de Herramientas de Control Remoto */
.perito-toolbar {
    background: var(--perito-card-bg);
    border: 1px solid var(--perito-border);
    border-radius: 14px;
    padding: 12px 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: center;
    margin-top: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.tool-btn {
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid var(--perito-border);
    background: rgba(255, 255, 255, 0.05);
    color: #f8f9fa;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.tool-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--perito-primary);
    color: #fff;
    transform: translateY(-1px);
}

.tool-btn.active {
    background: var(--perito-primary);
    border-color: var(--perito-primary);
    color: white;
    box-shadow: 0 0 12px rgba(13, 110, 253, 0.5);
}

.tool-btn-danger {
    background: rgba(220, 53, 69, 0.15);
    border-color: var(--perito-danger);
    color: #ff6b6b;
}

.tool-btn-danger:hover {
    background: var(--perito-danger);
    color: white;
}

/* Paneles Laterales (Evidencias y Chat) */
.side-panel-card {
    background: var(--perito-card-bg);
    border: 1px solid var(--perito-border);
    border-radius: 16px;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.side-panel-header {
    background: var(--perito-card-header);
    border-bottom: 1px solid var(--perito-border);
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.95rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    padding: 14px;
    overflow-y: auto;
    max-height: 250px;
}

.gallery-item-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--perito-border);
    aspect-ratio: 1;
    background: #000;
    cursor: pointer;
    transition: transform 0.2s;
}

.gallery-item-card:hover {
    transform: scale(1.04);
    border-color: var(--perito-primary);
}

.gallery-item-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Chat pericial */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 220px;
}

.chat-messages {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    font-size: 0.85rem;
}

.chat-bubble {
    padding: 8px 12px;
    border-radius: 12px;
    margin-bottom: 8px;
    max-width: 85%;
    word-break: break-word;
}

.chat-bubble.perito {
    background: var(--perito-primary);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 2px;
}

.chat-bubble.asegurado {
    background: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
    margin-right: auto;
    border-bottom-left-radius: 2px;
}

.chat-input-row {
    padding: 10px;
    border-top: 1px solid var(--perito-border);
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
}
