/* 
   MODERN APP DESIGN SYSTEM - HYPER POLISH
   Concept: Ethereal / Motion / Depth
   v4.0
*/

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600&display=swap');

:root {
    /* Base Palette */
    --app-bg: #0b0b0f;
    /* Void Black */
    --sidebar-bg: rgba(18, 18, 24, 0.7);
    /* More transparent for blur */

    /* Glass & Panels */
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-highlight: rgba(255, 255, 255, 0.1);
    --card-bg: rgba(26, 26, 32, 0.6);
    --card-hover: rgba(35, 35, 45, 0.8);

    /* Brand & Accents */
    --accent-primary: #6366f1;
    /* Indigo */
    --accent-secondary: #a855f7;
    /* Purple */
    --accent-cyan: #06b6d4;
    /* Cyan */
    --accent-glow: rgba(99, 102, 241, 0.6);

    /* Text */
    --text-main: #ffffff;
    --text-muted: #94a3b8;

    /* Dimensions */
    --sidebar-width: 280px;
    --header-height: 80px;
}

/* --- RESET & ANIMATIONS --- */
* {
    box-sizing: border-box;
}

body {
    background-color: var(--app-bg) !important;
    color: var(--text-main) !important;
    font-family: 'Outfit', sans-serif !important;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    line-height: 1.6;
}

@keyframes floatBackground {
    0% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(30px, 20px);
    }

    100% {
        transform: translate(0, 0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

@keyframes pulseGlow {
    0% {
        opacity: 0.6;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    100% {
        opacity: 0.6;
        transform: scale(1);
    }
}

/* --- APP LAYOUT --- */
.app-layout {
    display: flex;
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 50%, rgba(79, 70, 229, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.15), transparent 25%);
    background-color: var(--app-bg);
}

/* Floating Orbs for extra depth */
.app-layout::before,
.app-layout::after {
    content: '';
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    opacity: 0.4;
    animation: floatBackground 20s infinite alternate ease-in-out;
}

.app-layout::before {
    background: radial-gradient(#4f46e5, transparent 70%);
    left: -10%;
    will-change: transform;
    backface-visibility: hidden;
}

.app-layout::after {
    background: radial-gradient(#a855f7, transparent 70%);
    bottom: -20%;
    right: -10%;
    animation-delay: -10s;
}


/* --- SIDEBAR --- */
.app-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--glass-border);
    backdrop-filter: blur(25px);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 28px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.02);
}

.sidebar-logo img,
.header-logo img {
    height: 48px;
    filter: drop-shadow(0 0 12px rgba(99, 102, 241, 0.6));
    transition: 0.3s;
}

.sidebar-logo:hover img {
    filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.9));
}

.sidebar-menu {
    flex: 1;
    padding: 10px 18px;
    overflow-y: auto;
    /* Hide scrollbar but keep functionality */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

.sidebar-menu::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

.menu-label {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 800;
    margin: 12px 0 12px 14px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-radius: 14px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
    transition: 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    border: 1px solid transparent;
}

.menu-item i {
    font-size: 22px;
    margin-right: 14px;
    width: 24px;
    text-align: center;
    transition: 0.3s;
    color: #64748b;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border-color: var(--glass-border);
    transform: translateX(5px);
}

.menu-item:hover i {
    color: var(--text-main);
    transform: scale(1.1);
}

.menu-item.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.2), transparent);
    color: var(--accent-primary);
    border: 1px solid rgba(99, 102, 241, 0.3);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
}

.menu-item.active i {
    color: var(--accent-primary);
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.3);
}

/* --- MAIN CONTENT --- */
.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 40px 50px;
    position: relative;
    z-index: 1;
    /* Above bg orbs */
}

/* --- HERO SECTION --- */
.hero-banner {
    position: relative;
    padding: 80px 0 20px 0;
    margin-bottom: 30px;
    text-align: center;
}

/* Hero Glows */
.hero-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 60%);
    filter: blur(50px);
    pointer-events: none;
}

.hero-content h1 {
    font-size: 64px;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.05;
    background: linear-gradient(to right, #fff 20%, #818cf8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.03em;
    filter: drop-shadow(0 4px 10px rgba(99, 102, 241, 0.3));
}


.hero-search {
    position: relative;
    max-width: 500px;
    /* Optional constraint */
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 20px;
    pointer-events: none;
    z-index: 2;
    transition: 0.3s;
}

.hero-search input:focus+.search-icon,
.hero-search:focus-within .search-icon {
    color: var(--accent-primary);
}

.hero-search input {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    padding: 20px 24px 20px 54px;
    border-radius: 18px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    transition: 0.4s;
    width: 100%;
    color: white;
    font-size: 16px;
}

.hero-search input:focus {
    background: rgba(0, 0, 0, 0.7);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.2);
}

/* --- FILTERS & GRID --- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 60px;
    flex-wrap: wrap;
    gap: 20px;
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.filter-btn {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 100px;
    padding: 12px 28px;
    letter-spacing: 0.02em;
}

.filter-btn.active {
    background: var(--accent-primary);
    box-shadow: 0 0 25px var(--accent-glow);
}

.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

/* --- PREMIUM CARDS V4 (3D HOVER) --- */
/* --- RICH CARDS V5 (Ultra Polish) --- */
.server-card {
    background: rgba(26, 26, 35, 0.95);
    /* More opaque, less transparent */
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* backdrop-filter: blur(20px);  <-- REMOVED FOR PERFORMANCE */
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    will-change: transform;
    /* Hint to browser for smoother animation */
    transform: translateZ(0);
    /* Force GPU */
}

.server-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(99, 102, 241, 0.15);
}

.card-banner {
    height: 120px;
    position: relative;
    overflow: hidden;
}

.banner-img {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.6s ease;
}

.server-card:hover .banner-img {
    transform: scale(1.1);
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(11, 11, 15, 0.9) 100%);
}

.card-avatar-holder {
    position: absolute;
    top: 70px;
    left: 20px;
    width: 72px;
    height: 72px;
    padding: 4px;
    background: rgba(11, 11, 15, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: 0.3s;
}

.server-card:hover .card-avatar-holder {
    transform: scale(1.05) rotate(-3deg);
    border-color: var(--accent-primary);
}

.card-avatar {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    object-fit: cover;
    border: none !important;
    /* Reset overlap */
}

.card-body {
    padding: 36px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-header-info {
    margin-bottom: 16px;
}

.card-title {
    font-size: 19px;
    font-weight: 700;
    color: white;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.verified-badge {
    color: var(--accent-cyan);
    font-size: 16px;
}

.card-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 40px;
    /* Fixed height for consistency */
    margin: 0;
}

/* New Stats Pills */
.card-stats-row {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.stat-pill {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 8px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: 0.3s;
}

.stat-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.stat-pill i {
    font-size: 12px;
    color: #94a3b8;
}

.stat-pill span {
    font-size: 12px;
    font-weight: 700;
    color: white;
}

.btn-join-glow {
    background: linear-gradient(135deg, var(--accent-primary) 0%, #818cf8 100%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: 0.3s;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.btn-join-glow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: 0.3s;
}

.btn-join-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
    color: white;
}

.btn-join-glow:hover::after {
    opacity: 1;
}

.card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    color: #ffd700;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
    border: 1px solid rgba(255, 215, 0, 0.2);
    z-index: 5;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.rank-1 {
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.4);
}

.rank-2 {
    color: #94a3b8;
    border-color: rgba(148, 163, 184, 0.4);
}

.rank-3 {
    color: #b45309;
    border-color: rgba(180, 83, 9, 0.4);
}

/* SKELETON LOADER */
.skeleton {
    background: #2a2a30;
    background-image: linear-gradient(90deg, #2a2a30 0px, #35353d 40px, #2a2a30 80px);
    background-size: 600px;
    animation: shimmer 2s infinite linear;
    border-radius: 8px;
}

.skeleton-card {
    height: 380px;
    border-radius: 24px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
}

/* --- RESPONSIVE SIDEBAR --- */

/* Large screens (1400px+) - Full sidebar */
@media (min-width: 1400px) {
    :root {
        --sidebar-width: 300px;
    }
}

/* Medium-large screens (1200px - 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    :root {
        --sidebar-width: 260px;
    }
}

/* Medium screens (992px - 1199px) - Compact sidebar */
@media (min-width: 992px) and (max-width: 1199px) {
    :root {
        --sidebar-width: 240px;
    }

    .sidebar-menu {
        padding: 20px 14px;
    }

    .menu-item {
        padding: 12px 14px;
    }
}

/* Tablet (768px - 991px) - Icon-only sidebar */
@media (min-width: 768px) and (max-width: 991px) {
    .app-sidebar {
        width: 80px;
    }

    .menu-label,
    .menu-item span,
    .sidebar-logo,
    .sidebar-footer .user-info-mini,
    .sidebar-footer h6 {
        display: none;
    }

    .sidebar-header {
        padding: 0 16px;
        justify-content: center;
    }

    .menu-item {
        justify-content: center;
        padding: 14px;
    }

    .menu-item i {
        margin: 0;
        font-size: 22px;
    }

    .app-main {
        margin-left: 80px;
        padding: 20px;
    }

    .sidebar-footer {
        padding: 15px;
    }

    .sidebar-footer .user-avatar-mini {
        margin: 0 auto;
    }

    .sidebar-footer .btn {
        padding: 8px;
        font-size: 0;
    }

    .sidebar-footer .btn i {
        font-size: 16px;
        margin: 0;
    }
}

/* Mobile (max-width: 767px) - Hidden sidebar with toggle */
@media (max-width: 767px) {
    .app-sidebar {
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.3);
    }

    .app-sidebar.open {
        transform: translateX(0);
    }

    .app-main {
        margin-left: 0;
        padding: 15px;
        padding-top: 70px;
    }

    .mobile-header {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 56px;
        background: rgba(18, 18, 24, 0.95);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        align-items: center;
        justify-content: space-between;
        padding: 0 16px;
        z-index: 1001;
    }

    .mobile-search-icon {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #6366f1;
        font-size: 18px;
        text-decoration: none;
    }

    .mobile-logo-text {
        font-size: 18px;
        font-weight: 700;
        color: #fff;
        text-decoration: none;
        letter-spacing: -0.02em;
    }

    .mobile-menu-toggle {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        color: #fff;
        font-size: 20px;
        cursor: pointer;
    }

    .mobile-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 999;
    }

    .mobile-overlay.active {
        display: block;
    }

    /* Mobile Sidebar */
    .app-sidebar {
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1002;
    }

    .app-sidebar.open {
        transform: translateX(0);
    }

    /* Sidebar Close Button */
    .sidebar-close-btn {
        display: flex;
        justify-content: flex-end;
        padding: 16px 16px 8px 16px;
    }

    .sidebar-close-btn button {
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.05);
        border: none;
        border-radius: 10px;
        color: #94a3b8;
        font-size: 18px;
        cursor: pointer;
        transition: 0.2s;
    }

    .sidebar-close-btn button:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
    }

    /* Prevent body scroll when sidebar is open */
    body.sidebar-open {
        overflow: hidden;
    }

    .hero-content h1 {
        font-size: 28px;
    }

    .hero-banner {
        padding: 15px 15px 20px 15px;
        margin-bottom: 15px;
    }

    .hero-banner::before {
        display: none;
        /* Hide glow on mobile */
    }

    .hero-content {
        padding: 0 10px;
    }

    .hero-content p {
        font-size: 14px;
    }

    /* Mobile Rising Section Fixes */
    .rising-section {
        padding: 0 10px;
        margin-bottom: 20px;
    }

    .rising-swiper {
        padding-top: 10px;
        padding-bottom: 20px;
    }

    .swiper-slide {
        width: 240px !important;
        height: 320px !important;
    }

    .rising-card {
        border-radius: 16px;
    }

    .rising-banner {
        height: 90px;
    }

    .rising-content {
        padding: 12px;
    }

    .rising-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .rising-title h4 {
        font-size: 13px;
    }

    .rising-desc {
        font-size: 11px;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .rising-footer {
        padding-top: 10px;
    }

    .rising-footer-stats {
        font-size: 10px;
        gap: 8px;
    }

    .btn-join-sm {
        font-size: 11px;
        padding: 5px 12px;
    }
}

/* --- RANKING LIST VIEW (Homepage) --- */
.ranking-list-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    /* Force full width */
    max-width: 100%;
}

.ranking-table-header {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 12px;
    width: 100%;
}

.ranking-row {
    display: flex;
    align-items: center;
    background: rgba(26, 26, 35, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 16px 24px;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    overflow: hidden;
    width: 100%;
    /* Force full width */
}

.ranking-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent-primary);
    opacity: 0;
    transition: 0.3s;
}

.ranking-row:hover {
    transform: translateX(5px);
    background: rgba(30, 30, 40, 0.9);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
}

.ranking-row:hover::before {
    opacity: 1;
}

/* Columns - Hardened */
.col-rank {
    width: 60px;
    text-align: center;
    font-weight: 800;
    font-size: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
    /* Prevent shrinking */
}

.rank-1 {
    color: #ffd700;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.rank-2 {
    color: #c0c0c0;
}

.rank-3 {
    color: #cd7f32;
}

.col-server {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 200px;
    /* Ensure visual integrity */
    overflow: hidden;
}

.col-server .server-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    object-fit: cover;
    background: #1a1a1a;
    flex-shrink: 0;
}

.col-server .server-name h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col-server .server-name .tags {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.col-server .tag {
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.col-stat {
    width: 80px;
    /* Reduced from 120px */
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
    /* Prevent shrinking */
}

.col-stat-small {
    width: 50px;
    font-size: 13px;
    color: var(--text-muted);
}

.col-stat span.label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 400;
    display: none;
    /* Hidden on desktop */
}

.col-action {
    width: 140px;
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}

/* Mobile Responsive */
@media (max-width: 991px) {
    .ranking-table-header {
        display: none;
    }

    .ranking-row {
        flex-wrap: wrap;
        padding: 16px;
        gap: 12px;
        height: auto !important;
        /* Override skeleton height */
    }

    .col-rank {
        width: 40px;
        font-size: 16px;
    }

    .col-server {
        flex: 1 1 60%;
        /* Take up most space */
        min-width: 0;
        /* Allow shrink on mobile */
    }

    .col-stat {
        flex: 1 1 auto;
        /* Allow grow/shrink */
        background: rgba(255, 255, 255, 0.03);
        padding: 8px;
        border-radius: 8px;
        width: auto;
    }

    .col-stat span.label {
        display: block;
        margin-bottom: 2px;
    }

    .col-action {
        width: 100%;
        margin-top: 10px;
        justify-content: center;
    }

    .col-action .btn-join-glow {
        width: 100%;
    }
}

/* Rising Servers Slider */
.rising-section {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto 30px auto;
    overflow: hidden;
    position: relative;
    padding: 0 15px;
}

.rising-header-area {
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.rising-swiper {
    width: 100%;
    padding-top: 20px;
    padding-bottom: 40px;
    overflow: hidden;
    /* Critical for Swiper */
}

.swiper-slide {
    background-position: center;
    background-size: cover;
    width: 300px;
    /* Fixed width for coverflow */
    height: 380px;
    /* transition: transform 0.3s; */
}

.rising-card {
    background: rgba(25, 25, 35, 0.6);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    overflow: hidden;
    height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    transition: 0.3s;
    display: flex;
    flex-direction: column;
}

.rising-banner {
    height: 120px;
    position: relative;
    overflow: hidden;
}

.rising-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rising-boost-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(45deg, #ffd700, #ffa500);
    color: #000;
    font-weight: 800;
    font-size: 10px;
    padding: 4px 10px;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.rising-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.rising-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.rising-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    margin-right: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.rising-title h4 {
    color: #fff;
    font-size: 16px;
    margin: 0;
    font-weight: 700;
}

.rising-stats-mini {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
    display: flex;
    gap: 8px;
}

.rising-desc {
    color: #94a3b8;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.rising-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 15px;
}

.rising-footer-stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #64748b;
}

.stat-item.active {
    color: #ef4444;
}

.btn-join-sm {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 12px;
    padding: 6px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.2s;
}

.btn-join-sm:hover {
    background: #fff;
    color: #000;
}

/* Search Results Dropdown */
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #111;
    /* Solid dark background */
    backdrop-filter: none;
    /* Remove blur to prevent transparency issues if browser fails */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    margin-top: 10px;
    padding: 10px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 99999;
    /* Super high z-index */
    text-align: left;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9);
}

.search-dropdown:empty {
    display: none;
}

.search-section-title {
    font-size: 11px;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 700;
    margin: 10px 10px 5px 10px;
    letter-spacing: 0.05em;
}

.search-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 12px;
    text-decoration: none;
    transition: 0.2s;
    cursor: pointer;
    color: #fff;
}

.search-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.search-item img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.search-item.server-item img {
    border-radius: 8px;
}

.search-item-info {
    flex: 1;
    min-width: 0;
}

.search-item-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}

.search-item-sub {
    font-size: 12px;
    color: #94a3b8;
}

.no-results {
    padding: 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

/* Sidebar User Mini Profile */
.user-profile-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
}

.user-avatar-mini {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.user-info-mini h6 {
    color: white;
    font-size: 14px;
    margin: 0;
    font-weight: 600;
}

.user-info-mini span {
    font-size: 12px;
    color: #94a3b8;
}

/* ============================================
   COMPREHENSIVE RESPONSIVE DESIGN SYSTEM
   ============================================ */

/* --- DESKTOP XL (1400px+) --- */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }

    .hero-content h1 {
        font-size: 52px;
    }

    .section-title {
        font-size: 36px;
    }
}

/* --- DESKTOP (1200px - 1399px) --- */
@media (min-width: 1200px) and (max-width: 1399px) {
    .container {
        max-width: 1140px;
    }

    .hero-content h1 {
        font-size: 46px;
    }
}

/* --- TABLET LANDSCAPE (992px - 1199px) --- */
@media (min-width: 992px) and (max-width: 1199px) {
    .container {
        max-width: 960px;
    }

    .hero-content h1 {
        font-size: 40px;
    }

    .rising-card {
        padding: 16px;
    }

    .swiper-slide {
        width: 260px;
        height: 350px;
    }
}

/* --- TABLET (768px - 991px) --- */
@media (min-width: 768px) and (max-width: 991px) {
    .container {
        max-width: 720px;
    }

    .hero-content h1 {
        font-size: 34px;
    }

    .hero-content p {
        font-size: 15px;
    }

    .hero-banner {
        padding: 25px;
        border-radius: 20px;
    }

    /* Cards Grid */
    .guild-cards-grid,
    .user-cards-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px;
    }

    /* Rising cards */
    .swiper-slide {
        width: 240px;
        height: 340px;
    }

    .rising-section {
        padding: 0 10px;
    }

    /* Section titles */
    .section-title {
        font-size: 28px;
    }

    /* Search */
    .hero-search {
        max-width: 100%;
    }

    /* Stats grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* --- MOBILE LANDSCAPE (576px - 767px) --- */
@media (min-width: 576px) and (max-width: 767px) {
    .container {
        max-width: 540px;
        padding: 0 15px;
    }

    .hero-content h1 {
        font-size: 28px;
        line-height: 1.3;
    }

    .hero-content p {
        font-size: 14px;
    }

    .hero-banner {
        padding: 20px;
        border-radius: 16px;
    }

    /* Cards Grid - 2 columns */
    .guild-cards-grid,
    .user-cards-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }

    /* Rising cards */
    .swiper-slide {
        width: 220px;
        height: 320px;
    }

    .rising-content {
        padding: 15px;
    }

    .rising-icon {
        width: 40px;
        height: 40px;
    }

    /* Section titles */
    .section-title {
        font-size: 24px;
    }

    .section-subtitle {
        font-size: 14px;
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 15px;
    }

    /* Forms */
    .form-control,
    .form-select {
        font-size: 14px;
        padding: 10px 14px;
    }

    /* Buttons */
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .btn-lg {
        padding: 12px 24px;
    }
}

/* --- MOBILE PORTRAIT (max-width: 575px) --- */
@media (max-width: 575px) {
    .container {
        padding: 0 12px;
    }

    .hero-content h1 {
        font-size: 24px;
        line-height: 1.3;
    }

    .hero-content p {
        font-size: 13px;
        line-height: 1.5;
    }

    .hero-banner {
        padding: 16px;
        border-radius: 14px;
    }

    /* Cards Grid - Single column */
    .guild-cards-grid,
    .user-cards-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    /* Guild/User Cards */
    .guild-card,
    .user-card {
        border-radius: 14px;
    }

    /* Rising cards */
    .swiper-slide {
        width: 260px;
        height: 340px;
    }

    .rising-section {
        padding: 0 5px;
    }

    .rising-content {
        padding: 14px;
    }

    .rising-banner {
        height: 100px;
    }

    .rising-icon {
        width: 36px;
        height: 36px;
    }

    .rising-title h4 {
        font-size: 14px;
    }

    .rising-desc {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }

    /* Section titles */
    .section-title {
        font-size: 20px;
    }

    .section-subtitle {
        font-size: 13px;
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-card h3 {
        font-size: 20px;
    }

    .stat-card p {
        font-size: 11px;
    }

    /* Ranking rows */
    .ranking-row {
        padding: 12px;
        border-radius: 14px;
    }

    .col-rank {
        width: 35px;
        font-size: 14px;
    }

    .col-server .server-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .col-server .server-name h4 {
        font-size: 14px;
    }

    .col-server .tag {
        font-size: 9px;
        padding: 2px 6px;
    }

    /* Forms */
    .form-control,
    .form-select {
        font-size: 14px;
        padding: 10px 12px;
        border-radius: 10px;
    }

    /* Buttons */
    .btn {
        padding: 10px 16px;
        font-size: 13px;
        border-radius: 10px;
    }

    .btn-lg {
        padding: 12px 20px;
        font-size: 14px;
    }

    .btn-join-glow {
        padding: 8px 16px;
        font-size: 12px;
    }

    /* Modal */
    .modal-dialog {
        margin: 10px;
    }

    .modal-content {
        border-radius: 16px;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px;
    }

    /* Search */
    .hero-search {
        border-radius: 12px;
    }

    .search-input {
        font-size: 14px;
        padding: 12px 16px;
    }

    .search-dropdown {
        border-radius: 12px;
        max-height: 300px;
    }

    /* Tables */
    .table {
        font-size: 12px;
    }

    .table th,
    .table td {
        padding: 8px 10px;
    }

    /* Pagination */
    .pagination .page-link {
        padding: 6px 10px;
        font-size: 12px;
    }

    /* Breadcrumb */
    .breadcrumb {
        font-size: 12px;
    }

    /* Profile page specific */
    .profile-header {
        padding: 16px;
    }

    .profile-avatar {
        width: 80px;
        height: 80px;
    }

    .profile-name {
        font-size: 20px;
    }

    /* User profile cards */
    .user-profile-mini {
        padding: 8px;
        gap: 10px;
    }

    .user-avatar-mini {
        width: 36px;
        height: 36px;
    }

    .user-info-mini h6 {
        font-size: 13px;
    }
}

/* --- EXTRA SMALL (max-width: 375px) --- */
@media (max-width: 375px) {
    .hero-content h1 {
        font-size: 20px;
    }

    .hero-content p {
        font-size: 12px;
    }

    .section-title {
        font-size: 18px;
    }

    .swiper-slide {
        width: 240px;
        height: 300px;
    }

    .rising-content {
        padding: 12px;
    }

    .rising-title h4 {
        font-size: 13px;
    }

    .btn {
        padding: 8px 14px;
        font-size: 12px;
    }
}

/* --- TOUCH DEVICE OPTIMIZATIONS --- */
@media (hover: none) and (pointer: coarse) {

    /* Larger touch targets */
    .btn {
        min-height: 44px;
    }

    .menu-item {
        min-height: 48px;
    }

    /* Disable hover effects on touch */
    .ranking-row:hover {
        transform: none;
    }

    .rising-card:hover {
        transform: none;
    }
}

/* --- PRINT STYLES --- */
@media print {

    .app-sidebar,
    .mobile-header,
    .sidebar-footer,
    .btn-join-glow,
    .progress-wrap {
        display: none !important;
    }

    .app-main {
        margin-left: 0 !important;
    }

    body {
        background: white !important;
        color: black !important;
    }
}

/* --- REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}