/* ===================================
   UNIFIED THEME SYSTEM
   Compatible with home.html, post_detail.html, topics.html
   =================================== */

/* DEFAULT THEME (Light/Purple Gradient) */
:root {
    /* Primary Brand Colors */
    --primary: #098f51;
    --primary-dark: #053f24;
    --primary-light: #64f1b0;
    --accent: #127e3b;
   
    
    /* Semantic Colors */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f3f4f6;
    --bg-hover: #f7f9fa;
    
    /* Text Colors */
    --text-primary: #1a1a2e;
    --text-secondary: #6c757d;
    --text-tertiary: #9ca3af;
    --text-inverse: #ffffff;
    
    /* Border & Divider Colors */
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --border-dark: #d1d5db;
    
    /* Shadows */
    --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.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Component-Specific Colors */
    --navbar-bg: #ffffff;
    --navbar-text: #1a1a2e;
    --sidebar-bg: #f7f9fa;
    --card-bg: #ffffff;
    --card-header-bg: #f7f9fa;
    
    /* Interactive States */
    --link-color: #358835;
    --link-hover: #3e722e;
    
    /* Layout Variables */
    --navbar-height: 64px;
    --container-max-width: 1400px;
    --sidebar-width: 300px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
}

/* DARK THEME */
[data-theme="dark"] {
    /* Primary Brand Colors - Adjusted for dark mode */
    --primary: #098f51;
    --primary-dark: #053f24;
    --primary-light: #64f1b0;
    --accent: #188b45;
   
    
    /* Semantic Colors - Brighter for dark bg */
    --success: #34d399;
    --danger: #f87171;
    --warning: #fbbf24;
    --info: #60a5fa;
    
    /* Background Colors */
    --bg-primary: #000000;
    --bg-secondary: #16181c;
    --bg-tertiary: #1c1f23;
    --bg-hover: #16181c;
    
    /* Text Colors */
    --text-primary: #e7e9ea;
    --text-secondary: #71767b;
    --text-tertiary: #536471;
    --text-inverse: #000000;
    
    /* Border & Divider Colors */
    --border-color: #2f3336;
    --border-light: #1c1f23;
    --border-dark: #3e4144;
    
    /* Shadows - Lighter for dark mode */
    --shadow-sm: 0 1px 2px 0 rgba(255, 255, 255, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(255, 255, 255, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(255, 255, 255, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(255, 255, 255, 0.1);
    
    /* Component-Specific Colors */
    --navbar-bg: #000000;
    --navbar-text: #e7e9ea;
    --sidebar-bg: #16181c;
    --card-bg: #000000;
    --card-header-bg: #1c1f23;
    
    /* Interactive States */
    --link-color: #8b9cff;
    --link-hover: #a5b4ff;
}

/* MINIMAL THEME (Reddit-style) */
[data-theme="minimal"] {
    /* Primary Brand Colors - Muted/Professional */
    --primary: #718087;
    --primary-dark: #494949;
    --primary-light: #9ca3af;
    --accent: #0079d3;
    
    /* Semantic Colors */
    --success: #46d160;
    --danger: #ff4500;
    --warning: #ffa500;
    --info: #0079d3;
    
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f6f7f8;
    --bg-tertiary: #eff1f3;
    --bg-hover: #f6f7f8;
    
    /* Text Colors */
    --text-primary: #1c1c1c;
    --text-secondary: #7c7c7c;
    --text-tertiary: #a8a8a8;
    --text-inverse: #ffffff;
    
    /* Border & Divider Colors */
    --border-color: #ccc;
    --border-light: #e3e3e3;
    --border-dark: #999;
    
    /* Shadows - Subtle */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    --shadow-md: 0 2px 4px 0 rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 8px 0 rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 8px 16px 0 rgba(0, 0, 0, 0.12);
    
    /* Component-Specific Colors */
    --navbar-bg: #ffffff;
    --navbar-text: #1c1c1c;
    --sidebar-bg: #f6f7f8;
    --card-bg: #ffffff;
    --card-header-bg: #f6f7f8;
    
    /* Interactive States */
    --link-color: #0079d3;
    --link-hover: #005fa3;
}

/* MINIMAL THEME (Reddit-style) */
[data-theme=""] {
    /* Primary Brand Colors - Muted/Professional */
    --primary: #2d8ab4;
    --primary-dark: #253e75;
    --primary-light: #acc4ee;
    --accent: #0079d3;
    
    /* Semantic Colors */
    --success: #46d160;
    --danger: #ff4500;
    --warning: #ffa500;
    --info: #0079d3;
    
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f6f7f8;
    --bg-tertiary: #eff1f3;
    --bg-hover: #f6f7f8;
    
    /* Text Colors */
    --text-primary: #1c1c1c;
    --text-secondary: #7c7c7c;
    --text-tertiary: #a8a8a8;
    --text-inverse: #ffffff;
    
    /* Border & Divider Colors */
    --border-color: #ccc;
    --border-light: #e3e3e3;
    --border-dark: #999;
    
    /* Shadows - Subtle */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    --shadow-md: 0 2px 4px 0 rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 8px 0 rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 8px 16px 0 rgba(0, 0, 0, 0.12);
    
    /* Component-Specific Colors */
    --navbar-bg: #ffffff;
    --navbar-text: #1c1c1c;
    --sidebar-bg: #f6f7f8;
    --card-bg: #ffffff;
    --card-header-bg: #f6f7f8;
    
    /* Interactive States */
    --link-color: #0079d3;
    --link-hover: #005fa3;
}


/* ===================================
   GLOBAL RESETS & BASE STYLES
   =================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transition: background-color var(--transition-base), color var(--transition-base);
    line-height: 1.6;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--link-hover);
}

/* ===================================
   THEME SWITCHER STYLES
   =================================== */

.theme-switcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    z-index: 9998;
    transition: all var(--transition-base);
}

.theme-switcher-toggle {
    background: var(--primary);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-full);
    width: 48px;
    height: 48px;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
}

.theme-switcher-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.theme-options {
    display: none;
    margin-top: 1rem;
    gap: 0.5rem;
    flex-direction: column;
}

.theme-switcher.open .theme-options {
    display: flex;
}

.theme-option {
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-weight: 600;
    color: var(--text-primary);
}

.theme-option:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    transform: translateX(4px);
}

.theme-option.active {
    background: var(--primary);
    color: var(--text-inverse);
    border-color: var(--primary);
}

/* ===================================
   RESPONSIVE ADJUSTMENTS
   =================================== */

@media (max-width: 768px) {
    :root {
        --navbar-height: 56px;
        --sidebar-width: 100%;
    }
    
    .theme-switcher {
        bottom: 10px;
        right: 10px;
        padding: 0.5rem;
    }
    
    .theme-switcher-toggle {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
}

/* ===================================
   UTILITY CLASSES
   =================================== */

.gradient-bg {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: var(--text-inverse);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

/* ===================================
   SMOOTH THEME TRANSITIONS
   =================================== */

body,
.card,
.btn-primary,
.btn-secondary,
.theme-option,
a {
    transition-property: background-color, color, border-color, box-shadow;
    transition-duration: var(--transition-base);
    transition-timing-function: ease;
}
