/* ==========================================================================
   Prediction Jackpot - Modern Lottery Prediction System Styles
   ========================================================================== */

/* CSS Variables */
:root {
    /* Colors - Light Mode */
    --primary-color: #6366F1;
    --secondary-color: #8B5CF6;
    --accent-color: #EC4899;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --danger-color: #EF4444;

    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-tertiary: #F3F4F6;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --border-color: #E5E7EB;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-purple: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Dark Mode */
body.dark-mode {
    --bg-primary: #0F172A;
    --bg-secondary: #1E293B;
    --bg-tertiary: #334155;
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --border-color: #334155;
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100%;
}

body {
    font-family: var(--font-family);
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    max-width: 100%;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
}

.main-content {
    flex: 1;
}

/* ==========================================================================
   Navigation (Modern Responsive & Safe Navbar)
   ========================================================================== */

.navbar {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
}

.navbar .navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.navbar-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand a {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.logo-icon {
    font-size: 2rem;
    display: inline-flex;
    align-items: center;
}

.brand-logo-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: contain;
    box-shadow: 0 0 12px rgba(0, 210, 255, 0.45);
    border: 1.5px solid rgba(0, 210, 255, 0.45);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.brand-logo-img:hover {
    transform: scale(1.08) rotate(4deg);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.75) !important;
}

.logo-text {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

/* Nav Actions (Theme Toggle, Auth Buttons, User Menu) - GUARANTEED IN FRAME */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.nav-actions .btn-sm {
    padding: 0.38rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.nav-actions .nav-btn-register {
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
    padding: 0.35rem 0.6rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.08);
}

[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-link.active {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
}

.theme-toggle {
    background: var(--bg-tertiary);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--primary-color);
    transform: rotate(180deg);
}

.theme-icon {
    font-size: 1.1rem;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
    padding: var(--spacing-xl) 0;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: var(--gradient-primary);
    border-radius: 50%;
    opacity: 0.1;
    filter: blur(80px);
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: var(--spacing-md);
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto var(--spacing-xl);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xl);
    margin-top: var(--spacing-xl);
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 3rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==========================================================================
   Game Selection
   ========================================================================== */

.game-selection {
    padding: var(--spacing-xl) 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: var(--spacing-xl);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.game-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.game-icon {
    font-size: 4rem;
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.game-name {
    text-align: center;
    font-size: 1.75rem;
    margin-bottom: var(--spacing-sm);
}

.game-description {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
}

.game-actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

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

.btn-primary:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--gradient-secondary);
    color: white;
}

.btn-secondary:hover {
    box-shadow: 0 0 20px rgba(245, 87, 108, 0.3);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

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

.btn-danger {
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.btn-danger:hover {
    background: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

.btn-success {
    background: var(--gradient-success);
    color: white;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-icon {
    font-size: 1.25rem;
}

.btn-accent {
    background: linear-gradient(135deg, #EC4899 0%, #F43F5E 100%);
    color: white;
}

.btn-accent:hover {
    box-shadow: 0 0 20px rgba(236, 72, 153, 0.4);
    transform: translateY(-2px);
}

/* ==========================================================================
   Features Section
   ========================================================================== */

.features {
    padding: var(--spacing-xl) 0;
    background: var(--bg-primary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.feature-card {
    background: var(--bg-secondary);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
}

.feature-card h3 {
    margin-bottom: var(--spacing-sm);
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ==========================================================================
   Predictions
   ========================================================================== */

.page-header {
    background: var(--bg-primary);
    padding: var(--spacing-lg) 0;
    border-bottom: 1px solid var(--border-color);
}

.breadcrumb {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    font-size: 0.875rem;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.page-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.game-icon-large {
    font-size: 3rem;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

.pick-size-selector {
    margin-top: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.pick-size-dropdown {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
}

.predictions-section {
    padding: var(--spacing-xl) 0;
}

.predictions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.prediction-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.prediction-card:hover {
    box-shadow: var(--shadow-lg);
}

.prediction-header {
    margin-bottom: var(--spacing-md);
    text-align: center;
}

.prediction-title {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-xs);
}

.prediction-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.prediction-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    justify-content: center;
    min-height: 60px;
    align-items: center;
}

.number-ball {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
    box-shadow: var(--shadow-md);
    animation: popIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
    opacity: 0;
    transform: scale(0);
}

@keyframes popIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.generate-btn {
    margin: 0 auto;
}

.action-buttons {
    text-align: center;
    margin-top: var(--spacing-lg);
}

/* ==========================================================================
   AI Predictions
   ========================================================================== */

.ai-predictions-section {
    padding: var(--spacing-xl) 0;
}

.ai-predictions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--spacing-lg);
}

.ai-prediction-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    animation: slideIn 0.5s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-prediction-header {
    margin-bottom: var(--spacing-md);
}

.ai-prediction-title {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
    text-align: center;
}

.confidence-bar {
    margin-bottom: var(--spacing-md);
}

.confidence-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.confidence-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.confidence-progress {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 100px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    border-radius: 100px;
    transition: width 0.5s ease;
}

/* ==========================================================================
   Statistics
   ========================================================================== */

.statistics-section {
    padding: var(--spacing-xl) 0;
}

.stats-info-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    text-align: center;
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
}

.big-number {
    font-size: 4rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.statistics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--spacing-lg);
}

.stats-section {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
}

.stats-section h3 {
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.stats-row {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: var(--spacing-sm);
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.stats-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.stats-bar-container {
    position: relative;
    background: var(--bg-tertiary);
    border-radius: 100px;
    height: 30px;
    overflow: hidden;
}

.stats-bar {
    height: 100%;
    border-radius: 100px;
    transition: width 0.5s ease;
    position: relative;
}

.stats-count {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 700;
    color: var(--text-primary);
}

/* ==========================================================================
   Loading & Empty States
   ========================================================================== */

.loading,
.loading-large {
    text-align: center;
    padding: var(--spacing-lg);
    color: var(--text-secondary);
    font-size: 1.125rem;
}

.loading::after,
.loading-large::after {
    content: '...';
    animation: dots 1.5s infinite;
}

@keyframes dots {

    0%,
    20% {
        content: '.';
    }

    40% {
        content: '..';
    }

    60%,
    100% {
        content: '...';
    }
}

.empty-state {
    text-align: center;
    padding: var(--spacing-xl);
}

.empty-icon {
    font-size: 5rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: var(--spacing-sm);
}

.empty-state p {
    color: var(--text-secondary);
}

.error {
    color: var(--danger-color);
    text-align: center;
    padding: var(--spacing-md);
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-md);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-lg) 0;
    text-align: center;
    color: var(--text-secondary);
    margin-top: auto;
}

.disclaimer {
    font-size: 0.875rem;
    margin-top: var(--spacing-sm);
}

/* ==========================================================================
   Data Management Page
   ========================================================================== */

.manage-section {
    padding: var(--spacing-xl) 0;
}

.manage-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.manage-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.manage-info {
    margin: var(--spacing-md) 0;
    padding: var(--spacing-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.info-value {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.125rem;
}

.manage-actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.upload-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: var(--text-secondary);
}

.upload-label:hover {
    border-color: var(--primary-color);
    background: var(--bg-tertiary);
    color: var(--primary-color);
}

.upload-icon {
    font-size: 1.25rem;
}

.filename {
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 0 var(--spacing-xs);
    min-height: 1.5rem;
    font-style: italic;
}

.status-message {
    margin-top: var(--spacing-sm);
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-message.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.status-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

.status-message.loading {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.help-section {
    margin-top: var(--spacing-xl);
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
}

.help-section h2 {
    margin-bottom: var(--spacing-md);
}

.help-content {
    color: var(--text-secondary);
}

.help-content pre {
    background: var(--bg-secondary);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: var(--spacing-sm) 0;
    border: 1px solid var(--border-color);
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

.help-content ul {
    margin-left: var(--spacing-lg);
    margin-top: var(--spacing-sm);
}

.help-content li {
    margin-bottom: var(--spacing-xs);
}

.manual-entry-divider {
    text-align: center;
    margin: var(--spacing-md) 0;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    position: relative;
}

.manual-entry-divider::before,
.manual-entry-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border-color);
}

.manual-entry-divider::before {
    left: 0;
}

.manual-entry-divider::after {
    right: 0;
}

.manual-entry-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.form-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.form-input {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-input::placeholder {
    color: var(--text-secondary);
}

.about {
    padding: var(--spacing-xl) 0;
    background: var(--bg-secondary);
}

.forum-content,
.forum-content * {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: break-all;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-content p {
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .games-grid {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .predictions-grid {
        grid-template-columns: 1fr;
    }

    .ai-predictions-grid {
        grid-template-columns: 1fr;
    }

    .statistics-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.75rem;
    }
}

/* ==========================================================================
   Authentication & User Management Styles
   ========================================================================== */

/* User Menu in Navigation */
.user-menu {
    position: relative;
    margin-left: var(--spacing-sm);
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-menu-toggle:hover {
    background: var(--bg-tertiary);
    box-shadow: var(--shadow-md);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
}

.role-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-transform: uppercase;
}

.role-admin {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.role-editor {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.role-viewer {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
}

.role-public {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* User Dropdown */
.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 250px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.dropdown-user-info strong {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
}

.dropdown-user-info small {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 0.75rem var(--spacing-md);
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: var(--bg-secondary);
}

.dropdown-item span {
    font-size: 1.25rem;
}

.logout-item {
    color: var(--danger-color);
}

.logout-item:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Flash Messages */
.flash-messages-container {
    position: fixed;
    top: 80px;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 400px;
}

.flash-message {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 1rem 1.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border-left: 4px solid;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.flash-success {
    border-color: var(--success-color);
}

.flash-danger,
.flash-error {
    border-color: var(--danger-color);
}

.flash-warning {
    border-color: var(--warning-color);
}

.flash-info {
    border-color: var(--primary-color);
}

.flash-icon {
    font-size: 1.5rem;
    font-weight: bold;
}

.flash-success .flash-icon {
    color: var(--success-color);
}

.flash-danger .flash-icon,
.flash-error .flash-icon {
    color: var(--danger-color);
}

.flash-warning .flash-icon {
    color: var(--warning-color);
}

.flash-info .flash-icon {
    color: var(--primary-color);
}

.flash-text {
    flex: 1;
    color: var(--text-primary);
}

.flash-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.flash-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Auth Pages */
.auth-page {
    background: var(--gradient-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-container {
    width: 100%;
    max-width: 450px;
    padding: var(--spacing-md);
}

.auth-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-xl);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.auth-header h1 {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.verification-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(0, 210, 255, 0.06);
    border: 1px solid rgba(0, 210, 255, 0.15);
    border-radius: 10px;
    font-size: 0.82rem;
    color: var(--text-secondary, #8899aa);
    line-height: 1.4;
}

.verification-notice .notice-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.form-control {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-error {
    color: var(--danger-color);
    font-size: 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-help {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.form-checkbox {
    flex-direction: row;
    align-items: center;
    gap: var(--spacing-xs);
}

.form-check-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-check-label {
    font-weight: 500;
    cursor: pointer;
    margin: 0;
}

.btn-block {
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem;
    font-weight: 600;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.auth-footer {
    text-align: center;
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

.auth-footer p {
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Profile Pages */
.profile-section {
    padding: var(--spacing-xl) 0;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
}

@media (min-width: 768px) {
    .profile-grid {
        grid-template-columns: 2fr 1fr;
    }
}

.profile-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.profile-card h2 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.profile-item {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border-color);
}

.profile-item:last-child {
    border-bottom: none;
}

.profile-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.profile-value {
    color: var(--text-primary);
    font-weight: 500;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
}

.status-active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.status-inactive {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

/* Form Section (for change password, etc.) */
.form-section {
    padding: var(--spacing-xl) 0;
}

.form-card {
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.standard-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.form-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.form-actions .btn {
    flex: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .user-menu-toggle .user-name {
        display: none;
    }

    .flash-messages-container {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }

    .auth-container {
        padding: var(--spacing-sm);
    }

    .auth-card {
        padding: var(--spacing-lg);
    }

    .profile-item {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
}

/* Dark Mode Adjustments */
[data-theme="dark"] .user-menu-toggle {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .user-dropdown {
    background: #1F2937;
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .flash-message {
    background: #1F2937;
}

[data-theme="dark"] .auth-card,
[data-theme="dark"] .profile-card,
[data-theme="dark"] .form-card {
    background: #1F2937;
    border-color: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Admin Panel Styles
   ========================================================================== */

/* Admin Section */
.admin-section {
    padding: var(--spacing-xl) 0;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    border: 1px solid var(--border-color);
}

.stat-icon {
    font-size: 3rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Admin Grid */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.admin-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.admin-card.full-width {
    grid-column: 1 / -1;
}

.admin-card h2 {
    margin-bottom: var(--spacing-md);
    font-size: 1.25rem;
    color: var(--text-primary);
}

/* Filters */
.admin-filters {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-md);
}

.filter-form {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.filter-input,
.filter-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
}

.filter-input {
    flex: 1;
    min-width: 200px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    background: var(--bg-tertiary);
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-bottom: 2px solid var(--border-color);
}

.admin-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.admin-table tr:hover {
    background: var(--bg-secondary);
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.actions-cell {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    border: none;
    background: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    text-decoration: none;
}

.btn-icon.btn-danger:hover {
    transform: scale(1.1);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

.page-link {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.page-link:hover {
    background: var(--primary-color);
    color: white;
}

.page-info {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Role List */
.role-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.role-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.role-count {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary-color);
}

/* Action List */
.action-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(5px);
}

/* Settings Status */
.settings-status {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.status-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.status-value.active {
    color: var(--success-color);
    font-weight: 600;
}

.status-value.inactive {
    color: var(--danger-color);
    font-weight: 600;
}

/* Activity Log */
.activity-log {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.log-item {
    display: grid;
    grid-template-columns: 150px 100px 150px 1fr;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.log-time {
    color: var(--text-secondary);
}

.log-user {
    font-weight: 600;
    color: var(--primary-color);
}

.log-action {
    color: var(--text-primary);
    font-family: monospace;
}

.view-all-link {
    display: inline-block;
    margin-top: var(--spacing-md);
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

.view-all-link:hover {
    text-decoration: underline;
}

/* Utility Classes */
.user-badge {
    background: var(--bg-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.action-code {
    background: var(--bg-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 0.875rem;
}

.text-success {
    color: var(--success-color);
}

.text-danger {
    color: var(--danger-color);
}

.text-warning {
    color: var(--warning-color);
}

.text-muted {
    color: var(--text-secondary);
}

.settings-summary {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

/* Dark Mode */
[data-theme="dark"] .admin-card,
[data-theme="dark"] .stat-card {
    background: #1F2937;
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .admin-table th {
    background: #111827;
}

[data-theme="dark"] .admin-table tr:hover {
    background: #374151;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .log-item {
        grid-template-columns: 1fr;
    }

    .filter-form {
        flex-direction: column;
    }

    .filter-input,
    .filter-select {
        width: 100%;
    }
}

/* ========== RESPONSIVE NAVIGATION (DESKTOP & MOBILE) ========== */
@media (min-width: 992px) {
    .navbar-top-row {
        display: contents; /* Unwraps brand & actions into navbar-container */
    }
    .navbar .navbar-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .nav-links {
        margin: 0 auto;
        padding: 0 1rem;
    }
}

@media (max-width: 991px) {
    .navbar {
        padding: 0.4rem 0 0.45rem;
    }
    .navbar .navbar-container {
        flex-direction: column;
        align-items: stretch;
        gap: 0.45rem;
        padding: 0 0.75rem;
    }
    .navbar-top-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
    .logo-text {
        font-size: 1rem;
    }
    .nav-actions {
        gap: 0.35rem;
    }
    .nav-actions .btn-sm {
        padding: 0.32rem 0.65rem;
        font-size: 0.78rem;
    }
    .theme-toggle {
        width: 32px;
        height: 32px;
    }
    .theme-icon {
        font-size: 0.95rem;
    }
    /* Horizontal Swipable Category Pill Bar */
    .nav-links {
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0.35rem;
        padding: 0.15rem 0 0.25rem;
        width: 100%;
    }
    .nav-links::-webkit-scrollbar {
        display: none;
    }
    .nav-link {
        font-size: 0.78rem;
        padding: 0.28rem 0.6rem;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 9999px;
        flex-shrink: 0;
    }
    .nav-link.active {
        background: var(--primary-color);
        color: #ffffff !important;
        border-color: var(--primary-color);
    }
    [data-theme="dark"] .nav-link {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
        color: #94a3b8;
    }
    [data-theme="dark"] .nav-link.active {
        background: rgba(0, 210, 255, 0.2);
        border-color: rgba(0, 210, 255, 0.5);
        color: #38bdf8 !important;
    }
}

@media (max-width: 420px) {
    .logo-text {
        display: none; /* Hide brand text on narrow phones so Auth buttons have maximum room */
    }
    .nav-actions .btn-sm {
        padding: 0.3rem 0.55rem;
        font-size: 0.74rem;
    }
}

/* ==========================================================================
   Platform About Section (Unified for Home / Sports / Chess)
   ========================================================================== */
.about-platform-section,
.chess-about-section {
    margin-top: 2.5rem;
    scroll-margin-top: 85px;
}

.about-platform-card,
.chess-about-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    padding: 2.5rem 2rem;
    overflow: hidden;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

[data-theme="dark"] .about-platform-card,
body.dark-mode .about-platform-card,
.sports-page .about-platform-card,
[data-theme="dark"] .chess-about-card,
body.dark-mode .chess-about-card {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    color: #f1f5f9;
}

.about-platform-header,
.chess-about-header {
    text-align: center;
    max-width: 820px;
    margin: 0 auto 2.5rem;
}

.about-platform-badge,
.chess-about-badge {
    display: inline-block;
    padding: 0.35rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #4f46e5;
    background: #eef2ff;
    border-radius: 9999px;
    margin-bottom: 0.85rem;
}

[data-theme="dark"] .about-platform-badge,
body.dark-mode .about-platform-badge,
.sports-page .about-platform-badge,
[data-theme="dark"] .chess-about-badge,
body.dark-mode .chess-about-badge {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

.about-platform-title,
.chess-about-title {
    font-size: 2.1rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    color: var(--text-primary, #0f172a);
}

[data-theme="dark"] .about-platform-title,
body.dark-mode .about-platform-title,
.sports-page .about-platform-title,
[data-theme="dark"] .chess-about-title,
body.dark-mode .chess-about-title {
    color: #f8fafc;
}

.about-platform-subtitle,
.chess-about-subtitle {
    font-size: 1.05rem;
    line-height: 1.65;
    color: var(--text-secondary, #64748b);
}

[data-theme="dark"] .about-platform-subtitle,
body.dark-mode .about-platform-subtitle,
.sports-page .about-platform-subtitle,
[data-theme="dark"] .chess-about-subtitle,
body.dark-mode .chess-about-subtitle {
    color: #94a3b8;
}

.about-platform-grid,
.chess-about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.about-feature-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.6rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

[data-theme="dark"] .about-feature-box,
body.dark-mode .about-feature-box,
.sports-page .about-feature-box {
    background: #0f172a;
    border-color: #334155;
}

.about-feature-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

[data-theme="dark"] .about-feature-box:hover,
body.dark-mode .about-feature-box:hover,
.sports-page .about-feature-box:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    border-color: #475569;
}

.about-feature-icon {
    font-size: 2.2rem;
    margin-bottom: 0.8rem;
    line-height: 1;
}

.about-feature-box h4 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    color: var(--text-primary, #0f172a);
}

[data-theme="dark"] .about-feature-box h4,
body.dark-mode .about-feature-box h4,
.sports-page .about-feature-box h4 {
    color: #f1f5f9;
}

.about-feature-box p {
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--text-secondary, #64748b);
    flex-grow: 1;
    margin-bottom: 1.2rem;
}

[data-theme="dark"] .about-feature-box p,
body.dark-mode .about-feature-box p,
.sports-page .about-feature-box p {
    color: #94a3b8;
}

.about-feature-link {
    font-size: 0.88rem;
    font-weight: 600;
    color: #4f46e5;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.15s ease;
}

[data-theme="dark"] .about-feature-link,
body.dark-mode .about-feature-link,
.sports-page .about-feature-link {
    color: #818cf8;
}

.about-feature-link:hover {
    text-decoration: underline;
    gap: 0.5rem;
}

.about-platform-details,
.chess-about-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color, #e2e8f0);
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .about-platform-details,
    .chess-about-details {
        grid-template-columns: 1fr;
    }
}

.details-column h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    color: var(--text-primary, #0f172a);
}

[data-theme="dark"] .details-column h3,
body.dark-mode .details-column h3,
.sports-page .details-column h3 {
    color: #f1f5f9;
}

.details-column p {
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--text-secondary, #64748b);
}

[data-theme="dark"] .details-column p,
body.dark-mode .details-column p,
.sports-page .details-column p {
    color: #94a3b8;
}

.about-platform-footer,
.chess-about-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.quick-links-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
}

.quick-links-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary, #64748b);
    margin-right: 0.5rem;
}

[data-theme="dark"] .quick-links-label,
body.dark-mode .quick-links-label,
.sports-page .quick-links-label {
    color: #94a3b8;
}

.quick-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.9rem;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    text-decoration: none;
    transition: all 0.15s ease;
}

[data-theme="dark"] .quick-badge,
body.dark-mode .quick-badge,
.sports-page .quick-badge {
    background: #0f172a;
    border-color: #334155;
    color: #cbd5e1;
}

.quick-badge:hover {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #ffffff;
    transform: translateY(-2px);
}

/* ==========================================================================
   iOS PWA Standalone & Safe Area Insets (iPhone Notch / Dynamic Island)
   ========================================================================== */
@supports (padding-top: env(safe-area-inset-top)) {
    .navbar {
        padding-top: calc(var(--spacing-sm) + env(safe-area-inset-top));
    }
    body {
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

/* Prevent unwanted callout menus on touch & hold in standalone mode */
@media all and (display-mode: standalone) {
    body {
        -webkit-user-select: none;
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
    }
    input, textarea, select {
        -webkit-user-select: auto;
    }
}
