/* Field Customizer Styles */
#field-customizer-wrap {
    margin: 0;
    padding: 0;
}

.field-customizer-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-left: -20px;
    margin-right: -20px;
    margin-top: -10px;
    margin-bottom: 20px;
}

.field-customizer-header h1 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-size: 24px;
    font-weight: 600;
}

.field-customizer-header .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
}

.customizer-actions {
    display: flex;
    gap: 12px;
}

.customizer-actions .button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-weight: 500;
    text-decoration: none;
}

.customizer-actions .button-secondary {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
}

.customizer-actions .button-secondary:hover {
    background: rgba(255,255,255,0.3);
    color: white;
}

.customizer-actions .button:not(.button-secondary) {
    background: white;
    color: #667eea;
    border: 1px solid white;
}

.customizer-actions .button:not(.button-secondary):hover {
    background: #f8f9fa;
}

/* Main Container */
.field-customizer-container {
    display: flex;
    gap: 30px;
    min-height: 80vh;
}

/* Left Panel - Controls */
.customizer-controls {
    width: 400px;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    height: fit-content;
    overflow: hidden;
}

/* Mode switcher */
.customizer-mode .ef-mode-btn.is-active {
    background: #3858e9;
    color: #fff;
    border-color: #3858e9;
}

/* Customizer Sections */
.customizer-section {
    border-bottom: 1px solid #f0f0f1;
    overflow: hidden;
}

.customizer-section:last-child {
    border-bottom: none;
}

.customizer-section h3 {
    margin: 0;
    padding: 18px 24px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #e1e1e1;
    color: #1d2327;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
}

.customizer-section h3:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.customizer-section h3::after {
    content: "▼";
    position: absolute;
    right: 24px;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.customizer-section.collapsed h3::after {
    transform: rotate(-90deg);
}

.customizer-section .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #667eea;
}

.customizer-section h4 {
    margin: 20px 0 12px 0;
    padding: 0;
    font-size: 13px;
    font-weight: 600;
    color: #646970;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.customizer-section > div:not(h3) {
    padding: 24px;
    transition: all 0.3s ease;
}

.customizer-section.collapsed > div:not(h3) {
    display: none;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    font-weight: 500;
    font-size: 13px;
    color: #1d2327;
    margin: 0;
}

/* Input Controls */
.range-input {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e1e1e1;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.range-input::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
    transition: all 0.2s ease;
}

.range-input::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.range-input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.value-display {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    padding: 4px 8px;
    background: #f8f9fa;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #495057;
    margin-top: 4px;
    align-self: flex-start;
}

.color-input {
    width: 60px;
    height: 40px;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    background: none;
}

.color-input:hover {
    border-color: #667eea;
    transform: scale(1.05);
}

.select-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    font-size: 13px;
    background: white;
    transition: border-color 0.2s ease;
}

.select-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 1px #667eea;
}

.number-input {
    width: 80px;
    padding: 6px 8px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
    transition: border-color 0.2s ease;
}

.number-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 1px #667eea;
}

.form-group textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Courier New', monospace;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 1px #667eea;
}

.form-group small {
    color: #646970;
    font-size: 11px;
    font-style: italic;
    margin-top: 4px;
}

/* Spacing Controls */
.spacing-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}

.spacing-controls .form-group {
    margin-bottom: 12px;
}

.spacing-controls .form-group label {
    font-size: 11px;
    color: #646970;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Right Panel - Preview */
.customizer-preview {
    flex: 1;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    min-height: 600px;
}

.preview-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e1e1e1;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-header h3 {
    margin: 0;
    color: #1d2327;
    font-size: 16px;
    font-weight: 600;
}

.preview-field-type {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.preview-container {
    flex: 1;
    padding: 40px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

#field-preview {
    max-width: 400px;
    width: 100%;
}

/* Preview Field Styles */
.ef-preview-field {
    margin-bottom: 24px;
}

.ef-preview-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #1d2327;
    font-size: 14px;
}

.ef-preview-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.ef-preview-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.ef-field-help {
    display: block;
    margin-top: 6px;
    color: #646970;
    font-size: 12px;
    font-style: italic;
}

.ef-button-preview {
    text-align: center;
    margin-top: 24px;
}

.ef-preview-button {
    background: #007cba;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ef-preview-button:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.preview-info {
    padding: 20px 24px;
    border-top: 1px solid #e1e1e1;
    background: #f8f9fa;
    font-size: 13px;
}

.preview-info p {
    margin: 4px 0;
    color: #646970;
}

.preview-info strong {
    color: #1d2327;
}

/* Submit Section */
.submit-section {
    margin-top: 0;
    padding: 24px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-top: 1px solid #e1e1e1;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.submit-section .button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-weight: 500;
}

.submit-section .button-primary {
    background: linear-gradient(135deg, #00a32a 0%, #008a20 100%);
    border: none;
    color: white;
}

.submit-section .button-primary:hover {
    background: linear-gradient(135deg, #008a20 0%, #007017 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 163, 42, 0.3);
}

.submit-section .button-secondary {
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    color: #50575e;
}

.submit-section .button-secondary:hover {
    background: #f0f0f1;
    border-color: #8c8f94;
}

/* Loading States */
.button.loading {
    pointer-events: none;
    opacity: 0.7;
}

.button.loading::after {
    content: "";
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media screen and (max-width: 1200px) {
    .field-customizer-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .customizer-controls {
        width: 100%;
    }
    
    .spacing-controls {
        grid-template-columns: 1fr 1fr 1fr 1fr;
    }
}

@media screen and (max-width: 782px) {
    .field-customizer-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .field-customizer-header h1 {
        font-size: 20px;
    }
    
    .customizer-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .customizer-section > div:not(h3) {
        padding: 16px;
    }
    
    .preview-container {
        padding: 20px;
    }
    
    .spacing-controls {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .submit-section {
        flex-direction: column;
        gap: 8px;
    }
    
    .submit-section .button {
        justify-content: center;
    }
}

/* Success Animation */
@keyframes success-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.button.success {
    animation: success-pulse 0.3s ease-in-out;
}

/* Accessibility Improvements */
.range-input:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.color-input:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .customizer-section h3 {
        background: #000;
        color: #fff;
    }
    
    .ef-preview-input {
        border-width: 2px;
    }
    
    .range-input::-webkit-slider-thumb {
        background: #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}
