/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { 
    background: linear-gradient(180deg, #6366f1, #a855f7);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #4f46e5, #9333ea); }

/* ===== GLASSMORPHISM EFFECT ===== */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.dark .glass {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== GRADIENT ANIMATION ===== */
@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.gradient-animated {
    background: linear-gradient(-45deg, #6366f1, #a855f7, #ec4899, #f59e0b);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

/* ===== SHINE EFFECT ===== */
@keyframes shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.shine {
    position: relative;
    overflow: hidden;
}

.shine::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shine 3s infinite;
}

/* ===== CARD HOVER EFFECT ===== */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.15);
}

/* ===== TABLE ROW HOVER ===== */
.table-row-hover {
    transition: all 0.2s ease;
}

.table-row-hover:hover {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.05), transparent);
}

/* ===== SKELETON LOADING ===== */
@keyframes skeletonLoading {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.skeleton {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 37%, #e2e8f0 63%);
    background-size: 200px 100%;
    animation: skeletonLoading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.dark .skeleton {
    background: linear-gradient(90deg, #334155 25%, #475569 37%, #334155 63%);
    background-size: 200px 100%;
}

/* ===== NAV ITEM ACTIVE ===== */
.nav-item.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
    color: #4f46e5;
    font-weight: 600;
}

.dark .nav-item.active {
    color: #a5b4fc;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 25%; bottom: 25%;
    width: 4px;
    background: linear-gradient(180deg, #6366f1, #a855f7);
    border-radius: 0 4px 4px 0;
}

.nav-item { position: relative; }

/* ===== TOAST ANIMATIONS ===== */
.toast-enter { animation: slideDown 0.3s ease-out; }
.toast-exit { animation: slideUp 0.3s ease-out reverse; }

/* ===== BADGE PULSE ===== */
@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7); }
    50% { box-shadow: 0 0 0 8px rgba(99, 102, 241, 0); }
}

.badge-pulse { animation: badgePulse 2s infinite; }

/* ===== RIPPLE EFFECT ===== */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px; height: 300px;
}

/* ===== NUMBER GRID EFFECT ===== */
.number-grid-item {
    transition: all 0.2s ease;
}

.number-grid-item:hover {
    transform: scale(1.02);
    z-index: 10;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 768px) {
    .sidebar-open { transform: translateX(0); }
}

/* ===== PRINT STYLES ===== */
@media print {
    #sidebar, header, #menuToggle { display: none !important; }
    main { padding: 0 !important; }
}

/* ===== FOCUS VISIBLE ===== */
*:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* ===== LOADING DOTS ===== */
@keyframes loadingDots {
    0%, 20% { opacity: 0; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-4px); }
    100% { opacity: 0; transform: translateY(0); }
}

.loading-dots span {
    display: inline-block;
    animation: loadingDots 1.4s infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }