/**
 * INDEX.HTML IMPROVEMENTS
 * Modern enhancements to the existing dashboard
 * Add this after the existing styles in index.html
 */

/* ============================================
 * ENHANCED ANIMATIONS
 * ============================================ */

/* Smooth fade-in for sections */
.section-panel {
    animation: fadeInSection 0.4s ease-out;
}

@keyframes fadeInSection {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card entrance animations */
.stat-card,
.memory-card,
.session-card {
    animation: cardSlideIn 0.3s ease-out backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }
.stat-card:nth-child(5) { animation-delay: 0.25s; }
.stat-card:nth-child(6) { animation-delay: 0.3s; }

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Hover lift effect for cards */
.stat-card,
.memory-card,
.session-card,
.skill-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    will-change: transform;
}

.stat-card:hover,
.memory-card:hover,
.session-card:hover,
.skill-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 8px 16px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(255, 215, 0, 0.15);
}

/* ============================================
 * LOADING STATES
 * ============================================ */

.loading-skeleton {
    background: linear-gradient(
        90deg,
        var(--csgo-gray) 0%,
        var(--csgo-gray-light) 50%,
        var(--csgo-gray) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-md, 6px);
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.loading-spinner {
    border: 3px solid var(--csgo-gray);
    border-top-color: var(--csgo-yellow);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
 * IMPROVED BUTTONS
 * ============================================ */

.btn,
.card-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn::before,
.card-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before,
.card-btn:active::before {
    width: 300px;
    height: 300px;
}

/* Button glow effect */
.btn-primary:hover {
    box-shadow:
        0 0 20px rgba(255, 215, 0, 0.4),
        inset 0 0 10px rgba(255, 215, 0, 0.2);
}

/* ============================================
 * ENHANCED SCROLLBARS
 * ============================================ */

.modal-body::-webkit-scrollbar,
.file-browser-content::-webkit-scrollbar,
.memory-list::-webkit-scrollbar {
    width: 10px;
}

.modal-body::-webkit-scrollbar-track,
.file-browser-content::-webkit-scrollbar-track,
.memory-list::-webkit-scrollbar-track {
    background: var(--csgo-darker);
    border-radius: 5px;
}

.modal-body::-webkit-scrollbar-thumb,
.file-browser-content::-webkit-scrollbar-thumb,
.memory-list::-webkit-scrollbar-thumb {
    background: var(--csgo-yellow-dark);
    border-radius: 5px;
    border: 2px solid var(--csgo-darker);
}

.modal-body::-webkit-scrollbar-thumb:hover,
.file-browser-content::-webkit-scrollbar-thumb:hover,
.memory-list::-webkit-scrollbar-thumb:hover {
    background: var(--csgo-yellow);
}

/* ============================================
 * IMPROVED MODALS
 * ============================================ */

.modal {
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================
 * ENHANCED TABLES
 * ============================================ */

.data-table tbody tr {
    transition: background-color 0.2s ease;
}

.data-table tbody tr:hover {
    background: rgba(255, 215, 0, 0.05);
}

/* Alternating row colors for better readability */
.data-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.data-table tbody tr:nth-child(even):hover {
    background: rgba(255, 215, 0, 0.07);
}

/* ============================================
 * STATUS INDICATORS
 * ============================================ */

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    position: relative;
}

.status-indicator.online {
    background: var(--csgo-success);
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
}

.status-indicator.offline {
    background: var(--csgo-text-dim);
}

.status-indicator.error {
    background: var(--csgo-error);
    box-shadow: 0 0 8px rgba(244, 67, 54, 0.6);
}

/* Pulse animation for active status */
.status-indicator.online::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    border: 2px solid var(--csgo-success);
    animation: statusPulse 2s ease-out infinite;
}

@keyframes statusPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0;
        transform: scale(1.5);
    }
}

/* ============================================
 * ENHANCED FORM INPUTS
 * ============================================ */

input[type="text"],
input[type="search"],
input[type="email"],
textarea,
select {
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="search"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
    border-color: var(--csgo-yellow);
    box-shadow:
        0 0 0 3px rgba(255, 215, 0, 0.1),
        0 0 12px rgba(255, 215, 0, 0.2);
    transform: translateY(-1px);
}

/* ============================================
 * TOAST NOTIFICATIONS
 * ============================================ */

.toast {
    animation: toastSlideIn 0.3s ease-out;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.toast-hide {
    animation: toastSlideOut 0.3s ease-out forwards;
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* ============================================
 * BREADCRUMB IMPROVEMENTS
 * ============================================ */

.breadcrumb-item {
    transition: all 0.2s ease;
    position: relative;
}

.breadcrumb-item:hover {
    color: var(--csgo-yellow);
    transform: translateX(2px);
}

.breadcrumb-item::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--csgo-yellow);
    transition: width 0.3s ease;
}

.breadcrumb-item:hover::after {
    width: 100%;
}

/* ============================================
 * PERFORMANCE OPTIMIZATIONS
 * ============================================ */

/* Use GPU acceleration for animations */
.stat-card,
.memory-card,
.session-card,
.skill-card,
.btn,
.nav-item {
    transform: translateZ(0);
    backface-visibility: hidden;
}

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

/* ============================================
 * PRINT STYLES
 * ============================================ */

@media print {
    .header,
    .nav-panel,
    .btn,
    .modal {
        display: none !important;
    }

    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }

    .stat-card,
    .memory-card,
    .session-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* ============================================
 * ACCESSIBILITY ENHANCEMENTS
 * ============================================ */

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--csgo-yellow);
    color: var(--csgo-black);
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
    font-weight: 600;
}

.skip-link:focus {
    top: 0;
}

/* Focus visible enhancement */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--csgo-yellow);
    outline-offset: 3px;
    border-radius: 2px;
}

/* ============================================
 * UTILITY CLASSES
 * ============================================ */

.hidden {
    display: none !important;
}

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

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

.no-scroll {
    overflow: hidden !important;
}

/* ============================================
 * DARK MODE ENHANCEMENTS (Future-ready)
 * ============================================ */

@media (prefers-color-scheme: dark) {
    /* Already dark by default, but can add overrides */
    body {
        background: var(--csgo-black);
    }
}

/* Optional light mode support */
body.light-mode {
    --csgo-black: #f5f5f5;
    --csgo-dark: #e8e8e8;
    --csgo-gray: #d0d0d0;
    --csgo-text: #1a1a1a;
    --csgo-text-dim: #666666;
}
