/**
 * WinBolo.net Base Styles
 * CSS Variables, Reset, Body, Common Utilities, Theme Toggle
 */

/* ============================================
   CSS Variables - Light Theme (Default)
   ============================================ */
:root {
    --primary-blue: #3366CC;
    --primary-blue-dark: #254a9e;
    --accent-orange: #FF9900;
    --accent-orange-light: #ffb84d;
    --border-color: #000000;
    --bg-white: #FFFFFF;
    --bg-gray: #f5f5f5;
    --text-dark: #333333;
    --text-muted: #666666;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
    --input-bg: #FFFFFF;
    --input-border: #ddd;
    --input-text: #333333;
    --input-placeholder: #999;
    --hover-bg: #e0e0e0;
    --divider-color: #eee;
    --code-bg: #f5f5f5;
    --alert-error-bg: #f8d7da;
    --alert-error-border: #f5c6cb;
    --alert-error-text: #721c24;
    --alert-success-bg: #d4edda;
    --alert-success-border: #c3e6cb;
    --alert-success-text: #155724;
    --warning-bg: #fff3cd;
    --warning-border: #ffc107;
    --warning-text: #856404;
}

/* ============================================
   CSS Variables - Dark Theme
   ============================================ */
[data-theme="dark"] {
    --primary-blue: #1a3a5c;
    --primary-blue-dark: #0f2847;
    --accent-orange: #b87a2a;
    --accent-orange-light: #c98f3d;
    --border-color: #e8e8e8;
    --bg-white: #16213e;
    --bg-gray: #1a1a2e;
    --text-dark: #e8e8e8;
    --text-muted: #a0a0a0;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.4);
    --input-bg: #0f3460;
    --input-border: #3a3a5c;
    --input-text: #e8e8e8;
    --input-placeholder: #6b6b8a;
    --hover-bg: #0f3460;
    --divider-color: #3a3a5c;
    --code-bg: #0d1b2a;
    --alert-error-bg: #4a1a1a;
    --alert-error-border: #7a2a2a;
    --alert-error-text: #ffb4b4;
    --alert-success-bg: #1a4a2a;
    --alert-success-border: #2a7a4a;
    --alert-success-text: #b4ffb4;
    --warning-bg: #4a3a1a;
    --warning-border: #7a5a2a;
    --warning-text: #ffe4b4;
    --link-color: #4d9fff;
    --link-hover: #7cb8ff;
    color-scheme: dark;
}

/* ============================================
   CSS Reset & Base Styles
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-gray);
    color: var(--text-dark);
    line-height: 1.6;
}

/* No transitions class for initial page load */
.no-transitions * {
    transition: none !important;
}

/* ============================================
   Links
   ============================================ */
a {
    color: var(--primary-blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ============================================
   Theme Toggle Button
   ============================================ */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 0.75rem;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.theme-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.theme-toggle-icon {
    width: 20px;
    height: 20px;
    color: white;
    transition: transform 0.3s ease;
}

.theme-toggle:hover .theme-toggle-icon {
    transform: rotate(15deg);
}

.theme-toggle-sun {
    display: block;
}

[data-theme="dark"] .theme-toggle-sun {
    display: none;
}

.theme-toggle-moon {
    display: none;
}

[data-theme="dark"] .theme-toggle-moon {
    display: block;
}

/* ============================================
   Dark Theme - Base Overrides
   ============================================ */
[data-theme="dark"] a {
    color: var(--link-color);
}

[data-theme="dark"] a:hover {
    color: var(--link-hover);
}

[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background-color: var(--input-bg);
    border-color: var(--input-border);
    color: var(--input-text);
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: var(--input-placeholder);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(77, 159, 255, 0.2);
}

[data-theme="dark"] select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0a0a0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
    padding-right: 2rem;
}

[data-theme="dark"] pre,
[data-theme="dark"] code {
    background-color: var(--code-bg);
}

/* ============================================
   Utility Classes
   ============================================ */
.enabled {
    color: #28a745;
    font-weight: 600;
}

.disabled {
    color: var(--text-muted);
    font-style: italic;
}