/**
 * ForHytale.com - Mystical Hytale Theme
 * Enchanted animations, mystical glows, fantasy RPG aesthetic
 */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    --hytale-orange: #FF6B35;
    --hytale-gold: #FFAA00;
    --hytale-yellow: #FFD93D;
    --hytale-cyan: #55FFFF;
    --hytale-blue: #3A7BD5;
    --hytale-purple: #AA00AA;
    --hytale-magenta: #FF55FF;
    --hytale-green: #55FF55;
    --hytale-red: #FF5555;
    --hytale-emerald: #2ecc71;
    --hytale-arcane: #7B68EE;
    --hytale-frost: #87CEEB;

    --bg-primary: #080810;
    --bg-secondary: #0E0E1A;
    --bg-tertiary: #151528;
    --bg-card: #1A1A30;
    --bg-card-hover: #222244;

    --text-primary: #EEEEF6;
    --text-secondary: #B8B8D0;
    --text-muted: #7878A0;

    --border-color: #2A2A50;
    --border-light: #3A3A60;
    --border-glow: rgba(85, 255, 255, 0.15);

    --gradient-orange: linear-gradient(135deg, #FF6B35, #FFAA00);
    --gradient-cyan: linear-gradient(135deg, #3A7BD5, #55FFFF);
    --gradient-purple: linear-gradient(135deg, #7B2FBE, #FF55FF);
    --gradient-arcane: linear-gradient(135deg, #4A00E0, #7B68EE, #55FFFF);
    --gradient-enchant: linear-gradient(135deg, #2ecc71, #55FFFF, #7B68EE);
    --gradient-fire: linear-gradient(135deg, #FF5555, #FF6B35, #FFAA00);
    --gradient-mystic: linear-gradient(135deg, #0E0E1A 0%, #1A1A30 40%, #151528 100%);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);
    --shadow-glow-orange: 0 0 25px rgba(255, 107, 53, 0.25);
    --shadow-glow-cyan: 0 0 25px rgba(85, 255, 255, 0.2);
    --shadow-glow-purple: 0 0 25px rgba(123, 104, 238, 0.2);
    --shadow-glow-enchant: 0 0 30px rgba(46, 204, 113, 0.15), 0 0 60px rgba(85, 255, 255, 0.1);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);

    --font-display: 'Cinzel Decorative', 'Georgia', serif;
    --font-heading: 'Fondamento', 'Georgia', serif;
    --font-body: 'Fondamento', 'Trebuchet MS', serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */
@keyframes enchantShimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes mysticFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes runeGlow {
    0%, 100% { opacity: 0.4; filter: blur(8px); }
    50% { opacity: 0.8; filter: blur(12px); }
}

@keyframes particleDrift {
    0% { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-120px) translateX(30px) scale(0); opacity: 0; }
}

@keyframes portalSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(85, 255, 255, 0.15); }
    50% { box-shadow: 0 0 30px rgba(85, 255, 255, 0.3); }
}

@keyframes borderGlow {
    0%, 100% { border-color: rgba(85, 255, 255, 0.2); }
    50% { border-color: rgba(85, 255, 255, 0.5); }
}

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

@keyframes starTwinkle {
    0%, 100% { opacity: 0.2; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

@keyframes enchantedBorder {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

/* ============================================
   BASE STYLES
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scrollbar-color: var(--bg-card-hover) var(--bg-secondary);
}

body {
    font-family: var(--font-body);
    background: radial-gradient(circle at 30% -20%, #1b1336 0%, var(--bg-primary) 45%, #06060d 100%);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Mystical ambient background */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse 600px 400px at 15% 20%, rgba(123, 104, 238, 0.06) 0%, transparent 100%),
        radial-gradient(ellipse 500px 500px at 85% 15%, rgba(85, 255, 255, 0.04) 0%, transparent 100%),
        radial-gradient(ellipse 400px 600px at 50% 80%, rgba(255, 107, 53, 0.04) 0%, transparent 100%),
        radial-gradient(ellipse 300px 300px at 70% 60%, rgba(46, 204, 113, 0.03) 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

/* Floating mystical particles overlay */
body::after {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image:
        radial-gradient(1px 1px at 10% 20%, rgba(85, 255, 255, 0.4), transparent),
        radial-gradient(1px 1px at 30% 65%, rgba(123, 104, 238, 0.3), transparent),
        radial-gradient(1px 1px at 55% 15%, rgba(255, 170, 0, 0.3), transparent),
        radial-gradient(1px 1px at 70% 80%, rgba(85, 255, 255, 0.3), transparent),
        radial-gradient(1px 1px at 90% 40%, rgba(46, 204, 113, 0.3), transparent),
        radial-gradient(1.5px 1.5px at 20% 90%, rgba(255, 85, 255, 0.2), transparent),
        radial-gradient(1px 1px at 80% 10%, rgba(85, 255, 255, 0.35), transparent),
        radial-gradient(1px 1px at 45% 45%, rgba(123, 104, 238, 0.25), transparent);
    animation: starTwinkle 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

body > * {
    position: relative;
    z-index: 1;
}

a {
    color: var(--hytale-cyan);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--hytale-gold);
    text-shadow: 0 0 8px rgba(255, 170, 0, 0.3);
}

img { max-width: 100%; height: auto; }

::selection {
    background: rgba(123, 104, 238, 0.4);
    color: #fff;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

h1, .h1 { font-family: var(--font-display); font-size: 2.75rem; letter-spacing: 1px; }
h2, .h2 { font-family: var(--font-display); font-size: 2.1rem; }
h3, .h3 { font-size: 1.6rem; }
h4, .h4 { font-size: 1.35rem; }
h5, .h5 { font-family: var(--font-body); font-size: 1.15rem; }
h6, .h6 { font-family: var(--font-body); font-size: 1rem; }

p { color: var(--text-secondary); }

.text-orange { color: var(--hytale-orange) !important; }
.text-gold { color: var(--hytale-gold) !important; }
.text-cyan { color: var(--hytale-cyan) !important; }
.text-purple { color: var(--hytale-purple) !important; }
.text-green { color: var(--hytale-green) !important; }
.text-arcane { color: var(--hytale-arcane) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-light-primary { color: var(--text-primary) !important; }
.text-light-secondary { color: var(--text-secondary) !important; }

/* Enchanted shimmer text */
.enchanted-text {
    background: linear-gradient(90deg, var(--hytale-cyan), var(--hytale-arcane), var(--hytale-emerald), var(--hytale-cyan));
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textShimmer 4s linear infinite;
    filter: drop-shadow(0 0 6px rgba(85, 255, 255, 0.3));
}

/* Hytale gradient title */
.hytale-title {
    font-family: var(--font-display);
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hytale-title-gradient {
    font-family: var(--font-display);
    letter-spacing: 2px;
    background: linear-gradient(180deg, #FFD700 0%, #FF8C00 50%, #FF6B35 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(2px 2px 2px rgba(0,0,0,0.5));
}

/* ============================================
   NAVIGATION
   ============================================ */
.navbar {
    background: rgba(8, 8, 16, 0.85);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-bottom: 1px solid rgba(85, 255, 255, 0.08);
    padding: 0.6rem 0;
    transition: var(--transition-normal);
    z-index: 1000;
}

.navbar.scrolled {
    background: rgba(8, 8, 16, 0.97);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5), 0 0 40px rgba(85, 255, 255, 0.03);
    border-bottom-color: rgba(85, 255, 255, 0.12);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none !important;
}

.brand-logo-img {
    height: 50px !important;
    width: auto;
    filter: drop-shadow(0 0 8px rgba(85, 255, 255, 0.2));
    transition: var(--transition-fast);
}

.navbar-brand:hover .brand-logo-img {
    filter: drop-shadow(0 0 14px rgba(85, 255, 255, 0.4));
    transform: scale(1.03);
}

.navbar-nav .nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    position: relative;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--text-primary);
    background: rgba(85, 255, 255, 0.06);
    text-shadow: 0 0 8px rgba(85, 255, 255, 0.15);
}

.navbar-nav .nav-link i {
    margin-right: 0.3rem;
    font-size: 0.85em;
}

/* Pro Nav Link - Enchanted */
.nav-pro {
    background: var(--gradient-purple) !important;
    color: white !important;
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem !important;
    font-weight: 600 !important;
    border: 1px solid rgba(255, 85, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.nav-pro::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 200%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    animation: enchantShimmer 3s linear infinite;
}

.nav-pro:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(170, 0, 170, 0.4);
    color: white !important;
}

/* Dropdown - Mystical */
.dropdown-menu {
    background: rgba(20, 20, 40, 0.97);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(85, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(85, 255, 255, 0.05);
    padding: 0.5rem;
    color: var(--text-primary);
    animation: fadeInUp 0.2s ease;
}

.dropdown-item {
    color: var(--text-secondary);
    padding: 0.55rem 1rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background: rgba(85, 255, 255, 0.08);
    color: var(--text-primary);
    padding-left: 1.2rem;
}

.dropdown-item i { margin-right: 0.5rem; width: 18px; }
.dropdown-divider { border-color: var(--border-color); margin: 0.4rem 0; }

/* Search Box - Arcane */
.search-box {
    position: relative;
}

.search-box input {
    background: rgba(21, 21, 40, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    padding: 0.5rem 2.5rem 0.5rem 1.1rem;
    width: 200px;
    font-size: 0.875rem;
    transition: var(--transition-normal);
}

.search-box input:focus {
    outline: none;
    border-color: var(--hytale-arcane);
    box-shadow: 0 0 0 3px rgba(123, 104, 238, 0.15), 0 0 20px rgba(123, 104, 238, 0.1);
    width: 260px;
    background: rgba(21, 21, 40, 0.95);
}

.search-box input::placeholder { color: var(--text-muted); }

.search-box button {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
}

.search-box button:hover { color: var(--hytale-cyan); }

/* User Menu */
.user-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    transition: var(--transition-fast);
}

.avatar-sm:hover {
    border-color: var(--hytale-cyan);
    box-shadow: 0 0 12px rgba(85, 255, 255, 0.3);
}

.badge-pro {
    background: var(--gradient-purple);
    color: white;
    font-size: 0.6rem;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.badge-pro::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 200%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: enchantShimmer 2.5s linear infinite;
}

/* ============================================
   BUTTONS - Enchanted
   ============================================ */
.btn {
    font-family: var(--font-body);
    font-weight: 600;
    padding: 0.625rem 1.5rem;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.25);
}

.btn::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.btn:hover::after {
    left: 100%;
}

.btn-orange {
    background: var(--gradient-orange);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.25);
}

.btn-orange:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 107, 53, 0.4);
    color: white;
}

.btn:active {
    transform: translateY(1px) scale(0.99);
    border-bottom-width: 1px;
}

.btn-cyan {
    background: var(--gradient-cyan);
    color: var(--bg-primary);
    font-weight: 700;
}

.btn-cyan:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(85, 255, 255, 0.3);
    color: var(--bg-primary);
}

.btn-purple {
    background: var(--gradient-purple);
    color: white;
}

.btn-purple:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(170, 0, 170, 0.35);
    color: white;
}

.btn-dark {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-dark:hover {
    background: var(--bg-card-hover);
    border-color: var(--hytale-cyan);
    color: var(--text-primary);
    box-shadow: 0 0 15px rgba(85, 255, 255, 0.1);
}

.btn-outline-orange {
    background: transparent;
    color: var(--hytale-orange);
    border: 2px solid var(--hytale-orange);
}

.btn-outline-orange:hover {
    background: var(--hytale-orange);
    color: white;
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.3);
}

.btn-outline-purple {
    background: transparent;
    color: var(--hytale-arcane);
    border: 1px solid var(--hytale-arcane);
}

.btn-outline-purple:hover {
    background: var(--hytale-arcane);
    color: white;
    box-shadow: 0 0 20px rgba(123, 104, 238, 0.3);
}

.btn-lg { padding: 0.875rem 2rem; font-size: 1.05rem; }
.btn-sm { padding: 0.375rem 1rem; font-size: 0.85rem; }

/* ============================================
   CARDS - Mystical Glass
   ============================================ */
.card {
    background: rgba(26, 26, 48, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(85, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    transition: var(--transition-normal);
    color: var(--text-primary);
    overflow: hidden;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, rgba(85, 255, 255, 0), rgba(85, 255, 255, 0.55), rgba(255, 170, 0, 0.45), rgba(85, 255, 255, 0));
    opacity: 0.6;
}

.card:hover {
    border-color: rgba(85, 255, 255, 0.18);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(85, 255, 255, 0.05);
}

.card-header {
    background: rgba(21, 21, 40, 0.6);
    border-bottom: 1px solid rgba(85, 255, 255, 0.06);
    padding: 1rem 1.25rem;
    color: var(--text-primary);
}

.card-body { padding: 1.25rem; color: var(--text-primary); }

.card-footer {
    background: rgba(21, 21, 40, 0.4);
    border-top: 1px solid rgba(85, 255, 255, 0.06);
    padding: 1rem 1.25rem;
    color: var(--text-primary);
}

.card-title { color: var(--text-primary); }
.card-text { color: var(--text-secondary); }

/* Content Card - Enchanted hover */
.content-card {
    overflow: hidden;
    transition: var(--transition-normal);
    position: relative;
}

.content-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gradient-arcane);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.content-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), var(--shadow-glow-enchant);
    border-color: rgba(123, 104, 238, 0.3);
}

.content-card:hover::before { opacity: 1; }

.content-card .card-img-top {
    height: 180px;
    object-fit: cover;
    border-bottom: 1px solid var(--border-color);
    transition: transform 0.5s ease;
}

.content-card:hover .card-img-top {
    transform: scale(1.05);
}

.content-card .card-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.content-card .price { font-weight: 700; color: var(--hytale-gold); }
.content-card .price.free { color: var(--hytale-emerald); }

/* ============================================
   HERO SECTION - Mystical Portal
   ============================================ */
.hero {
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 7rem 0 5rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse 800px 600px at center 30%, rgba(123, 104, 238, 0.12) 0%, transparent 70%),
        radial-gradient(ellipse 600px 400px at 20% 70%, rgba(85, 255, 255, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 500px 500px at 80% 50%, rgba(255, 107, 53, 0.06) 0%, transparent 60%);
    pointer-events: none;
    animation: runeGlow 6s ease-in-out infinite;
}

/* Mystical portal ring */
.hero::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 600px; height: 600px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid rgba(123, 104, 238, 0.08);
    box-shadow:
        0 0 60px rgba(123, 104, 238, 0.05),
        inset 0 0 60px rgba(85, 255, 255, 0.03);
    animation: portalSpin 30s linear infinite;
    pointer-events: none;
}

.hero h1 {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    position: relative;
    animation: fadeInUp 0.8s ease;
}

.hero h1 span {
    background: var(--gradient-orange);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 620px;
    margin: 0 auto 2.5rem;
    animation: fadeInUp 0.8s ease 0.15s both;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease 0.3s both;
}

/* ============================================
   SECTIONS
   ============================================ */
.main-content {
    padding-top: 76px;
    min-height: calc(100vh - 200px);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    position: relative;
    letter-spacing: 1px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--gradient-arcane);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(123, 104, 238, 0.3);
}

.section-subtitle {
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Stats */
.stats-row {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 3rem 0;
}

/* Hero Announcement */
.hero-announcement {
    max-width: 1000px;
    margin: 2.5rem auto 0;
    animation: fadeInUp 0.8s ease 0.3s both;
}

.hero-announcement .alert {
    background: rgba(26, 26, 48, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(85, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    padding: 1.25rem 1.5rem;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.hero-announcement .alert::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(85, 255, 255, 0.03), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hero-announcement .alert:hover {
    border-color: rgba(85, 255, 255, 0.25);
    box-shadow: var(--shadow-glow-cyan);
}

.hero-announcement .alert:hover::before { opacity: 1; }

.hero-announcement .alert-info {
    border-color: rgba(85, 255, 255, 0.2);
    background: rgba(26, 26, 48, 0.7);
}

.hero-announcement .alert-success {
    border-color: rgba(46, 204, 113, 0.2);
    background: rgba(26, 48, 38, 0.7);
}

.hero-announcement .alert-warning {
    border-color: rgba(255, 170, 0, 0.2);
    background: rgba(48, 38, 26, 0.7);
}

.hero-announcement .alert-danger {
    border-color: rgba(255, 85, 85, 0.2);
    background: rgba(48, 26, 26, 0.7);
}

.hero-announcement .btn-dark {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    backdrop-filter: blur(4px);
    transition: var(--transition-normal);
}

.hero-announcement .btn-dark:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(85, 255, 255, 0.3);
    box-shadow: var(--shadow-glow-cyan);
}

.hero-stats {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1rem !important;
    margin-top: 2.5rem;
    width: 100% !important;
    max-width: 1000px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    animation: fadeInUp 0.8s ease 0.45s both;
}

.stat-block {
    background: rgba(26, 26, 48, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(85, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1rem;
    text-align: center;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-block::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(85, 255, 255, 0.03), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-block:hover {
    transform: translateY(-5px);
    border-color: rgba(85, 255, 255, 0.25);
    box-shadow: var(--shadow-glow-cyan);
}

.stat-block:hover::before { opacity: 1; }

.pixel-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
    transition: transform 0.3s ease;
}

.stat-block:hover .pixel-icon {
    transform: scale(1.15);
    filter: drop-shadow(0 0 6px currentColor);
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    line-height: 1;
    background: var(--gradient-orange);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

/* ============================================
   SERVER CARDS - Enchanted
   ============================================ */
.server-list {
    display: grid;
    gap: 1rem;
}

.server-card {
    background: rgba(26, 26, 48, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(85, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.server-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--hytale-cyan), var(--hytale-arcane), var(--hytale-orange));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.server-card:hover {
    transform: translateY(-3px);
    border-color: rgba(85, 255, 255, 0.2);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(85, 255, 255, 0.05);
}

.server-card:hover::before { opacity: 1; }

.server-card.sponsored {
    border-color: rgba(255, 170, 0, 0.3);
    border-left: 3px solid var(--hytale-gold);
    background: linear-gradient(135deg, rgba(255, 170, 0, 0.04), rgba(26, 26, 48, 0.7));
}

.server-card .rank {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-muted);
    min-width: 45px;
    text-align: center;
}

.server-card .rank.top-3 { color: var(--hytale-gold); }

.server-card .server-info { flex: 1; }

.server-card .server-name {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    color: var(--text-primary);
}

.server-card .server-ip {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.server-card .server-stats {
    display: flex;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.server-card .status {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-family: var(--font-body);
}

.server-card .status-online, .server-card .online { color: var(--hytale-emerald); }
.server-card .status-offline, .server-card .offline { color: var(--hytale-red); }
.server-card .status i { font-size: 0.5rem; }

/* Live status update pulse animation */
.status-updated {
    animation: statusPulse 0.6s ease;
}
@keyframes statusPulse {
    0% { opacity: 1; }
    30% { opacity: 0.4; color: var(--hytale-cyan); }
    100% { opacity: 1; }
}

/* Latency indicators */
.server-latency {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}
.latency-good { color: var(--hytale-emerald); background: rgba(46, 204, 113, 0.1); }
.latency-ok { color: var(--hytale-gold); background: rgba(255, 170, 0, 0.1); }
.latency-bad { color: var(--hytale-red); background: rgba(255, 85, 85, 0.1); }

/* Online status dot pulse */
.status-badge-compact.online i,
.server-status-badge.online i {
    animation: onlinePulse 2s infinite;
}
@keyframes onlinePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.server-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-body);
}

.server-status.online {
    background: rgba(46, 204, 113, 0.15);
    color: var(--hytale-emerald);
    border: 1px solid rgba(46, 204, 113, 0.25);
}

.server-status.offline {
    background: rgba(255, 85, 85, 0.15);
    color: var(--hytale-red);
    border: 1px solid rgba(255, 85, 85, 0.25);
}

.server-status .status-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.server-status.online .status-dot { animation: pulse 2s infinite; }

.server-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.server-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.server-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.server-detail i { color: var(--hytale-cyan); width: 16px; }

.server-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.server-actions {
    display: flex;
    gap: 0.5rem;
}

.server-actions .btn {
    padding: 0.45rem 1rem;
    font-size: 0.85rem;
}

.server-type-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.server-type-badge.survival { background: rgba(46, 204, 113, 0.15); color: var(--hytale-emerald); }
.server-type-badge.rpg { background: rgba(123, 104, 238, 0.15); color: var(--hytale-arcane); }
.server-type-badge.minigames { background: rgba(58, 123, 213, 0.15); color: var(--hytale-blue); }
.server-type-badge.factions { background: rgba(255, 85, 85, 0.15); color: var(--hytale-red); }
.server-type-badge.network { background: rgba(255, 170, 0, 0.15); color: var(--hytale-gold); }

.server-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.5rem;
}

.server-tag {
    padding: 0.1rem 0.5rem;
    background: rgba(123, 104, 238, 0.1);
    color: var(--hytale-arcane);
    border: 1px solid rgba(123, 104, 238, 0.15);
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-sponsored {
    background: var(--gradient-orange);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    animation: glowPulse 2s ease-in-out infinite;
}

.server-rank {
    position: absolute;
    top: 0.75rem; right: 0.75rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.8rem;
}

.server-rank.top-3 { background: var(--gradient-orange); }

.server-banner {
    border-radius: var(--radius-sm);
    transition: transform 0.3s ease;
}

.server-banner:hover { transform: scale(1.03); }

.server-ping { font-size: 0.75rem; font-weight: 600; }
.server-ping.excellent { color: var(--hytale-emerald); }
.server-ping.good { color: var(--hytale-gold); }
.server-ping.poor { color: var(--hytale-red); }

/* ============================================
   FORMS - Arcane Input
   ============================================ */
.form-control,
.form-select {
    font-family: var(--font-body);
    background: rgba(21, 21, 40, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    padding: 0.65rem 1rem;
    transition: var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
    background: rgba(21, 21, 40, 0.95);
    border-color: var(--hytale-arcane);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(123, 104, 238, 0.12), 0 0 20px rgba(123, 104, 238, 0.08);
    outline: none;
}

.form-control::placeholder { color: var(--text-muted); }

.form-label {
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

.form-check-input {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
}

.form-check-input:checked {
    background-color: var(--hytale-arcane);
    border-color: var(--hytale-arcane);
}

.input-group-text {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* ============================================
   ALERTS - Enchanted
   ============================================ */
.alert {
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 500;
    backdrop-filter: blur(8px);
}

.alert-orange {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.12), rgba(255, 170, 0, 0.08));
    border: 1px solid rgba(255, 107, 53, 0.25);
    color: var(--hytale-orange);
}

.alert-info {
    background: linear-gradient(135deg, rgba(85, 255, 255, 0.1), rgba(58, 123, 213, 0.08));
    border: 1px solid rgba(85, 255, 255, 0.2);
    color: var(--hytale-cyan);
}

.alert-success {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.1), rgba(46, 204, 113, 0.06));
    border: 1px solid rgba(46, 204, 113, 0.2);
    color: var(--hytale-emerald);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(255, 170, 0, 0.1), rgba(255, 170, 0, 0.06));
    border: 1px solid rgba(255, 170, 0, 0.2);
    color: var(--hytale-gold);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(255, 85, 85, 0.1), rgba(255, 85, 85, 0.06));
    border: 1px solid rgba(255, 85, 85, 0.2);
    color: var(--hytale-red);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    font-weight: 600;
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
}

.badge-verified {
    background: rgba(85, 255, 255, 0.15);
    color: var(--hytale-cyan);
    border: 1px solid rgba(85, 255, 255, 0.2);
}

.badge-featured {
    background: var(--gradient-orange);
    color: white;
}

/* Rank badges */
.rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.15rem 0.5rem;
    font-weight: 700;
    font-size: 0.65rem;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
}

.rank-badge-vip { background: linear-gradient(135deg, rgba(85, 255, 85, 0.2), rgba(0, 170, 0, 0.15)); color: var(--hytale-green); }
.rank-badge-mvp { background: linear-gradient(135deg, rgba(85, 255, 255, 0.2), rgba(0, 170, 170, 0.15)); color: var(--hytale-cyan); }
.rank-badge-pro { background: linear-gradient(135deg, rgba(255, 85, 255, 0.2), rgba(170, 0, 170, 0.15)); color: var(--hytale-magenta); }
.rank-badge-admin { background: linear-gradient(135deg, rgba(255, 85, 85, 0.2), rgba(170, 0, 0, 0.15)); color: var(--hytale-red); }

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    margin: 2rem 0;
}

.pagination .page-item .page-link {
    background: rgba(26, 26, 48, 0.7);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.pagination .page-item .page-link:hover {
    background: rgba(123, 104, 238, 0.1);
    border-color: var(--hytale-arcane);
    color: var(--text-primary);
}

.pagination .page-item.active .page-link {
    background: var(--gradient-arcane);
    border-color: transparent;
    color: white;
    box-shadow: 0 0 15px rgba(123, 104, 238, 0.3);
}

/* ============================================
   FOOTER - Mystical
   ============================================ */
.footer {
    background: linear-gradient(180deg, var(--bg-primary), rgba(14, 14, 26, 1));
    border-top: 1px solid rgba(85, 255, 255, 0.06);
    padding: 4rem 0 2rem;
    margin-top: 4rem;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(123, 104, 238, 0.3), rgba(85, 255, 255, 0.3), rgba(123, 104, 238, 0.3), transparent);
}

.footer h5, .footer h6, .footer h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-family: var(--font-heading);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li { margin-bottom: 0.5rem; }

.footer-links a {
    color: var(--text-muted);
    transition: var(--transition-fast);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--hytale-cyan);
    padding-left: 4px;
}

.social-links {
    display: flex;
    gap: 0.75rem;
}

.social-link {
    width: 40px; height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(26, 26, 48, 0.7);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.social-link:hover {
    background: var(--hytale-arcane);
    border-color: var(--hytale-arcane);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(123, 104, 238, 0.3);
}

.footer-divider {
    border-color: rgba(85, 255, 255, 0.06);
    margin: 2rem 0;
}

.footer-bottom {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-brand {
    font-family: var(--font-display);
    font-size: 1.4rem;
}

/* ============================================
   UTILITIES
   ============================================ */
.bg-gradient-orange { background: var(--gradient-orange); }
.bg-gradient-cyan { background: var(--gradient-cyan); }
.bg-gradient-purple { background: var(--gradient-purple); }

.glow-orange { box-shadow: var(--shadow-glow-orange); }
.glow-cyan { box-shadow: var(--shadow-glow-cyan); }
.glow-purple { box-shadow: var(--shadow-glow-purple); }

/* Enchanted border animation */
.enchanted-border {
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
}

.enchanted-border::before {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    background: linear-gradient(45deg, var(--hytale-cyan), var(--hytale-arcane), var(--hytale-emerald), var(--hytale-cyan));
    background-size: 300% 300%;
    border-radius: inherit;
    z-index: -1;
    animation: enchantedBorder 4s ease infinite;
    opacity: 0.5;
}

/* Mystic glow card */
.mystic-card {
    position: relative;
    transition: var(--transition-normal);
}

.mystic-card:hover {
    box-shadow: 0 0 30px rgba(123, 104, 238, 0.15), 0 0 60px rgba(85, 255, 255, 0.05);
}

/* Pro banner */
.pro-banner {
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.pro-banner::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 200%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    animation: enchantShimmer 4s linear infinite;
}

.pro-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(123, 104, 238, 0.2);
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-md);
}

/* Animate on scroll */
.animate-fade-in { animation: fadeInUp 0.6s ease forwards; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }

/* List items */
.list-group-item {
    color: var(--text-primary);
    background-color: transparent;
    border-color: var(--border-color);
}

/* 3D Viewer */
.viewer-container {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.viewer-canvas { width: 100%; height: 400px; display: block; }

/* ============================================
   CUSTOM SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--bg-card-hover), var(--border-color));
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--hytale-arcane); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 992px) {
    .hero h1 { font-size: 2.5rem; }
    .hero p { font-size: 1.05rem; }

    .navbar-collapse {
        background: rgba(20, 20, 40, 0.97);
        backdrop-filter: blur(20px);
        padding: 1rem;
        border-radius: var(--radius-lg);
        margin-top: 0.75rem;
        border: 1px solid var(--border-color);
    }

    .search-box { width: 100%; margin: 0.75rem 0; }
    .search-box input, .search-box input:focus { width: 100%; }

    .hero-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        min-width: auto !important;
    }
}

@media (max-width: 768px) {
    .hero { min-height: 70vh; padding: 5rem 0 3rem; }
    .hero h1 { font-size: 2rem; }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .hero-buttons .btn { width: 100%; max-width: 300px; }

    .server-card { flex-wrap: wrap; }

    .section-header {
        flex-direction: column;
        text-align: center;
    }

    .section-title::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .server-details { grid-template-columns: 1fr; }
    .server-stats { flex-direction: column; align-items: flex-start; }
    .server-actions { width: 100%; }
    .server-actions .btn { flex: 1; text-align: center; }
}

@media (max-width: 576px) {
    h1, .h1 { font-size: 1.8rem; }
    .stat-value { font-size: 1.6rem; }
    .featured-grid { grid-template-columns: 1fr; }

    .hero-stats {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ============================================
   INLINE LAYOUT OVERRIDES (from main.php)
   ============================================ */
body { color: var(--text-primary); }
.card, .card-body, .card-header, .card-footer { color: var(--text-primary); }
.list-group-item { color: var(--text-primary); background: transparent; }
a:not(.btn) { color: var(--hytale-cyan); }
a:not(.btn):hover { color: var(--hytale-gold); }
h1, h2, h3, h4, h5, h6 { color: var(--text-primary); }
.dropdown-menu { color: var(--text-primary); }
.dropdown-item { color: var(--text-secondary); }
.dropdown-item:hover { color: var(--text-primary); background: rgba(85, 255, 255, 0.08); }
.form-control, .form-select { color: var(--text-primary); }
.form-control::placeholder { color: var(--text-muted); }
input, textarea, select { color: var(--text-primary); }
