/* DASHBOARD ENHANCEMENTS FOR PERFECT DARK THEME */

/* ===== ENHANCED DASHBOARD ANIMATIONS ===== */
@keyframes dashboardSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes statCardPulse {
    0%, 100% {
        box-shadow: var(--shadow-lg), var(--shadow-glow);
        transform: scale(1);
    }
    50% {
        box-shadow: var(--shadow-xl), 0 0 40px rgba(0, 212, 255, 0.6);
        transform: scale(1.02);
    }
}

@keyframes iconSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes glowPulse {
    0%, 100% { 
        text-shadow: 0 0 5px var(--accent-primary);
    }
    50% { 
        text-shadow: 0 0 20px var(--accent-primary), 0 0 30px var(--accent-primary);
    }
}

/* ===== ENHANCED STAT CARDS ===== */
.stat-card {
    animation: dashboardSlideIn 0.6s ease-out;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.1), transparent);
    transition: all 0.8s ease;
}

.stat-card:hover::after {
    left: 100%;
}

.stat-card:hover {
    animation: statCardPulse 2s ease-in-out infinite;
}

.stat-card .stat-icon {
    transition: all 0.3s ease;
}

.stat-card:hover .stat-icon {
    animation: iconSpin 2s linear infinite;
}

/* ===== ENHANCED NAVIGATION ===== */
.nav-tab, .sidebar-item, .nav-item {
    position: relative;
    overflow: hidden;
}

.nav-tab::after, .sidebar-item::after, .nav-item::after {
    content: '';
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: all 0.6s ease;
}

.nav-tab:hover::after, .sidebar-item:hover::after, .nav-item:hover::after {
    right: 100%;
}

/* ===== ENHANCED BUTTONS ===== */
.btn, .button, button {
    position: relative;
    overflow: hidden;
}

.btn::after, .button::after, button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.6s ease;
}

.btn:active::after, .button:active::after, button:active::after {
    width: 300px;
    height: 300px;
}

/* ===== ENHANCED FORMS ===== */
.input-group {
    position: relative;
}

.input-group input:focus + .input-icon {
    color: var(--accent-primary) !important;
    animation: glowPulse 2s ease-in-out infinite;
}

/* ===== ENHANCED MODALS ===== */
.modal {
    animation: dashboardSlideIn 0.4s ease-out;
}

.modal-content {
    position: relative;
    overflow: hidden;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-primary);
    animation: glowPulse 3s ease-in-out infinite;
}

/* ===== ENHANCED TABLES ===== */
.table tr {
    transition: all 0.3s ease;
}

.table tr:hover {
    background: rgba(0, 212, 255, 0.1) !important;
    transform: translateX(5px);
}

/* ===== ENHANCED CARDS ===== */
.feature-card, .card {
    position: relative;
    overflow: hidden;
}

.feature-card::before, .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(0, 212, 255, 0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.feature-card:hover::before, .card:hover::before {
    opacity: 1;
}

/* ===== ENHANCED LOADING STATES ===== */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.3), transparent);
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ===== ENHANCED TOOLTIPS ===== */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    background: var(--gradient-card);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    border: 1px solid rgba(0, 212, 255, 0.3);
    box-shadow: var(--shadow-lg);
}

[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-10px);
}

/* ===== ENHANCED PROGRESS BARS ===== */
.progress-bar {
    background: rgba(26, 26, 46, 0.8);
    border-radius: var(--radius-xl);
    overflow: hidden;
    position: relative;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-xl);
    transition: width 0.6s ease;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.progress-bar[data-progress="0"]::before { width: 0%; }
.progress-bar[data-progress="25"]::before { width: 25%; }
.progress-bar[data-progress="50"]::before { width: 50%; }
.progress-bar[data-progress="75"]::before { width: 75%; }
.progress-bar[data-progress="100"]::before { width: 100%; }

/* ===== ENHANCED NOTIFICATIONS ===== */
.notification {
    background: var(--gradient-card);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-lg);
    animation: dashboardSlideIn 0.4s ease-out;
    position: relative;
    overflow: hidden;
}

.notification::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-primary);
}

.notification.success::before {
    background: var(--gradient-success);
}

.notification.warning::before {
    background: linear-gradient(135deg, #ffd43b 0%, #ff6b6b 100%);
}

.notification.error::before {
    background: linear-gradient(135deg, #ff4757 0%, #ff6b6b 100%);
}

/* ===== ENHANCED SEARCH ===== */
.search-container {
    position: relative;
}

.search-container input {
    padding-left: 3rem !important;
}

.search-container .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent-primary);
    transition: all 0.3s ease;
}

.search-container input:focus + .search-icon {
    animation: glowPulse 2s ease-in-out infinite;
}

/* ===== ENHANCED DROPDOWNS ===== */
.dropdown {
    position: relative;
}

.dropdown-menu {
    background: var(--gradient-card);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    animation: dashboardSlideIn 0.3s ease-out;
}

.dropdown-item {
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    border-radius: var(--radius-sm);
    margin: 0.25rem;
}

.dropdown-item:hover {
    background: rgba(0, 212, 255, 0.1);
    color: var(--text-primary);
    transform: translateX(5px);
}

/* ===== ENHANCED TABS ===== */
.tab-content {
    animation: dashboardSlideIn 0.4s ease-out;
}

.tab-pane {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.tab-pane.active {
    opacity: 1;
    transform: translateY(0);
}

/* ===== ENHANCED CHARTS ===== */
.chart-container {
    background: var(--gradient-card) !important;
    border: 1px solid rgba(0, 212, 255, 0.2) !important;
    border-radius: var(--radius-lg) !important;
    padding: 2rem !important;
    box-shadow: var(--shadow-lg) !important;
    position: relative;
    overflow: hidden;
}

.chart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-primary);
}

/* ===== RESPONSIVE ENHANCEMENTS ===== */
@media (max-width: 768px) {
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .nav-tab, .sidebar-item, .nav-item {
        margin: 0.25rem;
        padding: 0.75rem 1rem;
    }
    
    .dashboard-section {
        margin: 0.5rem;
        padding: 1.5rem;
    }
}

/* ===== ACCESSIBILITY ENHANCEMENTS ===== */
.focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    :root {
        --text-primary: #ffffff;
        --text-secondary: #ffffff;
        --accent-primary: #00ffff;
        --accent-secondary: #ff00ff;
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}