/* ── Root Variables ────────────────────────────────── */
:root {
    /* Colors from style.css */
    --primary: #d4af37;
    --primary-glow: rgba(212, 175, 55, 0.4);
    --accent: #f59e0b;
    --accent-glow: rgba(245, 158, 11, 0.3);
    --bg-dark: #0f0d0a;
    --text-main: rgba(255, 255, 255, 0.9);
    --text-muted: rgba(255, 255, 255, 0.5);
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Outfit', sans-serif;

    /* Theme-specific (Dark) */
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f2e;
    --border-color: rgba(255, 255, 255, 0.1);
    --card-bg: rgba(0, 0, 0, 0.3);
}

/* ── Global Resets ─────────────────────────────────── */
* {
    margin: 0; padding: 0; box-sizing: border-box;
    font-family: var(--font-main) !important;
}
html, body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading) !important;
    font-weight: 700;
}
img { max-width: 100%; height: auto; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.main-content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
    animation: pageFadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Light Mode Variables */
html.light-mode {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e8ecf1;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-tertiary: #64748b;
    --border-color: rgba(0, 0, 0, 0.08);
    --card-bg: #ffffff;
    --hover-bg: rgba(212, 175, 55, 0.08);
    --shadow-color: rgba(0, 0, 0, 0.08);
}

/* Smooth transition for theme changes */
body.theme-transition {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Apply theme colors globally */
body {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

/* Light Mode Optimizations */
html.light-mode body {
    background: #f1f5f9 !important;
}

/* Scroll performance optimization */
html.light-mode * {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html.light-mode ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

html.light-mode ::-webkit-scrollbar-track {
    background: rgba(212, 175, 55, 0.05);
}

html.light-mode ::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 5px;
}

html.light-mode ::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.5);
}

/* Light mode: main content area */
html.light-mode .main,
html.light-mode .main_box {
    background-color: transparent !important;
}

/* Light mode: typography */
html.light-mode h1, html.light-mode h2, html.light-mode h3 { color: #0f172a !important; }
html.light-mode h4, html.light-mode h5, html.light-mode h6 { color: #1e293b !important; }

/* Light mode: tables */
html.light-mode table { background: #fff !important; border: 1px solid rgba(212,175,55,.1) !important; }
html.light-mode th { background: #f8fafc !important; color: #0f172a !important; }
html.light-mode td { color: #475569 !important; }

/* Light mode: forms */
html.light-mode input, html.light-mode textarea, html.light-mode select {
    background: #ffffff !important; border: 1px solid rgba(212,175,55,.2) !important; color: #1e293b !important;
}
html.light-mode input:focus, html.light-mode textarea:focus, html.light-mode select:focus {
    border-color: #d4af37 !important; box-shadow: 0 0 0 3px rgba(212,175,55,.1) !important; outline: none !important;
}

/* Back to Top Button - Dark Theme */
#back-to-top {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 4px 14px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    z-index: 9990;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

#back-to-top:hover {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(212, 175, 55, 0.3);
    transform: translateY(-3px) scale(1.08);
}

#back-to-top:active {
    transform: translateY(-1px) scale(0.95);
}

#back-to-top svg {
    width: 20px;
    height: 20px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

/* Light mode style */
html.light-mode #back-to-top {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.15),
        0 2px 4px rgba(0, 0, 0, 0.1);
}

html.light-mode #back-to-top:hover {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.2),
        0 0 20px rgba(212, 175, 55, 0.2);
}

/* Mobile responsive */
@media (max-width: 768px) {
    #back-to-top {
        bottom: 20px;
        right: 20px;
        width: 38px;
        height: 38px;
    }
    
    #back-to-top svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    #back-to-top {
        bottom: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
    }
    
    #back-to-top svg {
        width: 16px;
        height: 16px;
    }
}
/* ── Breadcrumb ────────────────────────────────────── */
.breadcrumb { margin-bottom: 25px; }
.breadcrumb ol {
    display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0;
    background: rgba(255,255,255,0.03); padding: 10px 20px; border-radius: 100px;
    border: 1px solid var(--border-color); list-style: none; margin: 0;
}
.breadcrumb ol li { display: inline-flex; align-items: center; color: var(--text-muted); font-size: 0.9rem; }
.breadcrumb ol li+li::before { content: "›"; margin: 0 12px; color: var(--text-muted); font-size: 1rem; }
.breadcrumb a { color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--text-main); }

/* ── Content Tables ────────────────────────────────── */
.article-content table, .champion-description table, .item-description-content table {
    width: 100% !important; border-collapse: collapse; margin-bottom: 20px;
    background: rgba(0,0,0,0.2); border-radius: 8px; overflow: hidden;
}
.article-content th, .champion-description th, .item-description-content th {
    background: rgba(212, 175, 55, 0.1); color: var(--primary);
    padding: 12px 15px; text-align: left; font-weight: 700; border-bottom: 1px solid rgba(212,175,55,0.2);
}
.article-content td, .champion-description td, .item-description-content td {
    padding: 12px 15px; border-bottom: 1px solid rgba(255,255,255,0.05); color: rgba(255,255,255,0.8);
}
@media (max-width: 768px) {
    .article-content table, .champion-description table, .item-description-content table {
        display: block; overflow-x: auto; white-space: nowrap;
    }
}

/* Global Champion Image Rounded Style */
.img-champions, .champion-image, .cd-hero-avatar img, .card-img-top, .ci-card-img {
    border-radius: 50% !important;
    object-fit: cover !important;
}

.champion-image-wrapper.rounded {
    border-radius: 50% !important;
    overflow: hidden !important;
}

/* Remove gap between header and main on mobile */
@media (max-width: 767px) {
    .main {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    .main_box.pt20 {
        padding-top: 0 !important;
    }
    
    /* Fix iOS Safari auto-zoom on input focus */
    input[type="text"],
    input[type="email"],
    input[type="search"],
    input[type="tel"],
    input[type="url"],
    input[type="password"],
    textarea,
    select {
        font-size: 16px !important;
    }
}
