/* ========================================
   THEME SYSTEM - Multiple Color Schemes
   ======================================== */

/* Base Color Themes */
:root[data-theme="blue"] {
    --primary: #3b82f6;
    --primary-light: #60a5fa;
    --primary-dark: #2563eb;
    --accent: #8b5cf6;
    --accent-light: #a78bfa;
}

:root[data-theme="purple"] {
    --primary: #a855f7;
    --primary-light: #c084fc;
    --primary-dark: #9333ea;
    --accent: #ec4899;
    --accent-light: #f472b6;
}

:root[data-theme="green"] {
    --primary: #10b981;
    --primary-light: #34d399;
    --primary-dark: #059669;
    --accent: #06b6d4;
    --accent-light: #22d3ee;
}

:root[data-theme="orange"] {
    --primary: #f97316;
    --primary-light: #fb923c;
    --primary-dark: #ea580c;
    --accent: #eab308;
    --accent-light: #facc15;
}

:root[data-theme="red"] {
    --primary: #ef4444;
    --primary-light: #f87171;
    --primary-dark: #dc2626;
    --accent: #f59e0b;
    --accent-light: #fbbf24;
}

:root[data-theme="pink"] {
    --primary: #ec4899;
    --primary-light: #f472b6;
    --primary-dark: #db2777;
    --accent: #a855f7;
    --accent-light: #c084fc;
}

:root[data-theme="cyan"] {
    --primary: #06b6d4;
    --primary-light: #22d3ee;
    --primary-dark: #0891b2;
    --accent: #8b5cf6;
    --accent-light: #a78bfa;
}

:root[data-theme="indigo"] {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --accent: #ec4899;
    --accent-light: #f472b6;
}

/* ========================================
   LIGHT/DARK MODE SYSTEM
   ======================================== */

/* Dark Mode (Default) */
:root,
:root[data-mode="dark"] {
    --bg-dark: #0f172a;
    --bg-panel: #1e293b;
    --bg-hover: rgba(51, 65, 85, 0.5);
    --border: rgba(51, 65, 85, 0.8);

    --text-main: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-dark: #64748b;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
}

/* Light Mode */
:root[data-mode="light"] {
    --bg-dark: #f8fafc;
    --bg-panel: #ffffff;
    --bg-hover: rgba(241, 245, 249, 0.8);
    --border: rgba(226, 232, 240, 0.8);

    --text-main: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-dark: #94a3b8;

    --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.15);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

/* Light mode specific adjustments */
:root[data-mode="light"] .search-box input {
    background: rgba(248, 250, 252, 0.9);
    border-color: rgba(203, 213, 225, 0.6);
}

:root[data-mode="light"] .search-box input:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--primary);
    box-shadow:
        0 0 0 3px rgba(59, 130, 246, 0.1),
        0 4px 12px rgba(59, 130, 246, 0.15);
}

:root[data-mode="light"] .category-pill {
    background: rgba(248, 250, 252, 0.8);
    border-color: rgba(226, 232, 240, 0.8);
}

:root[data-mode="light"] .category-pill:hover {
    background: rgba(241, 245, 249, 1);
}

:root[data-mode="light"] .frame-card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

:root[data-mode="light"] .frame-card:hover {
    box-shadow: var(--shadow-xl), 0 0 30px rgba(59, 130, 246, 0.15);
}

/* Default theme */
:root {
    --primary: #3b82f6;
    --primary-light: #60a5fa;
    --primary-dark: #2563eb;
    --accent: #8b5cf6;
    --accent-light: #a78bfa;
}

/* ========== THEME SWITCHER UI ========== */
.theme-switcher {
    position: relative;
}

.theme-toggle-btn {
    background: rgba(30, 41, 59, 0.6);
    border: 1.5px solid rgba(51, 65, 85, 0.5);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
    font-size: 1rem;
}

.theme-toggle-btn:hover {
    border-color: var(--primary);
    background: rgba(30, 41, 59, 0.8);
}

.theme-color-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: 2px solid var(--bg-panel);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.theme-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.75rem;
    min-width: 200px;
    box-shadow: var(--shadow-xl);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s ease;
    z-index: 1000;
}

.theme-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.theme-dropdown-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    padding: 0 0.5rem;
}

.theme-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.theme-option {
    background: var(--bg-dark);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.theme-option:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
}

.theme-option.active {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.theme-option-color {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
}

.theme-option-color::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: inherit;
    filter: brightness(1.2);
}

.theme-option-info {
    flex: 1;
}

.theme-option-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.125rem;
}

.theme-option-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Theme color previews */
.theme-option[data-theme="blue"] .theme-option-color {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
}

.theme-option[data-theme="purple"] .theme-option-color {
    background: linear-gradient(135deg, #a855f7, #ec4899);
}

.theme-option[data-theme="green"] .theme-option-color {
    background: linear-gradient(135deg, #10b981, #06b6d4);
}

.theme-option[data-theme="orange"] .theme-option-color {
    background: linear-gradient(135deg, #f97316, #eab308);
}

.theme-option[data-theme="red"] .theme-option-color {
    background: linear-gradient(135deg, #ef4444, #f59e0b);
}

.theme-option[data-theme="pink"] .theme-option-color {
    background: linear-gradient(135deg, #ec4899, #a855f7);
}

.theme-option[data-theme="cyan"] .theme-option-color {
    background: linear-gradient(135deg, #06b6d4, #8b5cf6);
}

.theme-option[data-theme="indigo"] .theme-option-color {
    background: linear-gradient(135deg, #6366f1, #ec4899);
}

/* Active theme indicator */
.theme-option.active .theme-option-color::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.75rem;
    z-index: 1;
}

/* ========== MODE TOGGLE (LIGHT/DARK) ========== */
.mode-toggle {
    position: relative;
}

.mode-toggle-btn {
    background: rgba(30, 41, 59, 0.6);
    border: 1.5px solid rgba(51, 65, 85, 0.5);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    font-size: 1.1rem;
    width: 38px;
    height: 38px;
}

:root[data-mode="light"] .mode-toggle-btn {
    background: rgba(248, 250, 252, 0.9);
    border-color: rgba(203, 213, 225, 0.6);
}

.mode-toggle-btn:hover {
    border-color: var(--primary);
    background: rgba(30, 41, 59, 0.8);
    transform: scale(1.05);
}

:root[data-mode="light"] .mode-toggle-btn:hover {
    background: rgba(241, 245, 249, 1);
}

.mode-icon {
    transition: all 0.3s ease;
}

.mode-icon-sun {
    color: #f59e0b;
}

.mode-icon-moon {
    color: #60a5fa;
}

/* Rotate animation on switch */
.mode-toggle-btn.switching .mode-icon {
    animation: rotate360 0.5s ease-in-out;
}

@keyframes rotate360 {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}