/* Theme Variables - Light Mode (Default) */
:root {
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-sidebar: linear-gradient(180deg, #1e3c72 0%, #2a5298 100%);
    
    /* Text Colors */
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-light: #999999;
    --text-white: #ffffff;
    --text-tertiary: #adb5bd;
    
    /* Card Colors */
    --card-bg: #ffffff;
    --card-border: #e0e0e0;
    --card-shadow: rgba(0, 0, 0, 0.1);
    --card-shadow-hover: rgba(42, 82, 152, 0.2);
    
    /* Accent Colors */
    --accent-primary: #2a5298;
    --accent-hover: #1e3c72;
    
    /* Status Colors */
    --success-bg: #d4edda;
    --success-text: #155724;
    --success-border: #c3e6cb;
    
    --error-bg: #f8d7da;
    --error-text: #721c24;
    --error-border: #f5c6cb;
    
    --warning-bg: #fff3cd;
    --warning-text: #856404;
    --warning-border: #ffeeba;

    /* Form Colors */
    --input-bg: #ffffff;
    --border-color: #d0d0d0;
}

/* Theme Variables - Dark Mode */
[data-theme="dark"] {
    /* Background Colors */
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-sidebar: linear-gradient(180deg, #0f1e3a 0%, #1a2d4d 100%);
    
    /* Text Colors */
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-light: #808080;
    --text-white: #ffffff;
    --text-tertiary: #6c757d;
    
    /* Card Colors */
    --card-bg: #2d2d2d;
    --card-border: #404040;
    --card-shadow: rgba(0, 0, 0, 0.3);
    --card-shadow-hover: rgba(42, 82, 152, 0.4);
    
    /* Accent Colors */
    --accent-primary: #4a7bc8;
    --accent-hover: #5a8bd8;
    
    /* Status Colors */
    --success-bg: #1e4620;
    --success-text: #d4edda;
    --success-border: #2e6b30;
    
    --error-bg: #4c1e1e;
    --error-text: #f8d7da;
    --error-border: #6b2e2e;
    
    --warning-bg: #4c3e1e;
    --warning-text: #fff3cd;
    --warning-border: #6b582e;

    /* Form Colors */
    --input-bg: #3a3a3a;
    --border-color: #555555;
}

/* ============================================
   Global Reset & Base Styles
   ============================================ */
body, html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ============================================
   Common Components
   ============================================ */

/* Page Headers */
.page-header {
    margin-bottom: 30px;
    padding-top: 0;
}

.page-header h1 {
    color: var(--accent-primary);
    font-size: 32px;
    margin-bottom: 10px;
    font-weight: 600;
}

/* Cards */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: 0 4px 15px var(--card-shadow);
    color: var(--text-primary);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 25px var(--card-shadow-hover);
    border-color: var(--accent-primary);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    font-family: inherit;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-primary {
    background: var(--accent-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background: #c82333;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

.form-group label .required {
    color: #dc3545;
    margin-left: 3px;
}

.form-input, .form-control, .form-select, textarea, input[type="text"], input[type="email"], input[type="password"], input[type="number"], select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.form-input:focus, .form-control:focus, .form-select:focus, textarea:focus, input:focus, select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

[data-theme="dark"] .form-input:focus {
    box-shadow: 0 0 0 3px rgba(74, 123, 200, 0.2);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Alerts & Messages */
.alert, .message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert-success, .message.success {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: var(--success-border);
    border-left: 4px solid var(--success-text);
}

.alert-error, .message.error {
    background: var(--error-bg);
    color: var(--error-text);
    border-color: var(--error-border);
    border-left: 4px solid var(--error-text);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--card-border);
    overflow-x: auto;
    padding-bottom: 2px;
}

.tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab-btn:hover {
    color: var(--accent-primary);
}

.tab-btn.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block !important;
}

/* Badges */
.badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

/* Theme Toggle Specifics */
.theme-toggle-container {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.1);
}

.theme-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateX(3px);
}

.theme-icon {
    font-size: 18px;
    margin-right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    transition: transform 0.3s ease;
}

.theme-toggle:hover .theme-icon {
    transform: rotate(15deg);
}

.theme-text {
    font-size: 14px;
    white-space: nowrap;
    transition: opacity 0.3s ease, width 0.3s ease;
}

/* Collapsed Sidebar Theme Toggle */
.sidebar.collapsed .theme-toggle-container {
    padding: 15px 10px;
}

.sidebar.collapsed .theme-toggle {
    justify-content: center;
    padding: 12px;
}

.sidebar.collapsed .theme-text {
    opacity: 0;
    width: 0;
    margin: 0;
}

.sidebar.collapsed .theme-icon {
    margin-right: 0;
}

/* Welcome Section Specifics (Kept here as per original structure, but simplified) */
.welcome-title {
    color: var(--accent-primary);
}

.welcome-subtitle {
    color: var(--text-secondary);
}

.card-icon {
    color: var(--accent-primary);
}

/* Apply Theme to Sidebar */
.sidebar {
    background: var(--bg-sidebar);
    transition: background 0.3s ease;
}
