/**
 * PokePlasma - Theme System
 * Light/Dark mode styles
 */

/* =============================================================================
   CSS Variables - Dark Theme (Default)
   ============================================================================= */

:root {
    /* Dark Theme Colors */
    --theme-bg-primary: #0a0a1a;
    --theme-bg-secondary: #12122a;
    --theme-bg-tertiary: #1a1a3e;
    --theme-text-primary: #ffffff;
    --theme-text-secondary: rgba(255, 255, 255, 0.85);
    --theme-text-tertiary: rgba(255, 255, 255, 0.6);
    --theme-text-muted: rgba(255, 255, 255, 0.4);
    --theme-border: rgba(255, 255, 255, 0.1);
    --theme-glass-bg: rgba(255, 255, 255, 0.05);
    --theme-glass-border: rgba(255, 255, 255, 0.1);
    --theme-shadow: rgba(0, 0, 0, 0.3);
    --theme-card-opacity: 0.3;
    --theme-overlay: rgba(0, 0, 0, 0.5);
}

/* =============================================================================
   CSS Variables - Light Theme
   ============================================================================= */

[data-theme="light"] {
    --theme-bg-primary: #f0f4f8;
    --theme-bg-secondary: #e2e8f0;
    --theme-bg-tertiary: #ffffff;
    --theme-text-primary: #1a202c;
    --theme-text-secondary: rgba(26, 32, 44, 0.85);
    --theme-text-tertiary: rgba(26, 32, 44, 0.6);
    --theme-text-muted: rgba(26, 32, 44, 0.4);
    --theme-border: rgba(0, 0, 0, 0.1);
    --theme-glass-bg: rgba(255, 255, 255, 0.7);
    --theme-glass-border: rgba(0, 0, 0, 0.1);
    --theme-shadow: rgba(0, 0, 0, 0.1);
    --theme-card-opacity: 0.5;
    --theme-overlay: rgba(255, 255, 255, 0.5);
}

/* =============================================================================
   Theme Toggle Button
   ============================================================================= */

.theme-toggle {
    position: relative;
    width: 36px;
    height: 36px;
    background: var(--theme-glass-bg);
    border: 1px solid var(--theme-glass-border);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    overflow: hidden;
}

.theme-toggle:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
    transform: scale(1.05);
}

.theme-toggle-icon {
    position: absolute;
    width: 20px;
    height: 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sun Icon */
.theme-icon-sun {
    color: #fbbf24;
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

/* Moon Icon */
.theme-icon-moon {
    color: #a78bfa;
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Light theme - show sun, hide moon */
[data-theme="light"] .theme-icon-sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

[data-theme="light"] .theme-icon-moon {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

/* =============================================================================
   Body & Background Overrides
   ============================================================================= */

[data-theme="light"] body {
    background: linear-gradient(135deg, var(--theme-bg-primary) 0%, var(--theme-bg-secondary) 100%);
}

[data-theme="light"] .bg-particles {
    opacity: 0.3;
}

/* =============================================================================
   Header Overrides (Light Theme Only)
   ============================================================================= */

[data-theme="light"] .header {
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid var(--theme-border);
}

[data-theme="light"] .logo h1 {
    color: var(--theme-text-primary);
}

[data-theme="light"] .logo h1 span {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* =============================================================================
   Search Bar Overrides (Light Theme)
   ============================================================================= */

[data-theme="light"] .search-container {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--theme-border);
}

[data-theme="light"] #searchInput {
    color: var(--theme-text-primary);
}

[data-theme="light"] #searchInput::placeholder {
    color: var(--theme-text-muted);
}

[data-theme="light"] .toolbar-btn {
    color: var(--theme-text-secondary);
}

[data-theme="light"] .toolbar-btn:hover {
    background: rgba(99, 102, 241, 0.1);
}

[data-theme="light"] .search-stats {
    color: var(--theme-text-tertiary);
}

/* =============================================================================
   Cards Overrides (Light Theme)
   ============================================================================= */

[data-theme="light"] .pokemon-card {
    background: rgba(255, 255, 255, 0.8);
    border-color: var(--theme-border);
    box-shadow: 0 4px 20px var(--theme-shadow);
}

[data-theme="light"] .pokemon-card::before {
    opacity: var(--theme-card-opacity);
}

[data-theme="light"] .pokemon-name {
    color: var(--theme-text-primary);
}

[data-theme="light"] .pokemon-id {
    background: rgba(0, 0, 0, 0.05);
    color: var(--theme-text-secondary);
}

/* =============================================================================
   Filters Sidebar Overrides (Light Theme)
   ============================================================================= */

[data-theme="light"] .filters-section {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(240, 244, 248, 0.95) 100%);
}

[data-theme="light"] .filter-label {
    color: var(--theme-text-primary);
}

[data-theme="light"] .type-pill,
[data-theme="light"] .generation-pill,
[data-theme="light"] .category-pill,
[data-theme="light"] .region-pill {
    background: rgba(0, 0, 0, 0.05);
    color: var(--theme-text-secondary);
    border-color: var(--theme-border);
}

/* =============================================================================
   Dropdowns Overrides (Light Theme)
   ============================================================================= */

[data-theme="light"] .lang-dropdown,
[data-theme="light"] .sort-dropdown {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--theme-border);
    box-shadow: 0 10px 40px var(--theme-shadow);
}

[data-theme="light"] .lang-option,
[data-theme="light"] .sort-option {
    color: var(--theme-text-primary);
}

[data-theme="light"] .lang-option:hover,
[data-theme="light"] .sort-option:hover {
    background: rgba(99, 102, 241, 0.1);
}

/* =============================================================================
   Detail Page Glass Cards (Light Theme)
   ============================================================================= */

[data-theme="light"] .glass-card {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .info-label {
    color: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .info-value {
    color: rgba(0, 0, 0, 0.9);
}

[data-theme="light"] .stat-name {
    color: rgba(0, 0, 0, 0.7);
}

[data-theme="light"] .stat-value,
[data-theme="light"] .stat-value-secondary {
    color: rgba(0, 0, 0, 0.8);
}

[data-theme="light"] .stats-total-label,
[data-theme="light"] .stats-total-value {
    color: rgba(0, 0, 0, 0.9);
}

[data-theme="light"] .stats-label-base {
    background: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .stats-label-minmax {
    color: rgba(0, 0, 0, 0.5);
}

/* =============================================================================
   Scroll Top Button (Light Theme)
   ============================================================================= */

[data-theme="light"] .scroll-top {
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary);
    border: 1px solid var(--theme-border);
}

/* =============================================================================
   Back Button in Header (for Detail View)
   ============================================================================= */

.header-back-btn {
    display: none;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: 8px 16px;
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    margin-right: 16px;
}

.header-back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.header-back-btn svg {
    width: 18px;
    height: 18px;
}

.header-back-btn.visible {
    display: flex;
}

[data-theme="light"] .header-back-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--theme-text-primary);
}

[data-theme="light"] .header-back-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* =============================================================================
   Transitions for Theme Change
   ============================================================================= */

body,
.header,
.search-container,
.pokemon-card,
.filters-section,
.glass-card,
.lang-dropdown,
.sort-dropdown {
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

