/* ============================================
   THEME CUSTOMIZER & COLOR PICKER STYLES
   ============================================ */

/* Theme Customizer */
.theme-customizer {
    position: fixed;
    right: -400px;
    top: 0;
    bottom: 0;
    width: 400px;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 9998;
    transition: right 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

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

/* Customizer Header */
.customizer-header {
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1;
}

.customizer-header h3 {
    margin: 0;
    font-size: 18px;
    font-family: 'Fredoka One', cursive;
}

.btn-close-customizer {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-close-customizer:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Customizer Content */
.customizer-content {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.customizer-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

.customizer-section:last-child {
    border-bottom: none;
}

.customizer-section h4 {
    margin: 0 0 16px 0;
    color: #2c3e50;
    font-size: 14px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Preset Themes */
.preset-themes {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.preset-btn {
    flex: 1;
    min-width: 80px;
    padding: 12px;
    background: white;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    font-family: 'Comfortaa', cursive;
}

.preset-btn:hover {
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.05);
}

/* Color Picker Group */
.color-picker-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.color-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-item label {
    flex: 1;
    font-weight: 600;
    color: #2c3e50;
    font-size: 13px;
}

.color-item input[type="color"] {
    width: 60px;
    height: 50px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-item input[type="color"]:hover {
    border-color: #3498db;
    box-shadow: 0 0 12px rgba(52, 152, 219, 0.2);
}

/* Theme Management */
.theme-management {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.theme-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-family: 'Comfortaa', cursive;
    font-size: 13px;
    transition: all 0.2s ease;
}

.theme-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 12px rgba(52, 152, 219, 0.1);
}

.theme-management .btn {
    flex-shrink: 0;
}

/* Saved Themes List */
.saved-themes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.saved-theme-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #ecf0f1;
    transition: all 0.2s ease;
}

.saved-theme-item:hover {
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.05);
}

.theme-info {
    flex: 1;
}

.theme-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 13px;
}

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

.color-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #ecf0f1;
}

.theme-actions {
    display: flex;
    gap: 8px;
    margin-left: 12px;
}

.btn-apply,
.btn-delete {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #ecf0f1;
    background: white;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-apply:hover {
    background: #2ecc71;
    border-color: #2ecc71;
    color: white;
}

.btn-delete:hover {
    background: #e74c3c;
    border-color: #e74c3c;
    color: white;
}

/* Import/Export */
.import-export {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.import-export .btn {
    width: 100%;
}

/* Color Preview */
.color-preview {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #ecf0f1;
}

.color-preview h4 {
    margin: 0 0 16px 0;
    color: #2c3e50;
    font-size: 14px;
    text-transform: uppercase;
    font-weight: 700;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 12px;
}

.preview-box {
    padding: 16px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    font-size: 12px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.preview-box:hover {
    transform: scale(1.05);
}

/* Scrollbar */
.theme-customizer::-webkit-scrollbar {
    width: 8px;
}

.theme-customizer::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.theme-customizer::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 4px;
}

.theme-customizer::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

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

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

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

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

    .preview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .theme-customizer {
        width: 100%;
    }

    .customizer-content {
        padding: 16px;
    }

    .customizer-section {
        margin-bottom: 20px;
        padding-bottom: 16px;
    }

    .preset-btn {
        min-width: 70px;
        padding: 10px;
        font-size: 12px;
    }

    .color-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .color-item input[type="color"] {
        width: 100%;
        height: 40px;
    }

    .preview-grid {
        grid-template-columns: 1fr;
    }
}

/* Dark Mode Support */
body.dark-mode .theme-customizer {
    background: #34495e;
}

body.dark-mode .customizer-section {
    border-bottom-color: #52687a;
}

body.dark-mode .customizer-section h4 {
    color: #ecf0f1;
}

body.dark-mode .preset-btn {
    background: #2c3e50;
    border-color: #52687a;
    color: #ecf0f1;
}

body.dark-mode .preset-btn:hover {
    background: rgba(52, 152, 219, 0.1);
    border-color: #3498db;
}

body.dark-mode .color-item label {
    color: #ecf0f1;
}

body.dark-mode .color-item input[type="color"] {
    border-color: #52687a;
}

body.dark-mode .theme-input {
    background: #2c3e50;
    border-color: #52687a;
    color: #ecf0f1;
}

body.dark-mode .theme-input::placeholder {
    color: #95a5a6;
}

body.dark-mode .theme-input:focus {
    border-color: #3498db;
}

body.dark-mode .saved-theme-item {
    background: #2c3e50;
    border-color: #52687a;
}

body.dark-mode .saved-theme-item:hover {
    background: rgba(52, 152, 219, 0.15);
}

body.dark-mode .theme-name {
    color: #ecf0f1;
}

body.dark-mode .color-preview {
    background: #2c3e50;
    border-color: #52687a;
}

body.dark-mode .color-preview h4 {
    color: #ecf0f1;
}

body.dark-mode .theme-customizer::-webkit-scrollbar-track {
    background: #2c3e50;
}

body.dark-mode .theme-customizer::-webkit-scrollbar-thumb {
    background: #52687a;
}

body.dark-mode .theme-customizer::-webkit-scrollbar-thumb:hover {
    background: #7f8c8d;
}

/* CSS Custom Properties for Themes */
:root {
    --color-primary: #3498db;
    --color-secondary: #9b59b6;
    --color-success: #2ecc71;
    --color-danger: #e74c3c;
    --color-warning: #f39c12;
    --color-background: #ffffff;
    --color-text: #2c3e50;
    --color-border: #ecf0f1;
}

/* Apply custom colors */
.btn-primary {
    background: var(--color-primary) !important;
}

.btn-secondary {
    border-color: var(--color-secondary) !important;
}

.btn-success {
    background: var(--color-success) !important;
}

.btn-danger {
    background: var(--color-danger) !important;
}

.btn-warning {
    background: var(--color-warning) !important;
}
