/**
 * ThunderOT Main Stylesheet
 * 
 * Custom CSS to complement Tailwind CSS
 * Thunder/Fantasy MMORPG theme with modern dark UI
 */

/* ================================
   CSS Variables
   ================================ */
:root {
    --thunder-dark: #070A12;
    --thunder-darker: #040609;
    --thunder-card: #0B1220;
    --thunder-card-hover: #0F1829;
    --thunder-border: rgba(148, 163, 184, 0.18);

    --electric-blue: #3B82F6;
    --electric-blue-dark: #2563EB;
    --electric-blue-light: #60A5FA;

    --cyan-glow: #22D3EE;
    --cyan-dark: #0891B2;

    --purple-arcane: #A78BFA;
    --purple-dark: #7C3AED;

    --gold-loot: #FBBF24;
    --gold-light: #FCD34D;

    --thunder-success: #22C55E;
    --thunder-danger: #EF4444;
    --thunder-warning: #F59E0B;
    --thunder-info: #3B82F6;

    --thunder-text: #E5E7EB;
    --thunder-muted: #94A3B8;
    --thunder-subtle: #64748B;
}

/* ================================
   Global Styles
   ================================ */
html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--thunder-dark);
    color: var(--thunder-text);
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--thunder-darker);
}

::-webkit-scrollbar-thumb {
    background: var(--thunder-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--electric-blue);
}

/* Selection */
::selection {
    background: var(--electric-blue);
    color: white;
}

/* ================================
   Typography
   ================================ */
.text-gradient {
    background: linear-gradient(135deg, var(--electric-blue) 0%, var(--cyan-glow) 50%, var(--purple-arcane) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-gold {
    background: linear-gradient(135deg, var(--gold-loot) 0%, var(--gold-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ================================
   Cards & Containers
   ================================ */
.thunder-card {
    background: linear-gradient(180deg, rgba(11, 18, 32, 0.9) 0%, rgba(7, 10, 18, 0.95) 100%);
    border: 1px solid var(--thunder-border);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.thunder-card:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

.thunder-card-neon {
    position: relative;
    background: var(--thunder-card);
    border: 1px solid transparent;
    border-radius: 12px;
    overflow: hidden;
}

.thunder-card-neon::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    padding: 1px;
    background: linear-gradient(135deg, var(--electric-blue) 0%, var(--cyan-glow) 50%, var(--purple-arcane) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.thunder-card-neon:hover::before {
    opacity: 1;
}

/* ================================
   Buttons
   ================================ */
.btn-primary {
    background: linear-gradient(135deg, var(--electric-blue) 0%, var(--electric-blue-dark) 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5), 0 0 40px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--thunder-text);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid var(--thunder-border);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--electric-blue);
    color: var(--electric-blue);
}

.btn-cyan {
    background: linear-gradient(135deg, var(--cyan-glow) 0%, var(--cyan-dark) 100%);
    color: var(--thunder-dark);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-cyan:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.5), 0 0 40px rgba(34, 211, 238, 0.3);
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold-loot) 0%, var(--gold-light) 100%);
    color: var(--thunder-dark);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 700;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.5), 0 0 40px rgba(251, 191, 36, 0.3);
}

/* ================================
   Form Elements
   ================================ */
.input-thunder {
    width: 100%;
    background: rgba(7, 10, 18, 0.8);
    border: 1px solid var(--thunder-border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--thunder-text);
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.input-thunder:focus {
    outline: none;
    border-color: var(--electric-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.input-thunder::placeholder {
    color: var(--thunder-subtle);
}

.select-thunder {
    width: 100%;
    background: rgba(7, 10, 18, 0.8);
    border: 1px solid var(--thunder-border);
    border-radius: 8px;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    color: var(--thunder-text);
    font-size: 0.875rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

.select-thunder:focus {
    outline: none;
    border-color: var(--electric-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* ================================
   Tables
   ================================ */
.thunder-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.thunder-table thead {
    background: rgba(11, 18, 32, 0.8);
    position: sticky;
    top: 0;
    z-index: 10;
}

.thunder-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--thunder-muted);
    border-bottom: 1px solid var(--thunder-border);
}

.thunder-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--thunder-border);
    transition: background-color 0.2s ease;
}

.thunder-table tbody tr:hover td {
    background: rgba(59, 130, 246, 0.05);
}

.thunder-table tbody tr:last-child td {
    border-bottom: none;
}

/* ================================
   Badges
   ================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-blue {
    background: rgba(59, 130, 246, 0.2);
    color: var(--electric-blue-light);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-cyan {
    background: rgba(34, 211, 238, 0.2);
    color: var(--cyan-glow);
    border: 1px solid rgba(34, 211, 238, 0.3);
}

.badge-purple {
    background: rgba(167, 139, 250, 0.2);
    color: var(--purple-arcane);
    border: 1px solid rgba(167, 139, 250, 0.3);
}

.badge-gold {
    background: rgba(251, 191, 36, 0.2);
    color: var(--gold-loot);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge-success {
    background: rgba(34, 197, 94, 0.2);
    color: var(--thunder-success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--thunder-danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Vocation Badges */
.badge-knight {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-paladin {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-sorcerer {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-druid {
    background: rgba(167, 139, 250, 0.2);
    color: #c4b5fd;
    border: 1px solid rgba(167, 139, 250, 0.3);
}

/* ================================
   Lightning Effects
   ================================ */
.lightning-flash {
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
    opacity: 0;
    z-index: 100;
}

.lightning-flash.active {
    animation: lightning-flash 0.15s ease-out;
}

@keyframes lightning-flash {
    0% {
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    20% {
        opacity: 0.3;
    }

    30% {
        opacity: 0.8;
    }

    100% {
        opacity: 0;
    }
}

/* Lightning Bolt SVG Effect */
.lightning-bolt {
    position: absolute;
    stroke: var(--electric-blue);
    stroke-width: 2;
    fill: none;
    filter: drop-shadow(0 0 10px var(--electric-blue)) drop-shadow(0 0 20px var(--cyan-glow));
    opacity: 0;
}

.lightning-bolt.strike {
    animation: bolt-strike 0.3s ease-out;
}

@keyframes bolt-strike {
    0% {
        opacity: 0;
        stroke-width: 1;
    }

    10% {
        opacity: 1;
        stroke-width: 3;
    }

    30% {
        opacity: 0.8;
        stroke-width: 2;
    }

    60% {
        opacity: 0.4;
        stroke-width: 1;
    }

    100% {
        opacity: 0;
        stroke-width: 0;
    }
}

/* ================================
   Glow Effects
   ================================ */
.glow-blue {
    filter: drop-shadow(0 0 10px var(--electric-blue));
}

.glow-cyan {
    filter: drop-shadow(0 0 10px var(--cyan-glow));
}

.glow-purple {
    filter: drop-shadow(0 0 10px var(--purple-arcane));
}

.glow-gold {
    filter: drop-shadow(0 0 10px var(--gold-loot));
}

/* Animated Glow Border */
.glow-border {
    position: relative;
}

.glow-border::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, var(--electric-blue), var(--cyan-glow), var(--purple-arcane), var(--electric-blue));
    background-size: 400% 400%;
    border-radius: inherit;
    z-index: -1;
    animation: glow-border-animation 3s linear infinite;
    opacity: 0.5;
    filter: blur(8px);
}

@keyframes glow-border-animation {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ================================
   Navigation Styles
   ================================ */
.nav-link {
    position: relative;
    color: var(--thunder-muted);
    padding: 0.5rem 0;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--thunder-text);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--electric-blue), var(--cyan-glow));
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Dropdown Menu */
.dropdown-menu {
    background: var(--thunder-card);
    border: 1px solid var(--thunder-border);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    min-width: 200px;
}

.dropdown-item {
    display: block;
    padding: 0.625rem 1rem;
    color: var(--thunder-muted);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--thunder-text);
}

/* ================================
   Hero Section
   ================================ */
.hero-bg {
    background: linear-gradient(180deg, transparent 0%, var(--thunder-dark) 100%),
        url('../images/hero-bg.jpg') center center / cover no-repeat;
}

.hero-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 0%, transparent 70%);
    filter: blur(60px);
    pointer-events: none;
}

/* ================================
   Animations
   ================================ */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Pulse Animation for Online Indicator */
.pulse-online {
    animation: pulse-online 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-online {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* ================================
   Particles Effect
   ================================ */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--electric-blue);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.6;
    animation: float-particle 15s infinite linear;
}

@keyframes float-particle {
    0% {
        transform: translateY(100vh) translateX(0) scale(0);
        opacity: 0;
    }

    10% {
        opacity: 0.6;
        transform: scale(1);
    }

    90% {
        opacity: 0.6;
    }

    100% {
        transform: translateY(-100vh) translateX(100px) scale(0);
        opacity: 0;
    }
}

/* ================================
   Utility Classes
   ================================ */
.glass {
    background: rgba(11, 18, 32, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid var(--thunder-border);
}

.glass-dark {
    background: rgba(7, 10, 18, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--thunder-border);
}

.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--thunder-border), transparent);
}

.divider-glow {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--electric-blue), transparent);
    box-shadow: 0 0 10px var(--electric-blue);
}

/* ================================
   Responsive Utilities
   ================================ */
@media (max-width: 768px) {
    .thunder-table {
        display: block;
        overflow-x: auto;
    }

    .thunder-card {
        border-radius: 8px;
    }
}

/* ================================
   Loading States
   ================================ */
.skeleton {
    background: linear-gradient(90deg, var(--thunder-card) 0%, var(--thunder-card-hover) 50%, var(--thunder-card) 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ================================
   Tooltip
   ================================ */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 0.5rem 0.75rem;
    background: var(--thunder-card);
    border: 1px solid var(--thunder-border);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--thunder-text);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 100;
}

[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
}

/* ================================
   Scroll / Parchment Cards
   ================================ */
.scroll-card {
    position: relative;
    background: linear-gradient(145deg,
            rgba(45, 35, 25, 0.95) 0%,
            rgba(35, 28, 20, 0.9) 50%,
            rgba(30, 24, 18, 0.95) 100%);
    border: 2px solid rgba(139, 109, 76, 0.4);
    border-radius: 4px;
    padding: 1.5rem;
    overflow: hidden;
    transition: all 0.4s ease;
}

/* Parchment texture overlay */
.scroll-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)' opacity='0.08'/%3E%3C/svg%3E");
    pointer-events: none;
    opacity: 0.5;
}

/* Corner decorations */
.scroll-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid rgba(251, 191, 36, 0.1);
    border-radius: 4px;
    pointer-events: none;
}

/* Top scroll edge */
.scroll-card .scroll-edge-top {
    position: absolute;
    top: -2px;
    left: 10%;
    right: 10%;
    height: 8px;
    background: linear-gradient(to bottom,
            rgba(80, 65, 45, 1) 0%,
            rgba(60, 48, 35, 1) 50%,
            transparent 100%);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

/* Bottom scroll edge */
.scroll-card .scroll-edge-bottom {
    position: absolute;
    bottom: -2px;
    left: 10%;
    right: 10%;
    height: 8px;
    background: linear-gradient(to top,
            rgba(80, 65, 45, 1) 0%,
            rgba(60, 48, 35, 1) 50%,
            transparent 100%);
    border-radius: 0 0 50% 50% / 0 0 100% 100%;
}

/* Lightning decorations on scroll */
.scroll-card .lightning-deco {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.scroll-card:hover .lightning-deco {
    opacity: 1;
}

/* Left lightning bolt */
.scroll-card .lightning-left {
    position: absolute;
    left: -5px;
    top: 20%;
    width: 30px;
    height: 60%;
    background: linear-gradient(180deg,
            transparent 0%,
            rgba(59, 130, 246, 0.3) 20%,
            rgba(34, 211, 238, 0.5) 50%,
            rgba(59, 130, 246, 0.3) 80%,
            transparent 100%);
    filter: blur(8px);
    animation: lightning-pulse 2s ease-in-out infinite;
}

/* Right lightning bolt */
.scroll-card .lightning-right {
    position: absolute;
    right: -5px;
    top: 10%;
    width: 30px;
    height: 80%;
    background: linear-gradient(180deg,
            transparent 0%,
            rgba(34, 211, 238, 0.3) 30%,
            rgba(59, 130, 246, 0.5) 60%,
            transparent 100%);
    filter: blur(8px);
    animation: lightning-pulse 2s ease-in-out infinite 0.5s;
}

@keyframes lightning-pulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }
}

/* Hover glow effect */
.scroll-card:hover {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow:
        0 0 20px rgba(59, 130, 246, 0.2),
        0 0 40px rgba(34, 211, 238, 0.1),
        inset 0 0 30px rgba(59, 130, 246, 0.05);
    transform: translateY(-3px);
}

/* Inner glow on hover */
.scroll-card:hover::after {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: inset 0 0 20px rgba(59, 130, 246, 0.1);
}

/* Thunder rune decoration */
.scroll-rune {
    position: absolute;
    width: 40px;
    height: 40px;
    opacity: 0.15;
    transition: opacity 0.4s ease;
}

.scroll-rune-tl {
    top: 8px;
    left: 8px;
}

.scroll-rune-br {
    bottom: 8px;
    right: 8px;
    transform: rotate(180deg);
}

.scroll-card:hover .scroll-rune {
    opacity: 0.4;
    filter: drop-shadow(0 0 5px var(--electric-blue));
}

/* News scroll specific */
.news-scroll-icon {
    position: relative;
    z-index: 1;
}

.news-scroll-icon::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 12px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.scroll-card:hover .news-scroll-icon::before {
    opacity: 1;
}

/* Floating lightning sparks */
@keyframes spark-float {

    0%,
    100% {
        transform: translateY(0) scale(1);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-20px) scale(0);
        opacity: 0;
    }
}

.lightning-spark {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--cyan-glow);
    border-radius: 50%;
    pointer-events: none;
    animation: spark-float 2s ease-in-out infinite;
}