/* HRMIS Theme Styles */
/* Dynamic theme customization system */

/* Theme CSS Variables Override */
/* These variables can be dynamically updated via JavaScript for real-time theming */

.theme-blue {
    --primary-light: #E3F2FD;
    --primary: #2196F3;
    --primary-dark: #1976D2;
}

.theme-green {
    --primary-light: #E8F5E8;
    --primary: #4CAF50;
    --primary-dark: #388E3C;
}

.theme-purple {
    --primary-light: #F3E5F5;
    --primary: #9C27B0;
    --primary-dark: #7B1FA2;
}

.theme-orange {
    --primary-light: #FFF3E0;
    --primary: #FF9800;
    --primary-dark: #F57C00;
}

.theme-red {
    --primary-light: #FFEBEE;
    --primary: #F44336;
    --primary-dark: #D32F2F;
}

.theme-teal {
    --primary-light: #E0F2F1;
    --primary: #009688;
    --primary-dark: #00695C;
}

.theme-indigo {
    --primary-light: #E8EAF6;
    --primary: #3F51B5;
    --primary-dark: #303F9F;
}

.theme-pink {
    --primary-light: #FCE4EC;
    --primary: #E91E63;
    --primary-dark: #C2185B;
}

/* Government Theme Variations */
.theme-government-blue {
    --primary-light: #E1F0FF;
    --primary: #1E3A8A;
    --primary-dark: #1E40AF;
    --secondary: #64748B;
    --secondary-dark: #475569;
}

.theme-government-green {
    --primary-light: #ECFDF5;
    --primary: #065F46;
    --primary-dark: #064E3B;
    --secondary: #6B7280;
    --secondary-dark: #4B5563;
}

.theme-philippine-flag {
    --primary-light: #FEF3C7;
    --primary: #D97706;
    --primary-dark: #92400E;
    --accent: #DC2626;
    --accent-secondary: #1D4ED8;
}

/* Professional Themes */
.theme-corporate {
    --primary-light: #F8FAFC;
    --primary: #334155;
    --primary-dark: #1E293B;
    --secondary-light: #F1F5F9;
    --secondary: #64748B;
    --secondary-dark: #475569;
    --bg-secondary: #F8FAFC;
}

.theme-modern {
    --primary-light: #F0F9FF;
    --primary: #0284C7;
    --primary-dark: #0369A1;
    --secondary-light: #F9FAFB;
    --secondary: #6B7280;
    --secondary-dark: #374151;
}

/* Accessibility Themes */
.theme-high-contrast {
    --primary-light: #FFFFFF;
    --primary: #000000;
    --primary-dark: #000000;
    --secondary-light: #F5F5F5;
    --secondary: #808080;
    --secondary-dark: #404040;
    --text-primary: #000000;
    --text-secondary: #404040;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F5F5F5;
    --border-color: #000000;
}

.theme-low-vision {
    --primary-light: #FFFACD;
    --primary: #8B4513;
    --primary-dark: #654321;
    --secondary-light: #FFF8DC;
    --secondary: #A0522D;
    --secondary-dark: #8B4513;
    --text-primary: #000000;
    --text-secondary: #654321;
    --bg-primary: #FFFEF7;
    --bg-secondary: #FFF8DC;
    --border-color: #8B4513;
}

/* Custom Brand Colors */
/* These can be dynamically set through the MIS Portal */
.custom-brand {
    --primary-light: var(--custom-primary-light, #E3F2FD);
    --primary: var(--custom-primary, #2196F3);
    --primary-dark: var(--custom-primary-dark, #1976D2);
    --secondary-light: var(--custom-secondary-light, #F5F5F5);
    --secondary: var(--custom-secondary, #9E9E9E);
    --secondary-dark: var(--custom-secondary-dark, #616161);
    --accent: var(--custom-accent, #FF5722);
    --bg-primary: var(--custom-bg-primary, #FFFFFF);
    --bg-secondary: var(--custom-bg-secondary, #FAFAFA);
}

/* Theme Transitions */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

.app-header,
.app-sidebar,
.content-card,
.dashboard-card,
.btn,
.form-group input,
.form-group select,
.form-group textarea {
    transition:
        background-color 0.3s ease,
        border-color 0.3s ease,
        color 0.3s ease,
        box-shadow 0.3s ease;
}

/* Theme Preview Styles */
.theme-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 8px;
}

.theme-preview:hover {
    background: var(--secondary-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-light);
}

.theme-preview.active {
    border-color: var(--primary);
    background: var(--primary-light);
}

.theme-preview-colors {
    display: flex;
    gap: 4px;
}

.theme-preview-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.theme-preview-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--text-primary);
}

.theme-preview-info p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

/* Color Picker Component */
.color-picker-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.color-picker-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.color-picker-item label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.color-picker-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-picker-input input[type="color"] {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
}

.color-picker-input input[type="text"] {
    flex: 1;
    font-family: monospace;
    text-transform: uppercase;
}

/* Theme Customizer Panel */
.theme-customizer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--bg-primary);
    border-left: 1px solid var(--border-color);
    box-shadow: var(--shadow-medium);
    z-index: 1001;
    transition: var(--transition);
    overflow-y: auto;
}

.theme-customizer.show {
    right: 0;
}

.theme-customizer-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.theme-customizer-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.theme-customizer-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    color: var(--text-secondary);
}

.theme-customizer-body {
    padding: 20px;
}

.theme-section {
    margin-bottom: 32px;
}

.theme-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Live Preview Styles */
.theme-live-preview {
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-light);
}

.theme-live-preview h5 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-elements {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: var(--primary);
    color: white;
    border-radius: var(--border-radius);
    font-size: 12px;
}

.preview-sidebar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: var(--bg-secondary);
    border-left: 3px solid var(--primary);
    border-radius: var(--border-radius);
    font-size: 11px;
}

.preview-content {
    padding: 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 11px;
}

.preview-button {
    display: inline-block;
    padding: 4px 8px;
    background: var(--primary);
    color: white;
    border-radius: var(--border-radius);
    font-size: 10px;
    text-decoration: none;
    margin-top: 4px;
}

/* Theme Actions */
.theme-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.theme-actions .btn {
    flex: 1;
    min-width: 100px;
    font-size: 12px;
    padding: 8px 12px;
}

/* Export/Import Theme */
.theme-export-import {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.theme-code-block {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 12px;
    font-family: monospace;
    font-size: 11px;
    max-height: 200px;
    overflow-y: auto;
    margin: 8px 0;
    white-space: pre;
    line-height: 1.4;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: var(--primary);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: var(--shadow-medium);
    cursor: pointer;
    font-size: 18px;
    z-index: 1000;
    transition: var(--transition);
}

.theme-toggle-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-50%) scale(1.1);
}

/* Responsive Theme Customizer */
@media (max-width: 768px) {
    .theme-customizer {
        width: 100%;
        right: -100%;
    }

    .theme-toggle-btn {
        bottom: 20px;
        top: auto;
        right: 20px;
        transform: none;
    }

    .color-picker-group {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .theme-actions {
        flex-direction: column;
    }

    .theme-actions .btn {
        width: 100%;
    }
}