/**
 * RAN Asgard Online - Main Stylesheet
 * Professional Grade AAAAA+
 * 
 * @author RAN Asgard Team
 * @version 1.0.0
 */

/* ========================================
   CSS Variables
======================================== */
:root {
    --gold: #d4a853;
    --gold-light: #f5d799;
    --gold-dark: #8b6914;
    --dark-bg: #0a0a0f;
    --dark-card: #12121a;
    --dark-border: #1f1f2e;
    --text-primary: #ffffff;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    --text-dark: #6b7280;
    --green: #22c55e;
    --green-dark: #16a34a;
    --blue: #3498db;
    --red: #e74c3c;
    --purple: #9b59b6;
}

/* ========================================
   Reset & Base Styles
======================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--dark-bg);
    color: var(--text-primary);
    font-family: 'Kanit', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.6;
}

/* ========================================
   Typography
======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ========================================
   Utility Classes
======================================== */
.text-gold { color: var(--gold); }
.text-white { color: var(--text-primary); }
.text-gray { color: var(--text-muted); }

.bg-dark { background: var(--dark-bg); }
.bg-card { background: var(--dark-card); }

/* Size utilities */
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }

/* Flexbox */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-8 { gap: 2rem; }

/* Grid */
.grid { display: grid; }

/* ========================================
   Layout
======================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }

/* ========================================
   Protection Styles
======================================== */
.no-select {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

img {
    -webkit-user-drag: none;
    user-drag: none;
    pointer-events: none;
}

/* Override for clickable images */
a img,
button img {
    pointer-events: auto;
}

/* Print protection */
@media print {
    body {
        display: none !important;
    }
}

/* ========================================
   Scrollbar Styles
======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--gold-dark);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

/* ========================================
   Selection Styles
======================================== */
::selection {
    background: rgba(212, 168, 83, 0.3);
    color: var(--text-primary);
}

::-moz-selection {
    background: rgba(212, 168, 83, 0.3);
    color: var(--text-primary);
}

/* ========================================
   Particle Background
======================================== */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    background: rgba(212, 168, 83, 0.6);
    border-radius: 50%;
    animation: floatParticle linear infinite;
    opacity: 0;
}

@keyframes floatParticle {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-100px) rotate(720deg);
        opacity: 0;
    }
}

/* ========================================
   Button Styles
======================================== */
button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(to right, var(--gold), var(--gold-dark));
    color: black;
    font-weight: bold;
    padding: 12px 24px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(212, 168, 83, 0.4);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--gold);
    font-weight: bold;
    padding: 12px 24px;
    border: 2px solid var(--gold);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--gold);
    color: black;
    transform: scale(1.05);
}

/* ========================================
   Card Styles
======================================== */
.card {
    background: rgba(18, 18, 26, 0.8);
    border: 1px solid var(--dark-border);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: rgba(212, 168, 83, 0.5);
    transform: translateY(-4px);
}

/* ========================================
   Form Styles
======================================== */
input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
    padding: 12px 16px;
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: 8px;
    color: var(--text-primary);
    transition: all 0.3s ease;
    outline: none;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.1);
}

/* ========================================
   Loading Animation
======================================== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(212, 168, 83, 0.3);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   Responsive Utilities
======================================== */
.desktop-only {
    display: none;
}

.mobile-only {
    display: flex;
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .desktop-only {
        display: flex;
    }
    
    .mobile-only {
        display: none !important;
    }
    
    .lg\:grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .lg\:grid-cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ========================================
   Antialiased Text
======================================== */
.antialiased {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   Backdrop Blur Support
======================================== */
@supports (backdrop-filter: blur(10px)) {
    .backdrop-blur {
        backdrop-filter: blur(10px);
    }
}

/* ========================================
   Z-Index Scale
======================================== */
.z-0 { z-index: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-50 { z-index: 50; }
.z-100 { z-index: 100; }
