/* Customer Theme Customizer CSS */

/* CSS Variables for easy color customization */
:root {
    --primary-color: #2E5BBA;
    --secondary-color: #3DD5F3;
    --accent-color: #B0B0B0;
    --text-primary: #333333;
    --text-secondary: #666666;
    --background-light: #f8f9fa;
    --border-color: #e9ecef;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
}

/* Theme Customizer Panel */
.theme-customizer {
    position: fixed;
    right: -300px;
    top: 50%;
    transform: translateY(-50%);
    width: 300px;
    background: white;
    box-shadow: -5px 0 20px rgba(0,0,0,0.1);
    border-radius: 10px 0 0 10px;
    z-index: 9999;
    transition: right 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
}

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

.theme-customizer-toggle {
    position: absolute;
    left: -40px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 60px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px 0 0 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

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

.theme-customizer h4 {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.color-section {
    margin-bottom: 25px;
}

.color-section h5 {
    margin-bottom: 15px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.color-picker-group {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
}

.color-picker-group label {
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
}

.color-picker {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
}

.color-picker input[type="color"] {
    width: 100%;
    height: 100%;
    border: none;
    cursor: pointer;
}

.preset-colors {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.preset-color {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.preset-color:hover {
    transform: scale(1.1);
    border-color: var(--primary-color);
}

.preset-color.active {
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.logo-section {
    margin-bottom: 25px;
}

.logo-upload {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.logo-upload:hover {
    border-color: var(--primary-color);
    background: var(--background-light);
}

.logo-upload input[type="file"] {
    display: none;
}

.logo-preview {
    max-width: 100%;
    max-height: 80px;
    margin-top: 10px;
    border-radius: 4px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-reset, .btn-save {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-reset {
    background: var(--background-light);
    color: var(--text-secondary);
}

.btn-reset:hover {
    background: #e9ecef;
}

.btn-save {
    background: var(--primary-color);
    color: white;
}

.btn-save:hover {
    background: #1e4a9a;
}

/* Apply custom colors to existing elements */
.customer-header {
    background: white !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.logo-icon {
    background: var(--primary-color) !important;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

.btn-signin {
    background: var(--primary-color) !important;
    border-radius: 0 !important;
}

.btn-signin:hover {
    background: #1e4a9a !important;
}

.btn-signup {
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    border-radius: 0 !important;
}

.btn-signup:hover {
    background: var(--primary-color) !important;
}

/* Make all buttons rectangular and smaller in customer portal */
.btn {
    border-radius: 0 !important;
    padding: 6px 12px !important;
    font-size: 13px !important;
}

.btn-primary {
    border-radius: 0 !important;
}

.btn-secondary {
    border-radius: 0 !important;
}

.btn-success {
    border-radius: 0 !important;
}

.btn-warning {
    border-radius: 0 !important;
}

.btn-danger {
    border-radius: 0 !important;
}

.btn-info {
    border-radius: 0 !important;
}

.sidebar-menu li.active a {
    background: var(--primary-color) !important;
}

.sidebar-menu li:hover a {
    color: white !important;
    background: var(--primary-color) !important;
}

.user-avatar {
    background: var(--primary-color) !important;
}

/* Custom logo integration */
.custom-logo {
    max-height: 50px;
    width: auto;
}

.logo-section .custom-logo {
    margin-right: 10px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .theme-customizer {
        width: 280px;
        right: -280px;
    }
    
    .theme-customizer-toggle {
        left: -35px;
        width: 35px;
        height: 50px;
    }
}

/* Animation for color changes */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Override Bootstrap and existing styles with custom colors */
.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.btn-primary:hover {
    background-color: #1e4a9a !important;
    border-color: #1e4a9a !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

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

/* Card and component styling */
.card {
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.card-header {
    background: var(--background-light);
    border-bottom: 1px solid var(--border-color);
}

/* Form elements */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(46, 91, 186, 0.25);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Progress bars */
.progress-bar {
    background-color: var(--primary-color);
}

/* Badges */
.badge-primary {
    background-color: var(--primary-color);
}

.badge {
    background-color: var(--secondary-color) !important;
}

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

.badge-info {
    background-color: var(--secondary-color) !important;
}

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

.badge-secondary {
    background-color: var(--secondary-color) !important;
}

/* Alerts */
.alert-primary {
    background-color: rgba(46, 91, 186, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Tables */
.table-primary {
    background-color: rgba(46, 91, 186, 0.1);
}

/* Pagination */
.page-link {
    color: var(--primary-color);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Dropdown */
.dropdown-item:hover {
    background-color: var(--background-light);
    color: var(--primary-color);
}