:root {
    --vv-purple: #7C3AED;
    --vv-purple-dark: #5B21B6;
    --vv-purple-light: #A78BFA;
    --vv-gradient: linear-gradient(135deg, #7C3AED 0%, #4F46E5 100%);
    --vv-sidebar-bg: #1E1030;
    --vv-sidebar-hover: rgba(124, 58, 237, 0.25);
    --vv-sidebar-active: rgba(124, 58, 237, 0.5);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f3ff;
    color: #1a1a2e;
}

/* Navbar */
.navbar.vv-navbar {
    background: rgba(10, 14, 26, 1) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

/* Sidebar */
.sidebar {
    background: var(--vv-sidebar-bg) !important;
    min-height: calc(100vh - 56px);
}

.sidebar .nav-link,
.vv-offcanvas .nav-link {
    padding: .45rem .85rem;
    font-size: .875rem;
    border-radius: 8px;
    transition: background .15s, color .15s;
    color: rgba(255, 255, 255, 0.7) !important;
}

.sidebar .nav-link:hover,
.vv-offcanvas .nav-link:hover {
    background: var(--vv-sidebar-hover);
    color: #fff !important;
}

.sidebar .nav-link.active,
.vv-offcanvas .nav-link.active {
    background: var(--vv-sidebar-active) !important;
    color: #fff !important;
    font-weight: 600;
    border-left: 3px solid var(--vv-purple-light);
}

/* Cards */
.card {
    border-radius: 12px;
    border: 1px solid rgba(124, 58, 237, 0.08);
    box-shadow: 0 1px 8px rgba(124, 58, 237, 0.06) !important;
}

.card-header {
    border-bottom: 1px solid rgba(124, 58, 237, 0.1);
    padding: .8rem 1.25rem;
    border-radius: 12px 12px 0 0 !important;
    background: #fff !important;
    font-weight: 600;
    color: #1a1a2e;
}

/* Stat cards */
.stat-card {
    background: linear-gradient(135deg, #fff 0%, #faf5ff 100%);
    border-left: 4px solid var(--vv-purple) !important;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--vv-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

/* Buttons */
.btn-primary {
    background: var(--vv-gradient) !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #6D28D9 0%, #4338CA 100%) !important;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

.btn-outline-primary {
    border-color: var(--vv-purple) !important;
    color: var(--vv-purple) !important;
}

.btn-outline-primary:hover {
    background: var(--vv-purple) !important;
    color: #fff !important;
}

/* Tables */
.table th {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6b7280;
    font-weight: 600;
    background: #faf5ff;
}

.table td { vertical-align: middle; }

.table-light th { background: #f3f0ff !important; }

/* Badges */
.badge { font-weight: 500; font-size: .75rem; }

.badge-vv-active {
    background: var(--vv-purple) !important;
    color: #fff !important;
}

/* Forms */
.form-control:focus, .form-select:focus {
    border-color: var(--vv-purple-light);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

/* Pre / transcript */
pre {
    background: #f9f5ff;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(124, 58, 237, 0.15);
    font-size: .85rem;
}

/* Login page */
.vv-login-wrapper {
    background: linear-gradient(135deg, #1E1030 0%, #2D1B69 50%, #1E1030 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vv-login-card {
    background: #0a0e1a;
    border: 1px solid rgba(124, 58, 237, 0.25);
    border-radius: 16px;
    padding: 2.5rem;
    width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.vv-login-card h3 {
    color: #fff !important;
}

.vv-login-card .text-muted {
    color: rgba(255,255,255,0.45) !important;
}

.vv-login-card .form-label {
    color: var(--vv-purple-light);
    font-weight: 600;
}

.vv-login-card .form-control {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(124, 58, 237, 0.3);
    color: #fff;
    border-radius: 8px;
}

.vv-login-card .form-control:focus {
    background: rgba(255,255,255,0.09);
    border-color: var(--vv-purple-light);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
    color: #fff;
}

.vv-login-card .form-control::placeholder {
    color: rgba(255,255,255,0.25);
}

.vv-login-card .alert-danger {
    background: rgba(220, 38, 38, 0.15);
    border: 1px solid rgba(220, 38, 38, 0.3);
    color: #fca5a5;
}

.vv-logo-icon {
    width: 56px;
    height: 56px;
    background: var(--vv-gradient);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: #fff;
    margin: 0 auto 1rem;
}

/* ── Waveform logo animation (from website hero) ─────────────────────────── */
@keyframes anim-pulse {
    0%, 100% { transform: scaleY(1); }
    30%       { transform: scaleY(1.08); }
    50%       { transform: scaleY(.96); }
    70%       { transform: scaleY(1.05); }
}

@keyframes anim-ripple {
    from { transform: scale(.85); opacity: .55; }
    to   { transform: scale(1.45); opacity: 0; }
}

@keyframes anim-glow {
    0%, 100% { transform: scale(1);    opacity: .22; }
    50%       { transform: scale(1.18); opacity: .38; }
}

.vv-logo-animated {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.vv-logo-animated svg { position: relative; z-index: 2; }

.vv-logo-animated .bar { transform-box: fill-box; transform-origin: center; animation: anim-pulse 2.8s infinite ease-in-out; }
.vv-logo-animated .b2 { animation-delay: .15s; }
.vv-logo-animated .b3 { animation-delay: .3s; }
.vv-logo-animated .b4 { animation-delay: .45s; }
.vv-logo-animated .b5 { animation-delay: .6s; }

.vv-logo-animated .ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 1px solid rgba(140,80,255,.35);
    border-radius: 50%;
    animation: anim-ripple 4s infinite;
    pointer-events: none;
}
.vv-logo-animated .ring2 { animation-delay: 1.3s; }
.vv-logo-animated .ring3 { animation-delay: 2.6s; }

/* ── Mobile / responsive ─────────────────────────────────────────────────── */
.vv-main {
    min-width: 0; /* prevent flexbox child from overflowing */
}

.vv-offcanvas {
    background: var(--vv-sidebar-bg) !important;
    width: 220px !important;
}

/* Tables scroll horizontally on small screens instead of breaking layout */
.card .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 991.98px) {
    .vv-main {
        padding: 1rem !important;
    }

    /* Wrap any card-body containing a table in overflow scroll */
    .card > .card-body,
    .card > div:not(.card-header) {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Stat cards: 2 columns on small screens */
    .stat-card {
        min-width: 0;
    }

    /* Filter rows: allow wrapping */
    .card-body .row {
        flex-wrap: wrap;
    }

    /* Pagination: stack on very small screens */
    .d-flex.align-items-center.justify-content-between {
        flex-wrap: wrap;
        gap: .5rem;
    }
}

/* ── Modals — dark theme matching login card ─────────────────────────────── */
.modal-content {
    background: #0a0e1a;
    border: 1px solid rgba(124, 58, 237, 0.25);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    color: #fff;
}

.modal-header {
    background: #0a0e1a !important;
    border-bottom: 1px solid rgba(124, 58, 237, 0.2) !important;
    border-radius: 16px 16px 0 0 !important;
    padding: 1.25rem 1.5rem;
}

.modal-title {
    color: #fff;
    font-weight: 700;
}

.modal-body {
    background: #0a0e1a !important;
    color: rgba(255, 255, 255, 0.65);
    padding: 1.25rem 1.5rem;
}

.modal-body .form-label {
    color: var(--vv-purple-light);
    font-weight: 600;
}

.modal-body .form-control,
.modal-body .form-select {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(124, 58, 237, 0.3);
    color: #fff;
    border-radius: 8px;
}

.modal-body .form-control:focus,
.modal-body .form-select:focus {
    background: rgba(255, 255, 255, 0.09);
    border-color: var(--vv-purple-light);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
    color: #fff;
}

.modal-body .form-control::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.modal-body .form-select option {
    background: #1a1035;
    color: #fff;
}

.modal-body .text-muted {
    color: rgba(255, 255, 255, 0.5) !important;
}

.modal-footer {
    background: #0a0e1a !important;
    border-top: 1px solid rgba(124, 58, 237, 0.2) !important;
    border-radius: 0 0 16px 16px !important;
    padding: 1rem 1.5rem;
}

.modal .btn-close {
    filter: invert(1) opacity(0.7);
}

.modal .btn-close:hover {
    filter: invert(1) opacity(1);
}

.modal .btn-outline-secondary,
.modal .btn-outline-warning {
    border-color: var(--vv-purple) !important;
    color: var(--vv-purple-light) !important;
    background: transparent !important;
}

.modal .btn-outline-secondary:hover,
.modal .btn-outline-warning:hover {
    background: rgba(124, 58, 237, 0.15) !important;
    color: #fff !important;
}

/* Overlay spinner used during form submissions */
.vv-spinner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 26, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    flex-direction: column;
    gap: 1.25rem;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    backdrop-filter: blur(4px);
}

.vv-spinner-overlay.active { display: flex; }
