/* App Custom Styles */

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Data Grid Sticky Table Header & Columns */
.grid-table-container {
    position: relative;
    overflow-x: auto;
}

/* Sticky Left Columns */
.sticky-col-left {
    position: sticky;
    z-index: 10;
    background-clip: padding-box;
}

td.sticky-col-left {
    background-color: #ffffff;
}

th.sticky-col-left,
.sticky-th-corner {
    background-color: var(--theme-table-sticky-bg, #0f132e) !important;
    color: #ffffff;
    z-index: 30;
}

.sticky-col-boundary {
    box-shadow: 4px 0 8px -2px var(--theme-shadow, rgba(99, 102, 241, 0.2));
}

/* Score Input Cell (Compact: fits all 18 indicators on 1080p without horizontal scrolling) */
.score-cell-input {
    width: 32px;
    height: 32px;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background-color: #ffffff;
    transition: all 0.15s ease-in-out;
    padding: 0;
    line-height: 1;
    display: inline-block;
}

.score-cell-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.35);
    background-color: #ffffff !important;
    z-index: 5;
    transform: scale(1.08);
}

@media (min-width: 1920px) {
    .score-cell-input {
        width: 34px;
        height: 34px;
    }
}

/* Row Focus Highlight */
tr.row-focused {
    background-color: #f5f3ff !important;
}
tr.row-focused .sticky-col-left {
    background-color: #ede9fe !important;
}

/* Row Multi-Selection Highlight */
tr.row-selected {
    background-color: #f0fdf4 !important;
}
tr.row-selected .sticky-col-left {
    background-color: #dcfce7 !important;
}

/* Batch Score Button Active State */
.batch-score-btn.active {
    border-color: #6366f1 !important;
    background-color: #eef2ff !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}


/* Score Styling Classes */
.score-val-3 {
    color: #16a34a !important;
    background-color: #f0fdf4 !important;
}
.score-val-2 {
    color: #4f46e5 !important;
    background-color: #eef2ff !important;
}
.score-val-1 {
    color: #d97706 !important;
    background-color: #fffbeb !important;
}
.score-val-0 {
    color: #dc2626 !important;
    background-color: #fef2f2 !important;
}
.score-val-null {
    color: #94a3b8 !important;
    background-color: #f8fafc !important;
}

/* Badge Styles */
.badge-score-3 {
    color: #15803d;
    background-color: #dcfce7;
    border: 1px solid #bbf7d0;
}
.badge-score-2 {
    color: #4338ca;
    background-color: #e0e7ff;
    border: 1px solid #c7d2fe;
}
.badge-score-1 {
    color: #b45309;
    background-color: #fef3c7;
    border: 1px solid #fde68a;
}
.badge-score-0 {
    color: #b91c1c;
    background-color: #fee2e2;
    border: 1px solid #fecaca;
}
.badge-score-null {
    color: #64748b;
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
}

/* Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

.animate-shake {
    animation: shake 0.3s ease-in-out;
}

/* Print Friendly Styles */
@media print {
    aside, header, #toast-container, .no-print, button {
        display: none !important;
    }
    body, main {
        background: #ffffff !important;
        overflow: visible !important;
        height: auto !important;
        padding: 0 !important;
    }
    .print-portrait {
        width: 100% !important;
        page-break-after: always;
    }
    .print-landscape {
        width: 100% !important;
        page-break-after: always;
    }
    @page {
        size: A4 portrait;
        margin: 10mm;
    }
}

/* Collapsible & Mobile Sidebar Styles */
#main-sidebar {
    background-color: #ffffff !important;
    transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s ease-in-out;
}

/* Mobile Drawer Enhancements */
@media (max-width: 767.98px) {
    #main-sidebar {
        width: 18rem !important; /* 288px */
        max-width: 85vw !important;
        background-color: #ffffff !important;
        box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35) !important;
    }

    #main-sidebar .brand-header,
    #main-sidebar .user-card {
        background-color: #ffffff !important;
    }

    /* Prevent mobile horizontal page wobble */
    body {
        position: relative;
        touch-action: pan-y;
    }
}

@media (min-width: 768px) {
    /* When collapsed on tablet & desktop */
    .sidebar-is-collapsed #main-sidebar {
        width: 4.5rem !important; /* 72px */
    }

    .sidebar-is-collapsed #main-sidebar .sidebar-text {
        display: none !important;
    }

    .sidebar-is-collapsed #main-sidebar .sidebar-section-header {
        display: none !important;
    }

    .sidebar-is-collapsed #main-sidebar .sidebar-section-divider {
        display: block !important;
    }

    .sidebar-is-collapsed #main-sidebar nav a {
        justify-content: center !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    .sidebar-is-collapsed #main-sidebar .brand-header {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        justify-content: center !important;
    }

    .sidebar-is-collapsed #main-sidebar #sidebar-collapse-btn {
        display: none !important;
    }

    .sidebar-is-collapsed #main-sidebar .user-card {
        flex-direction: column !important;
        gap: 0.5rem !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        align-items: center !important;
    }

    .sidebar-is-collapsed #main-sidebar .sidebar-group-toggle {
        justify-content: center !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    .sidebar-is-collapsed #main-sidebar .sidebar-group-toggle .chevron-icon {
        display: none !important;
    }

    .sidebar-is-collapsed #main-sidebar .sidebar-submenu {
        display: none !important;
    }
}


