/* ============================================
   ТЕМИ — заеднички слој
   Се вчитува ПО style.css и ПРЕД поединечните теми.
   Овде е само она што важи за сите три теми.
   ============================================ */

html { color-scheme: dark; }

[data-theme="paper"],
[data-theme="light"],
[data-theme="sand"] { color-scheme: light; }

/* ---------- Заеднички ефекти ---------- */
.card,
.stat-card,
.login-box {
    transition: transform 0.25s ease, box-shadow 0.25s ease,
                border-color 0.25s ease, background-color 0.25s ease;
}

.card:hover,
.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-light);
    box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.8);
}

.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-alt, var(--accent)));
    opacity: 0.6;
    transform: scaleX(0.35);
    transform-origin: left;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.stat-card:hover::after {
    transform: scaleX(1);
    opacity: 1;
}

.sidebar-nav a svg {
    transition: transform 0.2s ease, filter 0.2s ease;
}

.sidebar-nav a:hover svg { transform: translateX(2px); }

.sidebar-nav a.active svg { filter: drop-shadow(0 0 7px var(--accent-light)); }

/* ---------- Превключвач на теми ---------- */
.theme-picker {
    position: relative;
    display: inline-flex;
}

.theme-picker-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.theme-picker-btn svg { width: 19px; height: 19px; }

.theme-picker-btn:hover,
.theme-picker.open .theme-picker-btn {
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-light);
}

.theme-picker-btn:active { transform: scale(0.96); }

.theme-picker-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 236px;
    padding: 8px;
    border-radius: 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    box-shadow: 0 26px 54px -22px rgba(0, 0, 0, 0.75);
    display: none;
    z-index: 1300;
}

[data-theme="aurora"] .theme-picker-menu {
    background: rgba(18, 16, 32, 0.92);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
}

.theme-picker.open .theme-picker-menu {
    display: block;
    animation: theme-picker-pop 0.18s ease both;
}

@keyframes theme-picker-pop {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 13.5px;
    text-align: left;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
}

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

.theme-option.is-active,
.theme-option[aria-checked="true"] {
    background: var(--accent-light);
    color: var(--accent);
}

.theme-swatch {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.theme-swatch-neon { background: linear-gradient(135deg, #22d3ee, #8b5cf6); }
.theme-swatch-aurora { background: linear-gradient(135deg, #a78bfa, #22d3ee 58%, #ec4899); }
.theme-swatch-paper { background: linear-gradient(135deg, #ffffff, #cbd5e1); }
.theme-swatch-ember { background: linear-gradient(135deg, #f59e0b, #e05252); }
.theme-swatch-forest { background: linear-gradient(135deg, #2dd4a7, #84cc16); }
.theme-swatch-sand { background: linear-gradient(135deg, #f7f3ec, #b45309); }

/* Шест теми: менито да не излезе од екранот на телефон. */
.theme-picker-menu { max-height: min(72vh, 460px); overflow-y: auto; }

.theme-option-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.theme-option-meta small {
    color: var(--text-muted);
    font-size: 11.5px;
}

.theme-option-check {
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.theme-option.is-active .theme-option-check,
.theme-option[aria-checked="true"] .theme-option-check { opacity: 1; }

@media (max-width: 991px) {
    .theme-picker.desktop-only { display: none; }
}

/* ---------- Пристапност: без движење ---------- */
@media (prefers-reduced-motion: reduce) {
    .card,
    .stat-card,
    .login-box,
    .theme-picker-btn,
    .theme-option {
        transition: none !important;
    }

    .card:hover,
    .stat-card:hover { transform: none; }

    .theme-picker.open .theme-picker-menu { animation: none; }
}
