/* Custom styles */
body {
    background-color: #0f172a;
    color: #e2e8f0;
    transition: background-color 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Table hover effects */
tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

/* Dark mode hover effect */
.dark tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.2);
}

/* Sort indicators - for Rank, Player, and Raxs columns */
th:nth-child(1)::after,
th:nth-child(2)::after,
th:nth-child(4)::after {
    content: '↕';
    position: absolute;
    right: 8px;
    opacity: 0.5;
}

th:nth-child(1).asc::after,
th:nth-child(2).asc::after,
th:nth-child(4).asc::after {
    content: '↑';
    opacity: 1;
}

th:nth-child(1).desc::after,
th:nth-child(2).desc::after,
th:nth-child(4).desc::after {
    content: '↓';
    opacity: 1;
}

/* Position relative only for sortable columns */
th:nth-child(1),
th:nth-child(2),
th:nth-child(4) {
    position: relative;
    user-select: none;
}

/* Smooth transitions */
* {
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1e293b;
}

::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

.dark ::-webkit-scrollbar-track {
    background: #2d3748;
}

.dark ::-webkit-scrollbar-thumb {
    background: #4a5568;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #718096;
}

/* Input styling */
input {
    outline: none;
    transition: border-color 0.2s ease;
}

input:focus {
    border-color: #3b82f6;
}

/* Table cell styling */
td {
    transition: background-color 0.2s ease, color 0.2s ease;
}


/* Header styling */
header h1 {
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

/* Container styling */
.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Table container */
.overflow-x-auto {
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Table styles */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #1f2937;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    th, td {
        padding: 0.5rem;
        font-size: 0.875rem;
    }

    /* Make table horizontally scrollable on mobile */
    .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .overflow-x-auto::-webkit-scrollbar {
        display: none;
    }
}

/* Desktop optimizations */
@media (min-width: 769px) {
    .container {
        max-width: 1200px;
    }

    th, td {
        padding: 0.75rem 1rem;
    }
}

/* Hover effects */
tr:hover {
    background-color: rgba(55, 65, 81, 0.5);
}

/* Search input focus */
#searchInput:focus {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

/* Sort indicators */
th.asc::after {
    content: " ↑";
    font-size: 0.75em;
}

th.desc::after {
    content: " ↓";
    font-size: 0.75em;
}

/* Loading state */
.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================= */
/* Banner styles (scrolling text) */
/* ============================= */
.banner {
    width: 100%;
    overflow: hidden;
    background-color: #facc15; /* Tailwind yellow-400 */
    color: #000;
    font-weight: bold;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eab308;
    white-space: nowrap;
    position: relative;
}

.banner-content {
    display: inline-block;
    padding-left: 100%;
    animation: scrollBanner 12s linear infinite;
}

.banner a {
    color: #2563eb; /* Tailwind blue-600 */
    text-decoration: underline;
}

@keyframes scrollBanner {
    0% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(-100%);
    }
}
