﻿/* * SAMVA DESIGN SYSTEM v3.0 - TOTAL INTEGRATION
 * Consolidación de: Ficha de Llamada, Bitácora Técnica, Sistema de Comentarios y Editor Avanzado.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* --- TOKENS DE DISEÑO --- */
:root {
    --sv-radius-xl: 20px;
    --sv-radius-lg: 14px;
    --sv-radius-md: 10px;
    --sv-radius-sm: 6px;
    --sv-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --sv-shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
    --sv-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --sv-font: 'Inter', 'Segoe UI', Roboto, sans-serif;
    /* Business Colors (Semántica operativa constante) */
    --sv-color-interno: #d97706; /* Amber */
    --sv-color-pruebas: #9333ea; /* Purple */
    --sv-color-solucion: #16a34a; /* Green */
    --sv-color-danger: #ef4444; /* Red */
    --sv-color-warning: #f59e0b;
}

/* --- RESET & CORE --- */
.sv-modern, .samva-modern-container {
    font-family: var(--sv-font);
    color: var(--sv-text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    max-width: 1200px;
    margin: 0 auto;
}

    .sv-modern *, .samva-modern-container * {
        box-sizing: border-box;
    }

/* --- LAYOUT SISTEMA --- */
.sv-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.sv-col-side {
    flex: 0 0 33.333%;
    max-width: 33.333%;
    padding: 0 15px;
}

.sv-col-main {
    flex: 0 0 66.666%;
    max-width: 66.666%;
    padding: 0 15px;
}

@media (max-width: 992px) {
    .sv-col-side, .sv-col-main {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* --- COMPONENTES DE SUPERFICIE --- */
.sv-card {
    background: var(--sv-white);
    border-radius: var(--sv-radius-xl);
    padding: 24px;
    border: 1px solid var(--sv-border);
    box-shadow: var(--sv-shadow-md);
    margin-bottom: 24px;
    position: relative;
}

.sv-sub-block {
    background: var(--sv-bg-soft);
    border: 1px solid var(--sv-border);
    border-radius: var(--sv-radius-lg);
    padding: 12px 16px;
    margin-bottom: 12px;
}

/* --- BOTONES Y ACCIONES --- */
.sv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--sv-radius-md);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none !important;
}

.sv-btn-primary {
    background: var(--sv-primary);
    color: white !important;
}

.sv-btn-accent {
    background: var(--sv-accent);
    color: white !important;
}

.sv-btn-ghost {
    background: transparent;
    color: var(--sv-text-muted);
    border: 1px solid var(--sv-border);
}

/* Botones de Audio Player */
.sv-btn-play {
    width: 48px;
    height: 48px;
    background: var(--sv-primary);
    color: white !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px var(--sv-primary-alpha);
}

.sv-btn-pause {
    width: 48px;
    height: 48px;
    background: var(--sv-color-warning);
    color: white !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

/* --- EDITOR UI (Reemplaza custom-editor-card y derivados) --- */
.sv-editor-card {
    background: var(--sv-white);
    border: 2px solid var(--sv-border);
    border-radius: var(--sv-radius-lg);
    box-shadow: var(--sv-shadow-md);
    margin-bottom: 40px;
    position: relative;
    transition: border-color 0.3s ease;
}

/* Modos del Editor */
.sv-editor-mode-interno {
    border-color: var(--sv-color-interno) !important;
}

.sv-editor-mode-cliente {
    border-color: var(--sv-primary) !important;
}

.sv-editor-mode-solucion {
    border-color: var(--sv-color-solucion) !important;
}

.sv-editor-mode-pruebas {
    border-color: var(--sv-color-pruebas) !important;
}

/* Cabecera del Editor (custom-type-selector-container) */
.sv-editor-header {
    background: var(--sv-bg-soft);
    padding: 10px 16px;
    border-bottom: 1px solid var(--sv-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: var(--sv-radius-lg) var(--sv-radius-lg) 0 0;
}

/* Pill Group Selector */
.sv-pill-group {
    display: flex;
    background: #eef2f6;
    padding: 4px;
    border-radius: 12px;
    gap: 2px;
}

.sv-btn-pill {
    border: none;
    background: transparent;
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 9px;
    cursor: pointer;
    color: var(--sv-text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

    .sv-btn-pill.active {
        background: var(--sv-white);
        color: var(--sv-text-main);
        box-shadow: var(--sv-shadow-sm);
    }

    .sv-btn-pill.active-interno {
        color: var(--sv-color-interno);
        background: var(--sv-white);
    }

    .sv-btn-pill.active-cliente {
        color: var(--sv-primary);
        background: var(--sv-white);
    }

/* Reply Preview */
.sv-reply-preview {
    margin: 12px 20px;
    background: var(--sv-bg-soft);
    border-left: 3px solid var(--sv-text-light);
    padding: 8px 12px;
    border-radius: 4px;
    position: relative;
}

/* --- HISTORIAL Y TIMELINE (Bitácora + Comentarios) --- */
.sv-timeline {
    position: relative;
    display: flex;
    flex-direction: column;
    margin-top: 15px;
}

    .sv-timeline::before {
        content: '';
        position: absolute;
        left: 15px;
        top: 0;
        bottom: 0;
        width: 2px;
        background: var(--sv-border);
    }

.sv-ev-item {
    position: relative;
    padding-left: 45px;
    margin-bottom: 20px;
}

.sv-ev-anchor {
    position: absolute;
    left: 4px;
    top: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border: 2px solid white;
    z-index: 2;
    font-size: 10px;
}

/* Hilos de conversación (Thread lines) */
.sv-comment-thread {
    margin-left: 64px;
    position: relative;
}

    .sv-comment-thread::before {
        content: '';
        position: absolute;
        left: -41px;
        top: -30px;
        width: 24px;
        height: 52px;
        border-left: 2px solid var(--sv-border);
        border-bottom: 2px solid var(--sv-border);
        border-bottom-left-radius: 12px;
    }

/* --- TOOLBAR FLOTANTE (gc-toolbar) --- */
.sv-toolbar-container {
    position: absolute;
    top: 15px;
    right: 18px;
    z-index: 100;
    opacity: 0;
    transform: translateY(4px);
    transition: all 0.15s ease-out;
    pointer-events: none;
}

.sv-card:hover .sv-toolbar-container {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.sv-toolbar {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid var(--sv-border);
    border-radius: 24px;
    box-shadow: var(--sv-shadow-md);
    padding: 2px 4px;
    gap: 2px;
}

/* --- DATOS TÉCNICOS --- */
.sv-tech-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--sv-bg-soft);
}

.sv-tech-label {
    font-size: 10px;
    font-weight: 900;
    color: var(--sv-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sv-tech-value {
    font-size: 11px;
    font-weight: 800;
    color: var(--sv-text-main);
    text-align: right;
}

/* --- FORMULARIOS (Controladores ASP.NET) --- */
.sv-form-label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: var(--sv-text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sv-form-control, .sv-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 13px;
    font-family: inherit;
    color: var(--sv-text-main);
    background-color: var(--sv-bg-soft);
    border: 1px solid var(--sv-border);
    border-radius: 12px;
    transition: all 0.2s;
}

    .sv-form-control:focus, .sv-input:focus {
        outline: none;
        border-color: var(--sv-primary);
        background-color: white;
        box-shadow: 0 0 0 3px var(--sv-primary-alpha);
    }

/* --- ANIMACIONES --- */
@keyframes sv-pulse-red {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.sv-unread-dot {
    width: 10px;
    height: 10px;
    background: var(--sv-primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--sv-primary);
    animation: sv-pulse-red 2s infinite;
}

/* --- CONTENIDO DINÁMICO --- */
.sv-content-wrap {
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

    .sv-content-wrap img {
        max-width: 100%;
        max-height: 350px;
        border-radius: 8px;
        object-fit: contain;
        margin: 10px 0;
    }

/* Select2/Syncfusion Overrides */
.e-rte-elements.e-popup {
    z-index: 100000 !important;
    border-radius: 12px !important;
    box-shadow: var(--sv-shadow-lg) !important;
}
