/* Interactive Customizer Styles */

.customizer-panel {
    position: fixed;
    top: 20px;
    right: -400px;
    width: 380px;
    max-height: calc(100vh - 40px);
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    overflow: hidden;
    display: none;
    flex-direction: column;
    font-size: 14px;
    transition: right 0.3s ease;
}

.customizer-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
}

.customizer-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.customizer-controls {
    display: flex;
    gap: 8px;
}

.customizer-controls .btn {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.customizer-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.customizer-section {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
}

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

.customizer-section h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
}

.selected-info {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
}

.element-preview {
    display: flex;
    align-items: center;
    gap: 8px;
}

.element-preview span {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.element-preview code {
    background: #e2e8f0;
    color: #2d3748;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 11px;
}

/* Tabs */
.nav-tabs {
    border-bottom: 1px solid #e2e8f0;
    padding: 0 20px;
    background: #f8fafc;
}

.nav-tabs .nav-link {
    border: none;
    color: #64748b;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    background: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-tabs .nav-link:hover {
    color: #667eea;
    border-color: transparent;
    background: rgba(102, 126, 234, 0.05);
}

.nav-tabs .nav-link.active {
    color: #667eea;
    background: white;
    border-color: #e2e8f0 #e2e8f0 white;
    border-bottom-color: white;
}

.tab-content {
    background: white;
}

.tab-pane {
    padding: 20px;
}

/* Customizer Groups */
.customizer-group {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

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

.customizer-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

/* Text Editing Group */
#text-editing-group {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}

#text-editing-group label {
    color: #667eea;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

#text-editing-group label::before {
    content: '✏️';
}

#text-content {
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    resize: vertical;
    transition: border-color 0.2s ease;
}

#text-content:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#apply-text-changes {
    background: #667eea;
    border-color: #667eea;
    font-weight: 600;
    transition: all 0.2s ease;
}

#apply-text-changes:hover {
    background: #5a67d8;
    border-color: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Color Controls */
.color-input-group {
    display: flex;
    gap: 8px;
}

.color-picker {
    width: 50px !important;
    height: 36px !important;
    padding: 2px !important;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
}

.hex-input {
    flex: 1;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 12px;
}

/* Border Controls */
.border-controls {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto;
    gap: 8px;
    align-items: center;
}

.border-controls span {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

/* Spacing Controls */
.spacing-controls {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 16px;
    align-items: center;
}

.spacing-controls span {
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
}

/* Shadow Controls */
.shadow-controls {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 16px;
    align-items: center;
}

.shadow-controls span {
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
}

/* Form Controls */
.form-range {
    margin: 0;
}

.form-select {
    font-size: 12px;
    padding: 6px 8px;
}

/* Hover Controls */
.hover-controls .form-check {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.hover-controls .form-check-label {
    font-size: 12px;
    margin-bottom: 0;
}

.hover-controls .form-range {
    flex: 1;
    min-width: 100px;
}

.hover-controls span {
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
    min-width: 40px;
}

/* Click Controls */
.click-controls .form-check {
    margin-bottom: 8px;
}

.click-controls .form-check-label {
    font-size: 12px;
}

/* Repeat Controls */
.repeat-controls .form-check {
    margin-bottom: 8px;
}

.repeat-controls .form-check-label {
    font-size: 12px;
}

/* Preset Grid */
.preset-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.preset-btn {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 500;
    color: #4a5568;
}

.preset-btn:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.preset-btn i {
    font-size: 16px;
}

/* Element Selection */
.customizer-preview-mode {
    cursor: crosshair !important;
}

.customizer-preview-mode * {
    cursor: crosshair !important;
}

.customizer-preview-mode *:hover:not(.customizer-selected) {
    outline: 2px dashed rgba(102, 126, 234, 0.5) !important;
    outline-offset: 1px !important;
}

.customizer-selected {
    outline: 3px solid #667eea !important;
    outline-offset: 2px !important;
    position: relative;
}

.customizer-selected::after {
    content: 'SELECTED - Double-click to edit text';
    position: absolute;
    top: -28px;
    left: 0;
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    z-index: 10001;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    white-space: nowrap;
}

/* Notifications */
.customizer-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10002;
    min-width: 300px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideInDown 0.3s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .customizer-panel {
        width: calc(100vw - 20px);
        right: 10px;
        left: 10px;
        top: 10px;
        max-height: calc(100vh - 20px);
    }

    .customizer-controls {
        flex-wrap: wrap;
        gap: 4px;
    }

    .customizer-controls .btn {
        font-size: 11px;
        padding: 4px 8px;
    }

    .color-input-group {
        flex-direction: column;
    }

    .border-controls,
    .spacing-controls,
    .shadow-controls {
        grid-template-columns: 1fr;
        gap: 8px;
    }

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

/* Scrollbar Styling */
.customizer-content::-webkit-scrollbar {
    width: 6px;
}

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

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

.customizer-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .customizer-panel {
        background: #1a202c;
        border-color: #2d3748;
        color: #e2e8f0;
    }

    .customizer-section {
        border-bottom-color: #2d3748;
    }

    .customizer-section h4 {
        color: #e2e8f0;
    }

    .selected-info {
        background: #2d3748;
        border-color: #4a5568;
    }

    .nav-tabs {
        background: #2d3748;
        border-bottom-color: #4a5568;
    }

    .nav-tabs .nav-link {
        color: #a0aec0;
    }

    .nav-tabs .nav-link.active {
        background: #1a202c;
        color: #667eea;
        border-color: #4a5568 #4a5568 #1a202c;
    }

    .tab-content {
        background: #1a202c;
    }

    .customizer-group {
        border-bottom-color: #2d3748;
    }

    .customizer-group label {
        color: #e2e8f0;
    }

    .preset-btn {
        background: #2d3748;
        border-color: #4a5568;
        color: #a0aec0;
    }

    .preset-btn:hover {
        background: #667eea;
        border-color: #667eea;
        color: white;
    }
}

/* Animation Enhancements */
.customizer-panel {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Loading States */
.customizer-loading {
    pointer-events: none;
    opacity: 0.7;
}

.customizer-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid #667eea;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}