/* Step 6: Final Adjustments Styles */

/* Main Container */
#step6 {
    max-width: 100%;
    width: 100%;
}

.adjustments-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
    padding: 1rem;
}

/* Adjustments Panel */
.adjustments-panel {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    height: fit-content;
    max-height: 600px;
    overflow-y: auto;
}

.panel-header {
    margin-bottom: 1.5rem;
    text-align: center;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 1rem;
}

.panel-header h3 {
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
    font-size: 1.3rem;
}

.panel-header p {
    color: #6c757d;
    margin: 0;
    font-size: 0.9rem;
}

/* Adjustment Sections */
.adjustment-section {
    margin-bottom: 2rem;
}

.adjustment-section:last-child {
    margin-bottom: 0;
}

.adjustment-section h4 {
    color: #3498db;
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 0.5rem;
}

/* Element List */
.element-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.element-item {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.element-item:hover {
    border-color: #3498db;
    background: #f0f8ff;
}

.element-item.active {
    border-color: #27ae60;
    background: #f8fff8;
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.2);
}

.element-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.element-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
}

.element-type {
    background: #3498db;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
}

.element-type.text {
    background: #e74c3c;
}

.element-type.artwork {
    background: #9b59b6;
}

.element-preview {
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
    margin: 0;
}

.element-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.element-item:hover .element-actions {
    opacity: 1;
}

.element-icon {
    width: 20px;
    height: 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s ease;
}

.element-icon:hover {
    background: #495057;
}

/* No Elements Message */
.no-elements-message {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.no-elements-message p {
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
}

.back-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    margin: 0 0.25rem;
    transition: background 0.3s ease;
}

.back-btn:hover {
    background: #2980b9;
}

/* Controls Panel */
.controls-panel {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    height: fit-content;
    max-height: 600px;
    overflow-y: auto;
}

.controls-header {
    text-align: center;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 1rem;
}

.controls-header h4 {
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
}

.controls-header p {
    color: #6c757d;
    margin: 0;
    font-size: 0.9rem;
}

/* Controls Grid */
.controls-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.control-group {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
}

.control-group h5 {
    color: #3498db;
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.control-row:last-child {
    margin-bottom: 0;
}

.control-row label {
    min-width: 80px;
    font-weight: 500;
    color: #495057;
    font-size: 0.9rem;
}

/* Adjustment Sliders */
.adjustment-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e9ecef;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.adjustment-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.adjustment-slider::-webkit-slider-thumb:hover {
    background: #2980b9;
    transform: scale(1.1);
}

.adjustment-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.value-display {
    min-width: 60px;
    font-weight: 600;
    color: #2c3e50;
    text-align: right;
    font-size: 0.9rem;
}

/* Reset and Center Buttons */
.reset-btn, .center-btn {
    flex: 1;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 0.25rem;
}

.reset-btn {
    background: #e74c3c;
    color: white;
}

.reset-btn:hover {
    background: #c0392b;
}

.center-btn {
    background: #f39c12;
    color: white;
}

.center-btn:hover {
    background: #e67e22;
}

/* Element-specific Controls */
.text-only, .artwork-only {
    display: none;
}

.element-item.active.text ~ .controls-panel .text-only {
    display: block;
}

.element-item.active.artwork ~ .controls-panel .artwork-only {
    display: block;
}

/* Adjustment Preview */
.adjustment-preview {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    min-height: 400px;
}

.adjustment-preview h4 {
    color: #2c3e50;
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 1rem;
}

.preview-container {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.adjustment-canvas {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 5/3;
    background: #fff;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.preview-help {
    margin-top: 1rem;
    text-align: center;
}

.preview-help p {
    color: #6c757d;
    margin: 0;
    font-size: 0.9rem;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .adjustments-container {
        grid-template-columns: 280px 1fr;
        gap: 1rem;
    }
}

@media (max-width: 992px) {
    .adjustments-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .adjustments-panel,
    .controls-panel {
        max-height: none;
    }
}

@media (max-width: 768px) {
    .adjustments-container {
        padding: 0.5rem;
    }
    
    .adjustments-panel,
    .controls-panel,
    .adjustment-preview {
        padding: 1rem;
    }
    
    .control-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .control-row label {
        min-width: auto;
        text-align: center;
    }
    
    .value-display {
        text-align: center;
    }
}

/* Loading and Empty States */
.adjustments-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #6c757d;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility */
.adjustment-slider:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.reset-btn:focus,
.center-btn:focus,
.back-btn:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.element-item:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Animation for element selection */
.element-item {
    transform: translateX(0);
}

.element-item.active {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(-10px);
        opacity: 0.8;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Preview element styling */
.preview-element {
    position: absolute;
    transition: all 0.3s ease;
    cursor: pointer;
}

.preview-element.selected {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.preview-element.text-element {
    background: rgba(231, 76, 60, 0.1);
    border: 1px dashed #e74c3c;
}

.preview-element.artwork-element {
    background: rgba(155, 89, 182, 0.1);
    border: 1px dashed #9b59b6;
}
