/* ========================================= */
/*           SCUMHUB BASE STYLES            */
/* ========================================= */

/* ========================================= */
/*           CSS CUSTOM PROPERTIES          */
/* ========================================= */
:root {
    /* Primary Colors */
    --accent-primary: #ff6b35;
    --accent-secondary: #0066cc;
    --accent-purple: #8b5cf6;
    --accent-warning: #ffaa00;
    --accent-danger: #ff4444;
    
    /* Background Colors */
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #404040;
    --bg-card: #252525;
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #888888;
    
    /* Border Colors */
    --border-color: #404040;
    --border-light: #505050;
    
    /* Status Colors */
    --status-online: #00ff88;
    --status-offline: #ff4444;
    --status-away: #ffaa00;
    
    /* Shadows */
    --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.2);
    --shadow-heavy: 0 8px 30px rgba(0, 0, 0, 0.3);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-xxl: 3rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-round: 50%;
    
    /* Typography */
    --font-family-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-family-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    
    /* Z-Index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 1080;
}

/* ========================================= */
/*           RESET & NORMALIZE              */
/* ========================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family-base);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ========================================= */
/*           TYPOGRAPHY                     */
/* ========================================= */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    margin: 0;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin: 0 0 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-normal);
}

a:hover {
    color: #fff;
}

strong, b {
    font-weight: 700;
    color: var(--text-primary);
}

em, i {
    font-style: italic;
}

code {
    font-family: var(--font-family-mono);
    font-size: 0.875rem;
    background: var(--bg-secondary);
    color: var(--accent-primary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

pre {
    font-family: var(--font-family-mono);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    overflow-x: auto;
    line-height: 1.4;
}

/* ========================================= */
/*           LAYOUT COMPONENTS              */
/* ========================================= */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 200px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.subtitle.gradient-glow {
    background: linear-gradient(45deg, #ff6b35, #ffb300, #ff6b35);
    background-size: 200% 200%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    animation: gradientFlow 3s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(255, 107, 53, 0.6));
    margin-top: 0.25rem;
}

@keyframes gradientFlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ========================================= */
/*           UTILITY CLASSES                */
/* ========================================= */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-mono { font-family: var(--font-family-mono); }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========================================= */
/*           LOADING STATES                 */
/* ========================================= */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-secondary);
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loading-spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffb300;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.auth-loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================= */
/*           FORM ELEMENTS                  */
/* ========================================= */
input, textarea, select {
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
}

button {
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    color: inherit;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ========================================= */
/*           TAB CONTENT                    */
/* ========================================= */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { 
        opacity: 0;
        transform: translateY(10px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* ========================================= */
/*           TABLES                         */
/* ========================================= */
.server-table-container {
    overflow-x: auto;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-medium);
}

.server-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 1000px;
}

.server-table th {
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 700;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.server-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.server-table tbody tr {
    background: var(--bg-card);
    transition: all var(--transition-normal);
    cursor: pointer;
}

.server-table tbody tr:hover {
    background: var(--bg-secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-light);
}

/* ========================================= */
/*           SERVER CARDS                   */
/* ========================================= */
.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.server-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
}

.server-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-heavy);
    border-color: var(--accent-primary);
}

/* ========================================= */
/*           BADGES & FLAGS                 */
/* ========================================= */
.flag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0.125rem;
    transition: all var(--transition-normal);
}

/* Flag Colors */
.flag.pvp {
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
    border: 1px solid rgba(255, 68, 68, 0.3);
}

.flag.pve {
    background: rgba(255, 107, 53, 0.2);
    color: var(--accent-primary);
    border: 1px solid rgba(255, 107, 53, 0.3);
}

.flag.roleplay {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.flag.modded {
    background: rgba(255, 170, 0, 0.2);
    color: #ffaa00;
    border: 1px solid rgba(255, 170, 0, 0.3);
}

.flag.vanilla {
    background: rgba(0, 102, 204, 0.2);
    color: var(--accent-secondary);
    border: 1px solid rgba(0, 102, 204, 0.3);
}

.flag.beginner_friendly {
    background: rgba(72, 187, 120, 0.2);
    color: #ffb300;
    border: 1px solid rgba(72, 187, 120, 0.3);
}

.flag.high_pop {
    background: rgba(237, 137, 54, 0.2);
    color: #ed8936;
    border: 1px solid rgba(237, 137, 54, 0.3);
}

/* ========================================= */
/*           STATUS INDICATORS              */
/* ========================================= */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-online .status-dot {
    background: var(--status-online);
    box-shadow: 0 0 10px var(--status-online);
}

.status-offline .status-dot {
    background: var(--status-offline);
    box-shadow: 0 0 10px var(--status-offline);
}

/* ========================================= */
/*           PLAYERS BAR                    */
/* ========================================= */
.players-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.25rem;
}

.players-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), #fff);
    border-radius: 2px;
    transition: width var(--transition-normal);
}

/* ========================================= */
/*           RATING STARS                   */
/* ========================================= */
.rating-stars {
    color: var(--accent-warning);
    font-size: 0.875rem;
    letter-spacing: 1px;
    line-height: 1;
}

/* ========================================= */
/*           RESPONSIVE HELPERS             */
/* ========================================= */
@media (max-width: 768px) {
    .main-container {
        padding: 1rem;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    .server-grid {
        grid-template-columns: 1fr;
    }
    
    .server-table {
        font-size: 0.8rem;
    }
    
    .server-table th,
    .server-table td {
        padding: 0.75rem 0.5rem;
    }
}

/* ========================================= */
/*           ACCESSIBILITY                  */
/* ========================================= */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (prefers-contrast: high) {
    :root {
        --border-color: #666666;
        --bg-secondary: #333333;
    }
}

/* ========================================= */
/*           PRINT STYLES                   */
/* ========================================= */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .header,
    .tab-navigation,
    .filter-bar,
    .site-footer {
        display: none;
    }
    
    .main-container {
        padding: 0;
        max-width: none;
    }
}