/* ===================================
   USL MODERN WEBSITE - MAIN CSS
   =================================== */

:root {
    --color-bg-primary: #0c1219;
    --color-bg-secondary: #111a24;
    --color-bg-tertiary: #1a2536;
    --color-bg-dark: #080d14;
    --color-text-primary: #e5e5e5;
    --color-text-secondary: #b2b2b2;
    --color-text-muted: #999999;
    --color-accent: #5BA3D9;
    --color-accent-hover: #6DB5E8;
    --color-success: #4caf50;
    --color-warning: #ff9800;
    --color-danger: #f44336;
    --color-border: #162030;
    --font-primary: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --border-radius: 8px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-primary);
    background-color: #080d14;
    color: var(--color-text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ===================================
   HEADER & NAVIGATION
   =================================== */
.site-header {
    background: var(--color-bg-dark);
    border-bottom: 3px solid var(--color-accent);
    padding: var(--spacing-lg) 0;
}

.site-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: var(--spacing-md);
    color: var(--color-text-primary);
}

.main-nav {
    background: var(--color-bg-secondary);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(91, 163, 217, 0.06);
}

.nav-list {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px;
}

.nav-list li {
    flex: 1 1 auto;
    min-width: 120px;
}

.nav-list a {
    display: block;
    padding: 12px var(--spacing-md);
    color: #999;
    text-decoration: none;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.nav-list a:hover {
    color: #FFFFFF;
    background: rgba(91, 163, 217, 0.04);
}

.nav-list a.active {
    color: #FFFFFF;
    border-bottom-color: var(--color-accent);
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    background: var(--color-bg-secondary);
    color: white;
    border: none;
    padding: var(--spacing-md);
    width: 100%;
    text-align: left;
    font-size: 1.1rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .site-title {
        font-size: 1.8rem;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .nav-list {
        display: none;
        flex-direction: column;
    }
    
    .nav-list.active {
        display: flex;
    }
    
    .nav-list li {
        width: 100%;
    }
}

/* ===================================
   MAIN CONTENT AREA
   =================================== */
.main-content {
    background: var(--color-bg-primary);
    min-height: calc(100vh - 200px);
    padding: var(--spacing-lg) 0;
}

.page-header {
    margin-bottom: var(--spacing-lg);
}

.page-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: var(--spacing-xs);
    color: #FFFFFF;
    letter-spacing: 0.5px;
}

.page-subtitle {
    font-size: 0.85rem;
    color: #777;
}

/* ===================================
   CARDS & SECTIONS
   =================================== */
.card {
    background: var(--color-bg-secondary);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    border: 1px solid rgba(91, 163, 217, 0.06);
    overflow: hidden;
}

.card:hover {
    border-color: rgba(91, 163, 217, 0.1);
}

.card-header {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    color: #FFFFFF;
    border-bottom: 1px solid rgba(91, 163, 217, 0.08);
    padding-bottom: var(--spacing-sm);
}

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

/* Grid layouts */
.grid {
    display: grid;
    gap: var(--spacing-lg);
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    
    /* Reduce padding on mobile */
    .main-content {
        padding: var(--spacing-md) 0;
    }
    
    .card {
        padding: var(--spacing-md);
        margin-bottom: var(--spacing-md);
    }
    
    .page-title {
        font-size: 1.8rem;
    }
    
    .page-subtitle {
        font-size: 1rem;
    }
}

/* ===================================
   TABLES
   =================================== */
.table-container {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-bg-secondary);
    border-radius: var(--border-radius);
    overflow: hidden;
}

/* Mobile table adjustments */
@media (max-width: 768px) {
    table {
        font-size: 0.85rem;
    }
    
    th, td {
        padding: 10px 8px;
        white-space: nowrap;
    }
}

/* Prevent table overflow */
.card-body {
    overflow: hidden;
}

thead {
    background: rgba(91, 163, 217, 0.03);
}

th {
    padding: 12px var(--spacing-md);
    text-align: left;
    font-weight: 600;
    color: #666;
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(91, 163, 217, 0.08);
    white-space: nowrap;
}

td {
    padding: 12px var(--spacing-md);
    border-bottom: 1px solid rgba(91, 163, 217, 0.04);
}

tr:hover {
    background: rgba(91, 163, 217, 0.02);
}

tr:last-child td {
    border-bottom: none;
}

/* Sortable table headers */
th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 30px;
}

th.sortable:hover {
    color: var(--color-accent-hover);
}

th.sortable::after {
    content: '⇅';
    position: absolute;
    right: 10px;
    opacity: 0.5;
}

th.sortable.asc::after {
    content: '↑';
    opacity: 1;
}

th.sortable.desc::after {
    content: '↓';
    opacity: 1;
}

/* ===================================
   BUTTONS
   =================================== */
.btn {
    display: inline-block;
    padding: 8px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-small {
    padding: 6px 14px;
    font-size: 0.78rem;
}

.btn-primary {
    background: rgba(91, 163, 217, 0.1);
    color: var(--color-accent) !important;
    border: 1px solid rgba(91, 163, 217, 0.25);
}

.btn-primary:hover {
    background: var(--color-accent);
    color: #ffffff !important;
    border-color: var(--color-accent);
}

.btn-secondary {
    background: rgba(91, 163, 217, 0.04);
    color: #888;
    border: 1px solid rgba(91, 163, 217, 0.1);
}

.btn-secondary:hover {
    background: rgba(91, 163, 217, 0.08);
    color: #ccc;
}

/* Force correct text in buttons - override link colors */
.btn a,
.btn-primary a,
a.btn,
a.btn-primary {
    color: var(--color-accent) !important;
    text-decoration: none !important;
}

.btn a:hover,
.btn-primary a:hover,
a.btn:hover,
a.btn-primary:hover {
    color: #ffffff !important;
    text-decoration: none !important;
}

.btn-success {
    background: rgba(76, 175, 80, 0.2);
    color: #66BB6A;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.btn-success:hover {
    background: rgba(76, 175, 80, 0.35);
}

.btn-warning {
    background: rgba(255, 152, 0, 0.2);
    color: #FFA726;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.btn-warning:hover {
    background: rgba(255, 152, 0, 0.35);
}

.btn-danger {
    background: rgba(244, 67, 54, 0.2);
    color: #ef5350;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.btn-danger:hover {
    background: rgba(244, 67, 54, 0.35);
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.2rem;
}

@media (max-width: 768px) {
    .btn {
        width: 100%;
        margin-bottom: var(--spacing-sm);
    }
}

/* ===================================
   FORMS
   =================================== */
.form-group {
    margin-bottom: var(--spacing-md);
}

label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(91, 163, 217, 0.1);
    border-radius: 6px;
    color: var(--color-text-primary);
    font-size: 0.9rem;
    font-family: var(--font-primary);
    transition: border-color 0.2s ease;
}

select {
    padding-right: 30px;
    background: #1a2332;
    color: #e5e5e5;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    background: rgba(0, 0, 0, 0.4);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* ===================================
   STATS & BADGES
   =================================== */
.stat-box {
    text-align: center;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--color-bg-primary);
    border-radius: var(--border-radius);
    border: 1px solid rgba(91, 163, 217, 0.05);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: #FFFFFF;
    line-height: 1;
}

.stat-label {
    font-size: 0.7rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 6px;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: rgba(76, 175, 80, 0.2);
    color: #66BB6A;
}

.badge-warning {
    background: rgba(255, 152, 0, 0.2);
    color: #FFA726;
}

.badge-danger {
    background: rgba(244, 67, 54, 0.2);
    color: #ef5350;
}

.badge-info {
    background: rgba(58, 124, 165, 0.2);
    color: #5ba8d4;
}

.badge-secondary {
    background: rgba(91, 163, 217, 0.08);
    color: #999;
}

/* ===================================
   ALERTS & MESSAGES
   =================================== */
.alert {
    padding: 12px var(--spacing-md);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-md);
    font-size: 0.85rem;
}

.alert-success {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.2);
    color: #66BB6A;
}

.alert-warning {
    background: rgba(255, 152, 0, 0.1);
    border: 1px solid rgba(255, 152, 0, 0.2);
    color: #FFA726;
}

.alert-danger {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.2);
    color: #ef5350;
}

.alert-info {
    background: rgba(58, 124, 165, 0.1);
    border: 1px solid rgba(58, 124, 165, 0.2);
    color: var(--color-accent);
}

/* Dismissible alerts */
.alert-dismissible {
    position: relative;
    padding-right: 50px;
}

.alert-dismiss-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: inherit;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.alert-dismiss-btn:hover {
    opacity: 1;
}

/* ===================================
   COMMUNITY BAR
   =================================== */
.community-bar {
    background: var(--color-bg-primary);
    padding: 0 0 24px;
}

.community-bar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.community-bar-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    background: rgba(91, 163, 217, 0.04);
    color: #aaa;
    border: 1px solid rgba(91, 163, 217, 0.1);
}

.community-bar-item:hover {
    background: rgba(91, 163, 217, 0.08);
    color: #ddd;
    text-decoration: none;
    transform: translateY(-1px);
}

.community-bar-discord {
    background: rgba(88, 101, 242, 0.12);
    color: #7289da;
    border-color: rgba(88, 101, 242, 0.2);
}

.community-bar-discord:hover {
    background: rgba(88, 101, 242, 0.25);
    color: #99aaf5;
}

.community-bar-donate {
    background: rgba(244, 67, 54, 0.1);
    color: #ef5350;
    border-color: rgba(244, 67, 54, 0.2);
}

.community-bar-donate:hover {
    background: rgba(244, 67, 54, 0.2);
    color: #ff7043;
}

@media (max-width: 768px) {
    .community-bar-inner {
        gap: 8px;
    }
    .community-bar-item {
        padding: 7px 14px;
        font-size: 0.75rem;
    }
}

/* ===================================
   FOOTER
   =================================== */
.site-footer {
    background: linear-gradient(180deg, var(--color-bg-primary) 0%, #080d14 40%, #060a10 100%);
    padding: 0;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    position: relative;
}

.footer-glow {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(58, 124, 165, 0.4) 50%, transparent 100%);
}

.footer-inner {
    padding: 32px 0 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.footer-tagline {
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.78rem;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.footer-links a {
    color: rgba(136, 204, 238, 0.4);
    font-size: 0.78rem;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: rgba(136, 204, 238, 0.7);
    text-decoration: none;
}

.footer-link-sep {
    color: rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}

.footer-copy {
    color: rgba(255, 255, 255, 0.15);
    font-size: 0.72rem;
    margin-top: 6px;
}

/* ===================================
   LINKS
   =================================== */
a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-accent-hover);
    text-decoration: underline;
}

a:visited {
    color: var(--color-accent);
}

/* Table links */
table a {
    color: var(--color-accent);
    font-weight: 500;
}

table a:hover {
    color: var(--color-accent-hover);
    text-decoration: underline;
}

/* Player name links - respect inline color */
a[style*="color"] {
    text-decoration: none;
}

a[style*="color"]:hover {
    opacity: 0.85;
    text-decoration: none;
}

/* ===================================
   UTILITY CLASSES
   =================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); }
.text-accent { color: var(--color-accent); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-danger); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mt-5 { margin-top: var(--spacing-xl); }

.hidden { display: none; }
.visible { display: block; }

/* ===================================
   LOADING & ANIMATIONS
   =================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.loading {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--color-text-secondary);
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Legend Tier (T6) — Custom shimmer name effect */
@keyframes legendShimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}
.legend-name {
    --legend-color: #FFD700;
    --legend-bright: #FFF8DC;
    background: linear-gradient(90deg, var(--legend-color) 0%, var(--legend-bright) 25%, var(--legend-color) 50%, var(--legend-color) 75%, var(--legend-color) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: legendShimmer 3s linear infinite;
    font-weight: 800 !important;
}
.legend-name::before {
    content: '⚡';
    -webkit-text-fill-color: initial;
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
    margin-right: 2px;
    font-size: .85em;
}
a.legend-name { -webkit-text-fill-color: transparent; text-decoration: none; }
.legend-pill {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: .6rem; font-weight: 800; text-transform: uppercase; letter-spacing: .5px;
    padding: 2px 8px; border-radius: 4px;
    background: linear-gradient(90deg, rgba(255,215,0,.15), rgba(255,165,0,.15), rgba(255,215,0,.15));
    background-size: 200% auto;
    animation: legendShimmer 3s linear infinite;
    border: 1px solid rgba(255,215,0,.3);
    color: #FFD700;
}
.legend-forum-title {
    font-size: .55rem; color: #FFD700; font-style: italic; margin-bottom: 3px; opacity: .85;
}
