/* ============================================
   SELLERVOICE AUDIT — CSS
   Dashboard styles for the audit panel
   ============================================ */

/* ========================================
   TAB BAR (alternative, if used standalone)
   ======================================== */
.sva-tab-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 24px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    background: rgba(15,23,42,0.6);
    backdrop-filter: blur(24px);
}

.sva-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
    border: none;
    background: transparent;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px 8px 0 0;
}

.sva-tab:hover {
    color: #e2e8f0;
    background: rgba(255,255,255,0.03);
}

.sva-tab-active {
    color: #818cf8;
    border-bottom-color: #6366f1;
    background: rgba(99,102,241,0.08);
}

/* ========================================
   AUDIT PAGE LAYOUT
   ======================================== */
.sva-audit-page {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
}

.sva-audit-container {
    width: 100%;
    max-width: 1400px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Audit Header */
.sva-audit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ========================================
   STATS BAR
   ======================================== */
.sva-stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.sva-stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: rgba(15,23,42,0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    transition: border-color 0.2s ease, transform 0.15s ease;
}

.sva-stat-card:hover {
    border-color: rgba(255,255,255,0.12);
    transform: translateY(-1px);
}

.sva-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sva-stat-icon .material-symbols-outlined {
    font-size: 20px;
}

.sva-stat-value {
    font-size: 22px;
    font-weight: 800;
    color: #f1f5f9;
    line-height: 1;
    letter-spacing: -0.5px;
}

.sva-stat-label {
    font-size: 10px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-top: 2px;
}

/* ========================================
   FILTERS BAR
   ======================================== */
.sva-filters-bar {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 18px;
    background: rgba(15,23,42,0.4);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
}

.sva-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 140px;
}

.sva-filter-label {
    font-size: 10px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sva-filter-input {
    padding: 7px 10px;
    background: rgba(2,6,23,0.5);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 12px;
    outline: none;
    transition: border-color 0.2s ease;
}

.sva-filter-input:focus {
    border-color: rgba(99,102,241,0.5);
}

.sva-filter-input option {
    background: #0f172a;
    color: #e2e8f0;
}

.sva-refresh-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99,102,241,0.1);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 8px;
    color: #818cf8;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.sva-refresh-btn:hover {
    background: rgba(99,102,241,0.2);
    color: #a5b4fc;
}

/* ========================================
   SPLIT LAYOUT (TABLE + DETAIL)
   ======================================== */
.sva-layout-split {
    display: flex;
    gap: 16px;
    min-height: 400px;
    position: relative;
}

.sva-table-container {
    flex: 1;
    min-width: 0;
    background: rgba(15,23,42,0.4);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 14px;
    overflow: hidden;
}

/* ========================================
   TABLE
   ======================================== */
.sva-table-wrapper {
    overflow-x: auto;
}

.sva-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.sva-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: rgba(2,6,23,0.3);
    white-space: nowrap;
}

.sva-table-row {
    cursor: pointer;
    transition: background 0.15s ease;
}

.sva-table-row td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    color: #cbd5e1;
    white-space: nowrap;
}

.sva-table-row:hover {
    background: rgba(99,102,241,0.05);
}

.sva-row-active {
    background: rgba(99,102,241,0.1) !important;
    border-left: 3px solid #6366f1;
}

.sva-row-active td:first-child {
    padding-left: 13px;
}

/* Cell styles */
.sva-cell-date {
    font-weight: 600;
    color: #e2e8f0;
    font-size: 12px;
}

.sva-cell-time {
    font-size: 10px;
    color: #64748b;
    font-family: 'IBM Plex Mono', monospace;
}

.sva-cell-worker {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sva-avatar {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.sva-avatar-lg {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.sva-badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    background: rgba(99,102,241,0.15);
    color: #a5b4fc;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'IBM Plex Mono', monospace;
}

.sva-badge-corrected {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: rgba(16,185,129,0.12);
    color: #34d399;
    border: 1px solid rgba(16,185,129,0.2);
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sva-badge-original {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: rgba(100,116,139,0.12);
    color: #94a3b8;
    border: 1px solid rgba(100,116,139,0.15);
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sva-link-gladia {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(99,102,241,0.1);
    color: #818cf8;
    transition: all 0.15s ease;
}

.sva-link-gladia:hover {
    background: rgba(99,102,241,0.25);
    color: #a5b4fc;
}

/* Pagination */
.sva-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.sva-pagination-btns {
    display: flex;
    gap: 4px;
}

.sva-page-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sva-page-btn:hover:not(:disabled) {
    background: rgba(99,102,241,0.15);
    color: #a5b4fc;
    border-color: rgba(99,102,241,0.3);
}

.sva-page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ========================================
   DETAIL PANEL (slide-over)
   ======================================== */
.sva-detail-panel {
    width: 420px;
    min-width: 420px;
    max-height: 100%;
    overflow-y: auto;
    background: rgba(15,23,42,0.7);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1),
                opacity 0.3s ease,
                width 0.3s ease,
                min-width 0.3s ease;
}

.sva-panel-hidden {
    transform: translateX(20px);
    opacity: 0;
    width: 0;
    min-width: 0;
    overflow: hidden;
    border: none;
    padding: 0;
}

.sva-panel-visible {
    transform: translateX(0);
    opacity: 1;
}

.sva-detail-inner {
    padding: 0;
}

.sva-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    position: sticky;
    top: 0;
    background: rgba(15,23,42,0.9);
    backdrop-filter: blur(12px);
    z-index: 5;
    border-radius: 14px 14px 0 0;
}

.sva-detail-section {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.sva-detail-section:last-child {
    border-bottom: none;
}

.sva-detail-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
}

/* Metadata grid */
.sva-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.sva-meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    background: rgba(2,6,23,0.4);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 8px;
}

.sva-meta-label {
    font-size: 9px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sva-meta-value {
    font-size: 12px;
    color: #e2e8f0;
    word-break: break-all;
}

/* Gladia link */
.sva-gladia-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(99,102,241,0.1);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 8px;
    color: #818cf8;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.sva-gladia-link:hover {
    background: rgba(99,102,241,0.2);
    color: #a5b4fc;
}

/* Transcript boxes */
.sva-transcript-box {
    background: rgba(2,6,23,0.5);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 14px;
    max-height: 220px;
    overflow-y: auto;
}

.sva-transcript-corrected {
    border-color: rgba(16,185,129,0.15);
    background: rgba(16,185,129,0.03);
}

/* Diff box */
.sva-diff-box {
    background: rgba(2,6,23,0.5);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 14px;
    max-height: 200px;
    overflow-y: auto;
    font-size: 12px;
    line-height: 1.8;
    word-wrap: break-word;
}

.sva-diff-same {
    color: #94a3b8;
}

.sva-diff-removed {
    color: #fb7185;
    background: rgba(244,63,94,0.12);
    text-decoration: line-through;
    padding: 1px 3px;
    border-radius: 3px;
}

.sva-diff-added {
    color: #34d399;
    background: rgba(16,185,129,0.12);
    padding: 1px 3px;
    border-radius: 3px;
}

/* Utterances */
.sva-utterances-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.sva-utterance-item {
    padding: 8px 10px;
    background: rgba(2,6,23,0.3);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 8px;
}

.sva-utt-index {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    background: rgba(99,102,241,0.15);
    color: #818cf8;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    font-family: 'IBM Plex Mono', monospace;
}

/* ========================================
   SCROLLBAR for audit panels
   ======================================== */
.sva-detail-panel::-webkit-scrollbar,
.sva-transcript-box::-webkit-scrollbar,
.sva-diff-box::-webkit-scrollbar,
.sva-utterances-list::-webkit-scrollbar,
.sva-audit-page::-webkit-scrollbar {
    width: 4px;
}

.sva-detail-panel::-webkit-scrollbar-track,
.sva-transcript-box::-webkit-scrollbar-track,
.sva-diff-box::-webkit-scrollbar-track,
.sva-utterances-list::-webkit-scrollbar-track,
.sva-audit-page::-webkit-scrollbar-track {
    background: transparent;
}

.sva-detail-panel::-webkit-scrollbar-thumb,
.sva-transcript-box::-webkit-scrollbar-thumb,
.sva-diff-box::-webkit-scrollbar-thumb,
.sva-utterances-list::-webkit-scrollbar-thumb,
.sva-audit-page::-webkit-scrollbar-thumb {
    background: rgba(71,85,105,0.5);
    border-radius: 4px;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
    .sva-layout-split {
        flex-direction: column;
    }

    .sva-detail-panel {
        width: 100%;
        min-width: 100%;
        max-height: 500px;
    }

    .sva-panel-hidden {
        width: 0;
        min-width: 0;
        max-height: 0;
    }
}

@media (max-width: 768px) {
    .sva-stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }

    .sva-audit-container {
        padding: 12px;
    }

    .sva-filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .sva-filter-group {
        min-width: unset;
    }

    .sva-meta-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes sva-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.sva-stat-card {
    animation: sva-fade-in 0.4s ease backwards;
}

.sva-stat-card:nth-child(2) { animation-delay: 0.05s; }
.sva-stat-card:nth-child(3) { animation-delay: 0.1s; }
.sva-stat-card:nth-child(4) { animation-delay: 0.15s; }
.sva-stat-card:nth-child(5) { animation-delay: 0.2s; }
