/* Template Customizer Enhanced Styles */

.template-customizer {
    position: fixed;
    top: 0;
    right: -420px;
    height: 100vh;
    z-index: 9999;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Public Sans', sans-serif;
}

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

.customizer-panel {
    width: 420px;
    height: 100vh;
    background: #ffffff;
    box-shadow: -8px 0 40px rgba(0,0,0,0.12);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.customizer-panel::-webkit-scrollbar {
    width: 6px;
}

.customizer-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.customizer-panel::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.customizer-panel::-webkit-scrollbar-thumb:hover {
    background: #555;
}

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

.customizer-header h5 {
    color: white;
    margin: 0;
    font-weight: 600;
    font-size: 1.25rem;
}

.customizer-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.25rem;
    line-height: 1;
    border-radius: 6px;
    transition: all 0.2s;
}

.customizer-close:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

.customizer-body {
    padding: 1.75rem 1.5rem;
    flex-grow: 1;
}

.customizer-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e7e7e7;
}

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

.customizer-section h6 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: #566a7f;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.theme-options, .font-size-options {
    display: flex;
    gap: 0.75rem;
}

.theme-option, .font-size-option {
    flex: 1;
    padding: 1rem 0.75rem;
    border: 2px solid #e7e7e7;
    background: #fafafa;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: #697a8d;
}

.theme-option i {
    font-size: 1.5rem;
}

.theme-option:hover, .font-size-option:hover {
    border-color: #696cff;
    background: #f8f8ff;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(105, 108, 255, 0.15);
}

.theme-option.active, .font-size-option.active {
    border-color: #696cff;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    color: #696cff;
    box-shadow: 0 4px 8px rgba(105, 108, 255, 0.2);
}

.color-options {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.65rem;
}

.color-option {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.color-option::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    opacity: 0;
    transition: opacity 0.3s;
}

.color-option:hover::before {
    opacity: 0.2;
    transform: scale(1.3);
}

.color-option i {
    color: white;
    font-size: 1.25rem;
    opacity: 0;
    transition: opacity 0.3s;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.color-option:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.color-option.active {
    border-color: #333;
    transform: scale(1.2);
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

.color-option.active i {
    opacity: 1;
}

.font-family-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e7e7e7;
    border-radius: 10px;
    font-size: 0.95rem;
    background: #fafafa;
    transition: all 0.3s;
    cursor: pointer;
}

.font-family-select:hover {
    border-color: #696cff;
    background: #f8f8ff;
}

.font-family-select:focus {
    outline: none;
    border-color: #696cff;
    box-shadow: 0 0 0 3px rgba(105, 108, 255, 0.1);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.form-check-input {
    width: 3rem;
    height: 1.5rem;
    cursor: pointer;
    background-color: #e7e7e7;
    border: none;
    border-radius: 1rem;
}

.form-check-input:checked {
    background-color: #696cff;
}

.form-check-label {
    cursor: pointer;
    font-weight: 500;
    color: #697a8d;
}

#resetSettings {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

#resetSettings:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

#resetSettings i {
    display: inline-block;
}

/* Dark theme for customizer panel */
[data-theme="dark"] .customizer-panel {
    background: #2b2c40;
    color: #a5a8b4;
}

[data-theme="dark"] .customizer-section {
    border-bottom-color: #3d3e56;
}

[data-theme="dark"] .customizer-section h6 {
    color: #c7c9d0;
}

[data-theme="dark"] .theme-option,
[data-theme="dark"] .font-size-option {
    background: #232333;
    border-color: #3d3e56;
    color: #a5a8b4;
}

[data-theme="dark"] .theme-option:hover,
[data-theme="dark"] .font-size-option:hover {
    background: #2f3349;
    border-color: #696cff;
}

[data-theme="dark"] .theme-option.active,
[data-theme="dark"] .font-size-option.active {
    background: #3d3e56;
    border-color: #696cff;
    color: #696cff;
}

[data-theme="dark"] .font-family-select {
    background: #232333;
    border-color: #3d3e56;
    color: #a5a8b4;
}

[data-theme="dark"] .font-family-select:hover {
    border-color: #696cff;
    background: #2f3349;
}

[data-theme="dark"] .form-check-label {
    color: #a5a8b4;
}

/* Responsive */
@media (max-width: 768px) {
    .template-customizer {
        right: -100%;
    }
    
    .customizer-panel {
        width: 100vw;
    }
    
    .customizer-toggle {
        left: -54px;
        width: 48px;
        height: 48px;
    }
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.customizer-section {
    animation: slideIn 0.4s ease-out;
}

.customizer-section:nth-child(1) { animation-delay: 0.05s; }
.customizer-section:nth-child(2) { animation-delay: 0.1s; }
.customizer-section:nth-child(3) { animation-delay: 0.15s; }
.customizer-section:nth-child(4) { animation-delay: 0.2s; }
.customizer-section:nth-child(5) { animation-delay: 0.25s; }
.customizer-section:nth-child(6) { animation-delay: 0.3s; }

