/* ═══════════════════════════════════════════════════════════════
   ENHANCED THEME SYSTEM with Light/Dark Mode Support
   ═══════════════════════════════════════════════════════════════ */
:root {
    --bg: #111;
    --pri: #FF4F00;
    --acc: #01B6F5;
    --sec: #28A745;
    --dan: #DC3545;
    --txt: #FFF;
    --slider-track-bg: rgba(255,255,255,0.3);
    --slider-track-border: var(--acc);
    --slider-thumb-bg: linear-gradient(45deg, var(--pri), var(--acc));
    --slider-thumb-border: var(--txt);
}

:root.light-mode {
    --bg: #f8f9fa;
    --pri: #FF4F00;
    --acc: #0056b3;
    --sec: #28A745;
    --dan: #DC3545;
    --txt: #212529;
    --slider-track-bg: rgba(0,0,0,0.2);
    --slider-thumb-border: #fff;
}

body {
    background: var(--bg);
    color: var(--txt);
    font-family: 'Roboto Condensed', sans-serif;
    transition: all 0.3s ease;
}

.heading-font { font-family: 'Teko', sans-serif; }

/* ═══════════════════════════════════════════════════════════════
   ENHANCED SLIDER STYLING
   ═══════════════════════════════════════════════════════════════ */
input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    height: 28px;
    background: transparent;
    cursor: pointer;
    outline: none;
    margin: 8px 0;
}
input[type=range]::-webkit-slider-track {
    height: 20px;
    width: 100%;
    background: var(--slider-track-bg);
    border: 3px solid var(--slider-track-border);
    border-radius: 12px;
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 36px;
    width: 36px;
    border-radius: 50%;
    background: var(--slider-thumb-bg);
    border: 4px solid var(--slider-thumb-border);
    margin-top: -11px;
    cursor: pointer;
    transition: all 0.2s ease;
}
input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type=range]::-moz-range-track {
    height: 20px;
    width: 100%;
    background: var(--slider-track-bg);
    border: 3px solid var(--slider-track-border);
    border-radius: 12px;
}
input[type=range]::-moz-range-thumb {
    height: 36px;
    width: 36px;
    border-radius: 50%;
    background: var(--slider-thumb-bg);
    border: 4px solid var(--slider-thumb-border);
    cursor: pointer;
}
input[type=range]:focus { outline: 2px solid var(--pri); outline-offset: 4px; }

/* ═══════════════════════════════════════════════════════════════
   UI Elements
   ═══════════════════════════════════════════════════════════════ */
.mode-toggle-container { position: fixed; top: 20px; left: 20px; z-index: 1000; }
.mode-toggle {
    background: rgba(0,0,0,0.9);
    border: 2px solid var(--acc);
    border-radius: 12px;
    padding: 12px 16px;
    cursor: pointer;
    color: var(--txt);
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}
:root.light-mode .mode-toggle { background: rgba(255,255,255,0.95); }

.card {
    border: 2px solid var(--acc);
    border-radius: .8rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--bg), rgba(0,0,0,0.7));
    backdrop-filter: blur(10px);
}
:root.light-mode .card { background: linear-gradient(135deg, var(--bg), rgba(255,255,255,0.8)); }
.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--pri), var(--acc), var(--sec));
}

.toggle-switch { position: relative; display: inline-block; width: 60px; height: 34px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.2), rgba(255,255,255,0.1));
    transition: .4s; border-radius: 34px; border: 2px solid var(--acc);
}
:root.light-mode .slider { background: linear-gradient(45deg, rgba(0,0,0,0.1), rgba(0,0,0,0.05)); }
.slider:before {
    position: absolute; content: ""; height: 24px; width: 24px; left: 3px; bottom: 3px;
    background: linear-gradient(45deg, var(--txt), #f8f9fa);
    transition: .4s; border-radius: 50%;
}
input:checked + .slider { background: linear-gradient(45deg, var(--pri), var(--sec)); border-color: var(--sec); }
input:checked + .slider:before { transform: translateX(24px); }

.bar { background: rgba(128,128,128,0.2); border: 2px solid var(--acc); border-radius: 15px; height: 30px; overflow: hidden; }
.fill { height: 100%; display: flex; align-items: center; justify-content: center; font-weight: bold; text-shadow: 1px 1px 2px rgba(0,0,0,0.7); transition: all 0.3s ease; background:linear-gradient(90deg,var(--sec),var(--pri)); }
.fill.over { background: linear-gradient(90deg, var(--dan), #900); animation: pulse 1.5s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: .75; } to { opacity: 1; } }
#bagNotice { display: none; font-weight: bold; color: var(--dan); margin-top: .25rem; }

.btn-primary, .btn-secondary {
    padding: 14px 28px; border-radius: 12px; font-weight: bold; cursor: pointer;
    transition: all 0.3s ease;
}
.btn-primary { background: linear-gradient(45deg, var(--pri), var(--acc)); color: var(--txt); border: 2px solid var(--pri); }
.btn-primary:hover { background: linear-gradient(45deg, var(--acc), var(--sec)); transform: translateY(-3px); }
.btn-secondary { background: linear-gradient(45deg, rgba(128,128,128,0.2), rgba(128,128,128,0.3)); color: var(--txt); border: 2px solid var(--acc); }
.btn-secondary:hover { background: linear-gradient(45deg, var(--acc), var(--pri)); border-color: var(--pri); }

#themeWrap { position: fixed; top: 20px; right: 20px; z-index: 999; }
#themeBtn {
    display: flex; align-items: center; gap: .5rem; padding: .6rem 1rem;
    background: rgba(0,0,0,0.9); border: 2px solid var(--pri); border-radius: .8rem;
    font-weight: bold; cursor: pointer; color: var(--txt);
}
:root.light-mode #themeBtn { background: rgba(255,255,255,0.95); }
#themeMenu {
    display: none; position: absolute; right: 0; top: 100%; margin-top: .3rem;
    background: rgba(0,0,0,0.95); border: 2px solid var(--acc); border-radius: .8rem;
    min-width: 12rem;
}
:root.light-mode #themeMenu { background: rgba(255,255,255,0.98); }
#themeWrap.open #themeMenu { display: block; }
#themeMenu li { cursor: pointer; padding: .75rem 1rem; border-bottom: 1px solid rgba(128,128,128,0.2); }
#themeMenu li:last-child { border-bottom: none; }
#themeMenu li:hover { background: var(--pri); }

.accordion-header { background: linear-gradient(135deg, var(--bg), rgba(0,0,0,0.8)); border: 2px solid var(--acc); transition: all 0.3s ease; }
:root.light-mode .accordion-header { background: linear-gradient(135deg, var(--bg), rgba(255,255,255,0.9)); }
.accordion-content { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; border-left: 2px solid var(--acc); border-right: 2px solid var(--acc); border-bottom: 2px solid var(--acc); }
.accordion-content.active { max-height: 2000px; }

input[type="number"], select {
    background: linear-gradient(135deg, var(--bg), rgba(0,0,0,0.8));
    border: 2px solid var(--acc);
    color: var(--txt);
    border-radius: 10px;
    padding: 12px 16px;
    font-weight: bold;
    transition: all 0.3s ease;
}
:root.light-mode input[type="number"], :root.light-mode select { background: linear-gradient(135deg, var(--bg), rgba(255,255,255,0.9)); }
input[type="number"]:focus, select:focus {
    outline: none; border-color: var(--pri);
    box-shadow: 0 0 0 4px rgba(255,79,0,0.2);
}
select option { background: var(--bg); color: var(--txt); }

.glow { animation: glow 3s ease-in-out infinite alternate; }
@keyframes glow {
    from { box-shadow: 0 0 5px var(--pri), 0 0 10px var(--pri); }
    to { box-shadow: 0 0 10px var(--pri), 0 0 20px var(--pri); }
}

.loot-priority-item {
    background: linear-gradient(135deg, var(--bg), rgba(0,0,0,0.8));
    border: 2px solid var(--acc); border-radius: 12px;
    padding: 16px; margin-bottom: 12px;
}
:root.light-mode .loot-priority-item { background: linear-gradient(135deg, var(--bg), rgba(255,255,255,0.9)); }