/**
 * ============================================================
 * CUSTOM.CSS - GRADIENT FIX PRE UNIFIED SERVER CARDS + LOGO
 * ============================================================
 * Prepíše existujúce štýly aby mali gradient ako štatistiky
 * Targetuje PRESNÉ classy z HTML: .unified-server-card
 * ============================================================
 */

/* ============================================ */
/* LOGO STYLES                                  */
/* ============================================ */
.navbar-brand .logo-image {
    max-height: 50px;
    width: auto;
    vertical-align: middle;
}

.navbar-brand picture {
    display: inline-flex;
    align-items: center;
}

@media (max-width: 768px) {
    .navbar-brand .logo-image {
        max-height: 40px;
    }
}

/* ============================================ */
/* UNIFIED SERVER CARD                          */
/* ============================================ */

/* UNIFIED SERVER CARD - Gradient Background ako Stats */
.unified-server-card {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(99, 102, 241, 0.1) 100%) !important;
    border: 1px solid rgba(139, 92, 246, 0.3) !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease !important;
    backdrop-filter: blur(10px) !important;
}

.unified-server-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 12px 28px rgba(139, 92, 246, 0.25) !important;
    border-color: rgba(139, 92, 246, 0.5) !important;
}

/* Featured Badge - Zlatý gradient */
.unified-server-card.featured {
    border: 2px solid rgba(251, 191, 36, 0.6) !important;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%) !important;
}

.featured-badge {
    background: linear-gradient(135deg, #fbbf24, #f59e0b) !important;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.4) !important;
}

/* Server Status Badge */
.server-status {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(139, 92, 246, 0.2) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.server-status.online {
    background: rgba(34, 197, 94, 0.15) !important;
    border-color: rgba(34, 197, 94, 0.3) !important;
}

.server-status.online .status-text {
    color: #16a34a !important;
    font-weight: 600 !important;
}

.server-status.offline {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

.server-status.offline .status-text {
    color: #dc2626 !important;
    font-weight: 600 !important;
}

/* Status Dot - Pulse Animation */
.server-status.online .status-dot {
    background: #22c55e !important;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7) !important;
}

@keyframes pulse {
    0% { 
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7) !important;
    }
    70% { 
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0) !important;
    }
    100% { 
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0) !important;
    }
}

/* Card Body */
.unified-server-card .card-body {
    background: transparent !important;
    padding: 24px !important;
}

/* Server Header */
.server-header {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    margin-bottom: 16px !important;
}

/* Server Icon Placeholder */
.server-icon-placeholder {
    width: 64px !important;
    height: 64px !important;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%) !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3) !important;
}

.server-icon-placeholder i {
    color: white !important;
}

/* Discord Icon - Modrý gradient */
.unified-server-card[data-server-type="discord"] .server-icon-placeholder {
    background: linear-gradient(135deg, #5865f2 0%, #4752c4 100%) !important;
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3) !important;
}

/* Server Icon Image */
.server-icon {
    width: 64px !important;
    height: 64px !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 2px solid rgba(139, 92, 246, 0.3) !important;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2) !important;
}

/* Server Title */
.server-title {
    font-size: 20px !important;
    font-weight: 700 !important;
    margin: 0 0 8px 0 !important;
    color: #ffffff !important;
}

.server-title a {
    color: #ffffff !important;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
}

.server-title a:hover {
    color: #a78bfa !important;
}

/* Server Type Badge */
.server-type-badge {
    background: rgba(139, 92, 246, 0.2) !important;
    color: #a78bfa !important;
    border: 1px solid rgba(139, 92, 246, 0.4) !important;
    padding: 4px 12px !important;
    border-radius: 20px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

/* Connection Info */
.connection-info {
    margin-top: 12px !important;
}

.discord-connection {
    background: rgba(88, 101, 242, 0.2) !important;
    border: 1px solid rgba(88, 101, 242, 0.4) !important;
    color: #5865f2 !important;
    padding: 8px 14px !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    font-family: 'Courier New', monospace !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
}

.discord-connection:hover {
    background: rgba(88, 101, 242, 0.3) !important;
    border-color: rgba(88, 101, 242, 0.6) !important;
}

.discord-connection a {
    color: #5865f2 !important;
    text-decoration: none !important;
    font-weight: 600 !important;
}

.discord-connection a:hover {
    color: #4752c4 !important;
}

.discord-connection i {
    color: #5865f2 !important;
}

.game-connection {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(139, 92, 246, 0.3) !important;
    color: #a78bfa !important;
    padding: 8px 14px !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    font-family: 'Courier New', monospace !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}

.game-connection i {
    color: #8b5cf6 !important;
}

/* Copy Button */
.copy-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: inherit !important;
    cursor: pointer !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    transition: all 0.2s ease !important;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.copy-btn.copied {
    background: rgba(34, 197, 94, 0.2) !important;
    border-color: rgba(34, 197, 94, 0.4) !important;
    color: #22c55e !important;
}

/* Server Stats */
.server-stats {
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
    flex-wrap: wrap !important;
}

.player-count,
.stat {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.05) !important;
    padding: 8px 14px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.player-count i {
    color: #a78bfa !important;
    font-size: 18px !important;
}

.stat i {
    color: #a78bfa !important;
    font-size: 16px !important;
}

/* Server Actions - Vote Button */
.server-actions .btn {
    padding: 8px 20px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.server-actions .btn-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
    border: none !important;
    color: white !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3) !important;
    transition: all 0.3s ease !important;
}

.server-actions .btn-success:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.4) !important;
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%) !important;
}

.server-actions .btn-success i {
    color: white !important;
    margin-right: 6px !important;
}

/* Player Bar */
.player-bar {
    margin-top: 20px !important;
    padding-top: 20px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.progress {
    height: 8px !important;
    background: rgba(0, 0, 0, 0.3) !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    border: 1px solid rgba(139, 92, 246, 0.2) !important;
}

.progress-bar {
    height: 100% !important;
    transition: width 0.3s ease !important;
    border-radius: 10px !important;
}

.progress-bar.bg-success {
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%) !important;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5) !important;
}

.progress-bar.bg-warning {
    background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%) !important;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.5) !important;
}

.progress-bar.bg-danger {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%) !important;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .unified-server-card .card-body {
        padding: 16px !important;
    }
    
    .server-header {
        flex-direction: column !important;
        text-align: center !important;
    }
    
    .server-stats {
        justify-content: center !important;
        width: 100% !important;
    }
    
    .server-actions {
        margin-left: 0 !important;
        margin-top: 12px !important;
        width: 100% !important;
    }
    
    .server-actions .btn {
        width: 100% !important;
    }
    
    .player-count,
    .stat {
        font-size: 14px !important;
        padding: 6px 12px !important;
    }
}

/* Text Colors Override */
.unified-server-card * {
    color: inherit !important;
}

.unified-server-card .text-muted {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Make sure all text is visible on gradient background */
.server-info {
    color: #ffffff !important;
}

.server-info * {
    color: inherit !important;
}

/* ============================================================================
   Mega Menu — Categories dropdown s grupovaním (AI SEO 2026+ v10.4)
   Desktop: 5-stĺpcové grid, mobile: accordion
   VYSOKÁ ŠPECIFICKOSŤ + !important aby vyhrali nad Bootstrap .dropdown-menu
   ============================================================================ */

.navbar .dropdown-mega {
    position: static !important;
}

/* Hlavný mega-menu kontajner — musí vyhrať nad Bootstrap .dropdown-menu defaults */
.navbar .nav-item.dropdown-mega .dropdown-menu.mega-menu,
.navbar li.dropdown-mega > .dropdown-menu.mega-menu,
.dropdown-menu.mega-menu {
    width: min(95vw, 960px) !important;
    max-width: 960px !important;
    min-width: 320px !important;
    left: auto !important;
    right: 0 !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18) !important;
    border-radius: 12px !important;
    padding: 1.25rem !important;
    margin-top: 0.5rem !important;
}

/* Grid kontajner — prekonaj akékoľvek Bootstrap flex/block defaulty */
.mega-menu .mega-menu-grid,
.dropdown-menu.mega-menu .mega-menu-grid {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 1.25rem !important;
    width: 100% !important;
}

/* Fallback pre < 5 stĺpcov (menší počet skupín) */
@media (max-width: 1199.98px) {
    .mega-menu .mega-menu-grid,
    .dropdown-menu.mega-menu .mega-menu-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 767.98px) {
    .mega-menu .mega-menu-grid,
    .dropdown-menu.mega-menu .mega-menu-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

.mega-menu .mega-menu-col {
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

.mega-menu .mega-menu-col-popular {
    grid-column: span 1 !important;
}

.mega-menu .mega-menu-title {
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    color: #6c757d !important;
    padding-bottom: 0.35rem !important;
    margin-bottom: 0.5rem !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.mega-menu .dropdown-item,
.dropdown-menu.mega-menu .dropdown-item {
    display: flex !important;
    align-items: center !important;
    padding: 0.32rem 0.55rem !important;
    border-radius: 6px !important;
    font-size: 0.82rem !important;
    color: #333 !important;
    transition: background-color 120ms ease, color 120ms ease, transform 120ms ease !important;
    white-space: normal !important;
    line-height: 1.3 !important;
}

.mega-menu .dropdown-item:hover,
.mega-menu .dropdown-item:focus {
    background: linear-gradient(90deg, #eef2ff 0%, #e0e7ff 100%) !important;
    color: #4f46e5 !important;
    transform: translateX(2px) !important;
}

.mega-menu .dropdown-item i {
    width: 18px !important;
    text-align: center !important;
    flex-shrink: 0 !important;
    margin-right: 0.5rem !important;
}

.mega-menu-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.mega-menu-footer .btn {
    padding: 0.35rem 1.25rem !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    border-radius: 999px !important;
}

/* Dark theme mode */
[data-bs-theme="dark"] .dropdown-menu.mega-menu,
.dark-theme .dropdown-menu.mega-menu,
.theme-dark .dropdown-menu.mega-menu,
.theme-cyber .dropdown-menu.mega-menu,
.theme-neon .dropdown-menu.mega-menu,
.theme-galactic .dropdown-menu.mega-menu,
body.dark .dropdown-menu.mega-menu,
body[data-theme="dark"] .dropdown-menu.mega-menu {
    background: #161b22 !important;
    border-color: #30363d !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5) !important;
}

[data-bs-theme="dark"] .mega-menu .mega-menu-title,
.dark-theme .mega-menu .mega-menu-title,
.theme-dark .mega-menu .mega-menu-title,
.theme-cyber .mega-menu .mega-menu-title,
.theme-neon .mega-menu .mega-menu-title,
.theme-galactic .mega-menu .mega-menu-title,
body.dark .mega-menu .mega-menu-title,
body[data-theme="dark"] .mega-menu .mega-menu-title {
    color: #8b949e !important;
    border-bottom-color: #30363d !important;
}

[data-bs-theme="dark"] .mega-menu .dropdown-item,
.dark-theme .mega-menu .dropdown-item,
.theme-dark .mega-menu .dropdown-item,
.theme-cyber .mega-menu .dropdown-item,
.theme-neon .mega-menu .dropdown-item,
.theme-galactic .mega-menu .dropdown-item,
body.dark .mega-menu .dropdown-item,
body[data-theme="dark"] .mega-menu .dropdown-item {
    color: #c9d1d9 !important;
}

[data-bs-theme="dark"] .mega-menu .dropdown-item:hover,
[data-bs-theme="dark"] .mega-menu .dropdown-item:focus,
.dark-theme .mega-menu .dropdown-item:hover,
.theme-dark .mega-menu .dropdown-item:hover,
.theme-cyber .mega-menu .dropdown-item:hover,
.theme-neon .mega-menu .dropdown-item:hover,
.theme-galactic .mega-menu .dropdown-item:hover,
body.dark .mega-menu .dropdown-item:hover {
    background: linear-gradient(90deg, #1f2937 0%, #312e81 100%) !important;
    color: #a5b4fc !important;
}

/* ============================================================================
   Mobile responsive — pod 768px sa mení na 2-stĺpcové,
   pod 576px na fullwidth 1-stĺpcové s accordion vzhľadom
   ============================================================================ */

@media (max-width: 991.98px) {
    .navbar .dropdown-mega .dropdown-menu.mega-menu,
    .dropdown-menu.mega-menu {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0.5rem !important;
        border-radius: 0 !important;
        margin-top: 0 !important;
        right: auto !important;
        left: 0 !important;
    }
}

@media (max-width: 575.98px) {
    .mega-menu .mega-menu-grid,
    .dropdown-menu.mega-menu .mega-menu-grid {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
    }

    .mega-menu .mega-menu-col {
        padding: 0.5rem !important;
        background: rgba(0, 0, 0, 0.02) !important;
        border-radius: 8px !important;
    }

    [data-bs-theme="dark"] .mega-menu .mega-menu-col,
    .dark-theme .mega-menu .mega-menu-col,
    .theme-dark .mega-menu .mega-menu-col {
        background: rgba(255, 255, 255, 0.03) !important;
    }

    .mega-menu .dropdown-item {
        padding: 0.6rem 0.75rem !important;
        font-size: 0.95rem !important;
        min-height: 44px !important;
    }

    .mega-menu-footer .btn {
        display: block !important;
        width: 100% !important;
    }
}

/* High-contrast / reduced motion */
@media (prefers-reduced-motion: reduce) {
    .mega-menu .dropdown-item {
        transition: none !important;
    }
    .mega-menu .dropdown-item:hover {
        transform: none !important;
    }
}
