/* ===== BRUTAL DARK THEME - CS2ARENA.NET ===== */

/* Custom Properties */
:root {
    --bulgarian-white: #FFFFFF;
    --bulgarian-green: #00966E;
    --bulgarian-red: #D62612;
    --dark-bg: #0a0a0f;
    --dark-secondary: #111118;
    --dark-accent: #1a1a24;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
    background: var(--dark-bg);
    position: relative;
}

/* Animated SVG Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2300966E' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--bulgarian-red), var(--bulgarian-green));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--bulgarian-green), var(--bulgarian-red));
}

/* Selection */
::selection {
    background: var(--bulgarian-green);
    color: white;
}

/* Navbar Scroll Effect */
#navbar.scrolled {
    box-shadow: 0 10px 30px rgba(0, 150, 110, 0.3);
}

/* Mobile Menu Transitions */
#mobile-menu.active {
    transform: translateX(0);
}

#mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

#mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

#mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Custom Animations */
@keyframes fade-in-down {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes blob {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(20px, -50px) scale(1.1);
    }
    50% {
        transform: translate(-20px, 20px) scale(0.9);
    }
    75% {
        transform: translate(50px, 50px) scale(1.05);
    }
}

@keyframes scroll {
    0% {
        transform: translateY(0);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(20px);
        opacity: 0;
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 150, 110, 0.5);
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 150, 110, 0.8);
    }
}

/* Apply Animations */
.animate-fade-in-down {
    animation: fade-in-down 0.8s ease-out;
}

.animate-fade-in-up {
    animation: fade-in-up 0.8s ease-out;
}

.animate-blob {
    animation: blob 7s infinite;
}

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

.animation-delay-200 {
    animation-delay: 0.2s;
    animation-fill-mode: backwards;
}

.animation-delay-400 {
    animation-delay: 0.4s;
    animation-fill-mode: backwards;
}

.animation-delay-600 {
    animation-delay: 0.6s;
    animation-fill-mode: backwards;
}

.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-4000 {
    animation-delay: 4s;
}

/* Background Gradient Utilities */
.bg-size-200 {
    background-size: 200% auto;
}

.bg-pos-0 {
    background-position: 0% center;
}

.bg-pos-100 {
    background-position: 100% center;
}

/* Stat Card Effects */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(0, 150, 110, 0.1),
        transparent
    );
    transform: rotate(45deg);
    transition: all 0.5s;
}

.stat-card:hover::before {
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Hero Section Overlays */
#hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        repeating-linear-gradient(
            0deg,
            rgba(0, 150, 110, 0.03) 0px,
            transparent 1px,
            transparent 2px,
            rgba(0, 150, 110, 0.03) 3px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(214, 38, 18, 0.03) 0px,
            transparent 1px,
            transparent 2px,
            rgba(214, 38, 18, 0.03) 3px
        );
    pointer-events: none;
    z-index: 1;
}

/* Glowing Effects */
.glow-green {
    box-shadow: 0 0 20px rgba(0, 150, 110, 0.5);
}

.glow-red {
    box-shadow: 0 0 20px rgba(214, 38, 18, 0.5);
}

/* Hover Effects for Links */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--bulgarian-red), var(--bulgarian-green));
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 80%;
}

/* Mobile Nav Link Effects */
.mobile-nav-link {
    position: relative;
    display: inline-block;
}

.mobile-nav-link::before {
    content: '';
    position: absolute;
    left: -30px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--bulgarian-red), var(--bulgarian-green));
    transition: width 0.3s ease;
}

.mobile-nav-link:hover::before {
    width: 20px;
}

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

/* Hide scrollbar for mobile menu */
#mobile-menu {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#mobile-menu::-webkit-scrollbar {
    display: none;
}

/* Responsive Improvements - Stat cards handled via Tailwind now */

/* Extra small devices - Mobile Nav refinement */
@media (max-width: 400px) {
    .mobile-nav-link {
        font-size: 1.125rem !important; /* 18px instead of 20px */
    }
    
    #mobile-menu .mt-6 {
        font-size: 1rem !important; /* 16px for button */
        padding: 0.625rem 2rem !important;
    }
}

/* Mobile Logo and Menu Button spacing */
@media (max-width: 640px) {
    #navbar a[href="/"]:first-of-type {
        max-width: 60%;
    }
}

@media (max-width: 400px) {
    #navbar a[href="/"]:first-of-type {
        max-width: 55%;
    }
    
    #navbar a[href="/"]:first-of-type span {
        font-size: 0.875rem !important; /* 14px for very small screens */
    }
}

/* Focus Styles for Accessibility */
a:focus, button:focus {
    outline: 2px solid var(--bulgarian-green);
    outline-offset: 2px;
}

/* Hero Title Alignment */
@media (min-width: 1024px) {
    #hero h1 {
        text-align: left !important;
    }
}

/* Mobile Menu Active State */
#mobile-menu.active {
    transform: translateX(0) !important;
}

#mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

#mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

#mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ===== CHRISTMAS THEME ===== */

/* Snowflakes Animation */
@keyframes snowfall {
    0% {
        transform: translateY(-10vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) translateX(100px);
        opacity: 0;
    }
}

@keyframes snowfall-left {
    0% {
        transform: translateY(-10vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) translateX(-100px);
        opacity: 0;
    }
}

.snowflake {
    position: fixed;
    top: -10vh;
    color: #fff;
    font-size: 1em;
    font-family: Arial, sans-serif;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
    z-index: 9999;
    pointer-events: none;
    user-select: none;
}

/* Christmas Lights Animation */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes colorChange {
    0% { color: #ff0000; text-shadow: 0 0 10px #ff0000; }
    25% { color: #00ff00; text-shadow: 0 0 10px #00ff00; }
    50% { color: #ffff00; text-shadow: 0 0 10px #ffff00; }
    75% { color: #0000ff; text-shadow: 0 0 10px #0000ff; }
    100% { color: #ff0000; text-shadow: 0 0 10px #ff0000; }
}

.christmas-lights {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 10;
    pointer-events: none;
}

.light {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: blink 1s infinite, colorChange 3s infinite;
}

.light:nth-child(2n) {
    animation-delay: 0.5s;
}

.light:nth-child(3n) {
    animation-delay: 1s;
}

/* Christmas Hat on Logo */
.christmas-hat {
    position: absolute;
    top: -15px;
    right: -5px;
    font-size: 24px;
    transform: rotate(15deg);
    animation: wiggle 2s ease-in-out infinite;
    z-index: 10;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(15deg); }
    50% { transform: rotate(25deg); }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .snowflake,
    .christmas-lights,
    .christmas-hat {
        animation: none !important;
    }
}

/* ===== LEADERBOARD STYLES ===== */

/* Podium Cards */
.podium-card {
    position: relative;
}

.podium-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 1rem;
    background: linear-gradient(135deg, 
        var(--bulgarian-red), 
        var(--bulgarian-green), 
        var(--bulgarian-white)
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.podium-card:hover::before {
    opacity: 0.3;
}

/* Leaderboard Table */
.leaderboard-table tbody tr {
    border-bottom: 1px solid rgba(0, 150, 110, 0.1);
    transition: all 0.3s ease;
}

.leaderboard-table tbody tr:hover {
    background: rgba(0, 150, 110, 0.05);
    border-bottom-color: rgba(0, 150, 110, 0.3);
}

.leaderboard-table tbody tr:last-child {
    border-bottom: none;
}

.leaderboard-table tbody td {
    padding: 1rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
}

/* Rank Badge in Table */
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 0.875rem;
}

.rank-badge.top-3 {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
}

.rank-badge.top-10 {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.rank-badge.default {
    background: rgba(26, 26, 36, 0.6);
    color: rgba(255, 255, 255, 0.6);
}

/* Player Avatar in Table */
.player-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(0, 150, 110, 0.3);
    transition: all 0.3s ease;
}

.leaderboard-table tbody tr:hover .player-avatar {
    border-color: var(--bulgarian-green);
    transform: scale(1.1);
}

/* Pagination Buttons */
.pagination-btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    background: rgba(26, 26, 36, 0.6);
    border: 1px solid rgba(0, 150, 110, 0.2);
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Orbitron', sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(0, 150, 110, 0.2);
    border-color: var(--bulgarian-green);
    color: white;
    transform: translateY(-2px);
}

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: linear-gradient(135deg, var(--bulgarian-red), var(--bulgarian-green));
    border-color: var(--bulgarian-green);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 150, 110, 0.4);
}

/* Search Input Focus Effect */
#player-search:focus {
    box-shadow: 0 0 0 4px rgba(0, 150, 110, 0.1);
}

/* Responsive Table */
@media (max-width: 768px) {
    .leaderboard-table tbody td {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    .player-avatar {
        width: 32px;
        height: 32px;
    }
    
    .rank-badge {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
}

/* Podium Height Animation */
@keyframes podium-rise {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.podium-card {
    animation: podium-rise 0.6s ease-out;
}

/* Trophy Glow Effect */
@keyframes trophy-glow {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(234, 179, 8, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(234, 179, 8, 0.8));
    }
}

.bi-trophy-fill {
    animation: trophy-glow 2s ease-in-out infinite;
}

/* ===== FOOTER STYLES ===== */

/* Footer Columns */
.footer-column {
    animation: fade-in-up 0.6s ease-out;
}

/* Footer Links Hover Effect */
.footer-link {
    position: relative;
}

.footer-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--bulgarian-red), var(--bulgarian-green));
    transition: width 0.3s ease;
}

.footer-link:hover::after {
    width: 100%;
}

/* Social Button Effects */
.social-btn {
    position: relative;
}

.social-btn::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, transparent, currentColor, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.social-btn:hover::before {
    opacity: 0.1;
}

/* Slow Spin Animation */
@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.animate-spin-slow {
    animation: spin-slow 8s linear infinite;
}

/* Back to Top Button */
#back-to-top {
    position: relative;
}

#back-to-top::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, 
        rgba(214, 38, 18, 0.3), 
        rgba(0, 150, 110, 0.3)
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

#back-to-top:hover::before {
    opacity: 1;
}

/* Footer Responsive */
@media (max-width: 768px) {
    .footer-column {
        text-align: center;
    }
    
    .footer-link {
        justify-content: center;
    }
}

/* ===== COPY BUTTON ANIMATIONS ===== */
.copy-success {
    animation: copy-success-pulse 0.4s ease-in-out;
}

@keyframes copy-success-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(0, 150, 110, 0.6);
    }
    100% {
        transform: scale(1);
    }
}