/* FACEIT Profile Viewer - Base Styles */

/* ===== CSS VARIABLES ===== */
:root {
    --bg-primary: #1F2527;
    --bg-secondary: #2A2F32;
    --bg-tertiary: #343A3E;
    --text-primary: #FFFFFF;
    --text-secondary: #B5BCC2;
    --text-muted: #7A8388;
    --accent-color: #4169E1;
    --accent-hover: #5A7BED;
    --accent-light: rgba(65, 105, 225, 0.1);
    --border-color: #3A4045;
    --border-light: #4A5055;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --error-color: #dc3545;
    --card-shadow: 0 4px 12px rgba(0,0,0,0.15);
    --hover-bg: rgba(255,255,255,0.05);
}

/* Light theme variables */
[data-theme="light"] {
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8F9FA;
    --bg-tertiary: #E9ECEF;
    --text-primary: #212529;
    --text-secondary: #6C757D;
    --text-muted: #ADB5BD;
    --border-color: #DEE2E6;
    --border-light: #CED4DA;
    --card-shadow: 0 4px 12px rgba(0,0,0,0.1);
    --hover-bg: rgba(0,0,0,0.05);
}

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

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}

/* Country flag emoji support for Chrome/Edge */
.country-flag {
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', 'Android Emoji', 'EmojiSymbols', 'EmojiOne Mozilla', 'Twemoji Mozilla', 'Segoe UI', system-ui, sans-serif;
    font-feature-settings: "liga" off;
    font-variant-emoji: emoji; /* Progressive enhancement for better emoji rendering */
    font-size: 1.2em;
    display: inline-block;
    vertical-align: middle;
}

html {
    scroll-behavior: smooth;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

.page-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 24px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== LAYOUT CONTAINERS ===== */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px 40px 20px;
    min-height: calc(100vh - 80px);
}

/* OVERRIDE ALL: Universal Hero Section - Same for all pages */
.hero-section {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%) !important;
    border-radius: 12px !important;
    padding: 24px 32px !important;
    text-align: center !important;
    margin-bottom: 32px !important;
    box-shadow: var(--card-shadow) !important;
    position: relative !important;
    overflow: hidden !important;
}

.hero-title {
    font-size: 2rem !important;
    font-weight: 800 !important;
    color: white !important;
    margin-bottom: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
}

.hero-subtitle {
    font-size: 1.1rem !important;
    color: rgba(255, 255, 255, 0.9) !important;
    max-width: 500px !important;
    margin: 0 auto !important;
    text-align: center !important;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== HEADER STYLES ===== */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 72px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 800;
    font-size: 1.5rem;
    transition: opacity 0.2s ease;
}

.logo:hover {
    opacity: 0.8;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--accent-color);
}

.logo-text {
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 15px;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
    background: var(--hover-bg);
}

.theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.theme-toggle:hover {
    background: var(--hover-bg);
    border-color: var(--border-light);
}

.theme-icon {
    width: 16px;
    height: 16px;
}

/* ===== BREADCRUMB NAVIGATION ===== */
.breadcrumb-nav {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    list-style: none;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.breadcrumb-item a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
    color: var(--accent-hover);
}

.breadcrumb-item:not(:last-child)::after {
    content: "/";
    color: var(--text-muted);
    margin-left: 8px;
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 500;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    justify-content: center;
    line-height: 1;
    -webkit-user-select: none;
    user-select: none;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background: var(--hover-bg);
    border-color: var(--border-light);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ===== ALERTS ===== */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
    background: var(--bg-secondary);
}

.alert-error {
    border-left-color: var(--error-color);
    background: rgba(220, 53, 69, 0.1);
}

.alert-success {
    border-left-color: var(--success-color);
    background: rgba(40, 167, 69, 0.1);
}

.alert-warning {
    border-left-color: var(--warning-color);
    background: rgba(255, 193, 7, 0.1);
}

/* ===== UTILITY CLASSES ===== */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.clickable {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.clickable:hover {
    opacity: 0.8;
}

/* Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--accent-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .header-content {
        padding: 0 20px;
        height: 64px;
    }
    
    .nav-links {
        gap: 16px;
    }
    
    .nav-links a {
        font-size: 14px;
        padding: 6px 12px;
    }
    
    .theme-toggle {
        padding: 8px 12px;
    }
    
    .main-container {
        padding: 16px;
    }
    
    .breadcrumb-list {
        padding: 0 20px;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .header-content {
        height: 56px;
        padding: 0 16px;
    }
    
    .logo-text {
        display: none;
    }
    
    .nav-links {
        gap: 8px;
    }
    
    .nav-links a {
        padding: 6px 8px;
        font-size: 13px;
    }
    
    .theme-toggle {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .main-container {
        padding: 12px;
    }
    
    .page-title {
        font-size: 1.75rem;
    }
}

/* ===== FACEIT LEVEL COLOR CODING ===== */
/* Level 10 = red */
.faceit-level-10 {
    background: #dc3545 !important;
    background-image: none !important;
    color: white !important;
    font-weight: 700 !important;
    border: 2px solid #dc3545 !important;
}

/* Level 9-8 = orange */
.faceit-level-9,
.faceit-level-8 {
    background: #fd7e14 !important;
    background-image: none !important;
    color: white !important;
    font-weight: 700 !important;
    border: 2px solid #fd7e14 !important;
}

/* Level 7-4 = yellow/gold */
.faceit-level-7,
.faceit-level-6,
.faceit-level-5,
.faceit-level-4 {
    background: #ffc107 !important;
    background-image: none !important;
    color: #000 !important;
    font-weight: 700 !important;
    border: 2px solid #ffc107 !important;
}

/* Level 3-1 = green */
.faceit-level-3,
.faceit-level-2,
.faceit-level-1 {
    background: #28a745 !important;
    background-image: none !important;
    color: white !important;
    font-weight: 700 !important;
    border: 2px solid #28a745 !important;
}

/* ===== COUNTRY FLAG ICONS ===== */
.country-flag-container {
    display: inline-block;
    line-height: 1;
}

.fi {
    width: 1.2em;
    height: 0.9em;
    border-radius: 2px;
    display: inline-block;
    background-size: cover;
    background-position: center;
    vertical-align: middle;
    margin: 0 2px;
}

.flag-fallback {
    font-size: 1em;
    display: inline-block;
    vertical-align: middle;
}