/* DealGram - Custom Scrollbar Styles */

/* ===== WEBKIT BROWSERS (Chrome, Safari, Edge) ===== */

/* Light Mode Scrollbars */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #cbd5e1, #94a3b8);
    border-radius: 6px;
    border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #94a3b8, #64748b);
}

::-webkit-scrollbar-thumb:active {
    background: linear-gradient(180deg, #64748b, #475569);
}

/* Corner where scrollbars meet */
::-webkit-scrollbar-corner {
    background: var(--bg-secondary);
}

/* ===== DARK MODE SCROLLBARS ===== */
.dark-mode ::-webkit-scrollbar-track {
    background: #1e293b;
}

.dark-mode ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #475569, #334155);
    border: 2px solid #1e293b;
}

.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #64748b, #475569);
}

.dark-mode ::-webkit-scrollbar-thumb:active {
    background: linear-gradient(180deg, #94a3b8, #64748b);
}

.dark-mode ::-webkit-scrollbar-corner {
    background: #1e293b;
}

/* ===== SPECIAL SCROLLBARS ===== */

/* Sidebar Scrollbar */
.sidebar-elegant::-webkit-scrollbar {
    width: 8px;
}

.sidebar-elegant::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-elegant::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 4px;
    border: none;
}

.sidebar-elegant::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}

.dark-mode .sidebar-elegant::-webkit-scrollbar-thumb {
    background: rgba(71, 85, 105, 0.5);
}

.dark-mode .sidebar-elegant::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.7);
}

/* Notifications Panel Scrollbar */
.notifications-list::-webkit-scrollbar {
    width: 6px;
}

.notifications-list::-webkit-scrollbar-track {
    background: transparent;
}

.notifications-list::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 3px;
}

.notifications-list::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}

.dark-mode .notifications-list::-webkit-scrollbar-thumb {
    background: rgba(71, 85, 105, 0.5);
}

/* Turquoise Accent Scrollbar for Special Areas */
.turquoise-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #14b8a6, #06b6d4);
    border: 2px solid var(--bg-secondary);
}

.turquoise-scroll::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #0d9488, #0891b2);
}

/* ===== FIREFOX SCROLLBARS ===== */

/* Firefox uses different properties */
* {
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 var(--bg-secondary);
}

.dark-mode * {
    scrollbar-color: #475569 #1e293b;
}

.sidebar-elegant {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
}

.dark-mode .sidebar-elegant {
    scrollbar-color: rgba(71, 85, 105, 0.5) transparent;
}

.notifications-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
}

.dark-mode .notifications-list {
    scrollbar-color: rgba(71, 85, 105, 0.5) transparent;
}

/* ===== SCROLLBAR ANIMATIONS ===== */

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Hide scrollbar when not needed */
.auto-hide-scroll {
    overflow: auto;
}

.auto-hide-scroll::-webkit-scrollbar {
    width: 8px;
    opacity: 0;
    transition: opacity 0.3s;
}

.auto-hide-scroll:hover::-webkit-scrollbar {
    opacity: 1;
}

/* Thin scrollbar variant */
.thin-scroll::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.thin-scroll::-webkit-scrollbar-thumb {
    border: none;
}

/* ===== MOBILE ADJUSTMENTS ===== */

@media (max-width: 768px) {
    /* Smaller scrollbars on mobile */
    ::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }
    
    ::-webkit-scrollbar-thumb {
        border-width: 1px;
    }
    
    /* Hide scrollbars on touch devices by default */
    @media (hover: none) {
        ::-webkit-scrollbar {
            width: 0;
            height: 0;
        }
        
        * {
            scrollbar-width: none;
        }
        
        /* Show when scrolling */
        .scrolling::-webkit-scrollbar {
            width: 4px;
            height: 4px;
        }
    }
}

/* ===== CUSTOM SCROLLBAR FOR SPECIFIC ELEMENTS ===== */

/* Tables with horizontal scroll */
.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #14b8a6, #06b6d4);
    border-radius: 4px;
    border: none;
}

/* Code blocks */
pre::-webkit-scrollbar,
code::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}

pre::-webkit-scrollbar-thumb,
code::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.5);
    border-radius: 3px;
}

/* Modal scrollbars */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.4);
    border-radius: 4px;
}

.dark-mode .modal-body::-webkit-scrollbar-thumb {
    background: rgba(71, 85, 105, 0.6);
}

/* ===== OVERFLOW INDICATORS ===== */

/* Gradient fade indicators for scrollable content */
.scroll-fade-top,
.scroll-fade-bottom {
    position: relative;
}

.scroll-fade-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 12px; /* Account for scrollbar */
    height: 30px;
    background: linear-gradient(180deg, var(--bg-card), transparent);
    pointer-events: none;
    z-index: 1;
}

.scroll-fade-bottom::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 12px; /* Account for scrollbar */
    height: 30px;
    background: linear-gradient(0deg, var(--bg-card), transparent);
    pointer-events: none;
    z-index: 1;
}