/**
 * Customization Workflow System CSS
 * Phase 6 of Frontend Enhancement Plan
 */

/* ========================================================================
   ENHANCEMENT HEADER
   ======================================================================== */

.sc-customization-enhancement-header {
    background: var(--sc-color-surface);
    padding: var(--sc-spacing_lg);
    border-radius: var(--sc-border_radius_lg);
    margin-bottom: var(--sc-spacing_lg);
    border: 1px solid var(--sc-color-border);
}

.sc-customization-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--sc-spacing_lg);
    flex-wrap: wrap;
    gap: var(--sc-spacing_md);
}

.sc-workflow-modes {
    display: flex;
    border: 1px solid var(--sc-color-border);
    border-radius: var(--sc-border_radius_md);
    overflow: hidden;
}

.sc-workflow-mode-btn {
    padding: var(--sc-spacing_sm) var(--sc-spacing_md);
    background: var(--sc-color-background);
    border: none;
    cursor: pointer;
    transition: all var(--sc-transition-fast);
    font-size: 0.875rem;
}

.sc-workflow-mode-btn:not(:last-child) {
    border-right: 1px solid var(--sc-color-border);
}

.sc-workflow-mode-btn:hover {
    background: var(--sc-color-surface);
}

.sc-workflow-mode-btn.active {
    background: var(--sc-color-primary);
    color: white;
}

.sc-workflow-tools {
    display: flex;
    gap: var(--sc-spacing_sm);
    flex-wrap: wrap;
}

/* Progress Section */
.sc-customization-progress {
    display: flex;
    flex-direction: column;
    gap: var(--sc-spacing_sm);
}

.sc-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sc-progress-label {
    font-weight: var(--sc-font_weight_bold);
    color: var(--sc-color-text);
}

.sc-progress-stats {
    font-size: 0.875rem;
    color: var(--sc-color-text-light);
}

.sc-progress-track {
    height: 8px;
    background: var(--sc-color-border);
    border-radius: 4px;
    overflow: hidden;
}

.sc-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--sc-color-primary), var(--sc-color-success));
    transition: width var(--sc-transition-normal);
}

.sc-autosave-indicator {
    display: flex;
    align-items: center;
    gap: var(--sc-spacing_xs);
    font-size: 0.75rem;
    color: var(--sc-color-text-light);
    justify-content: center;
}

/* ========================================================================
   WIZARD INTERFACE
   ======================================================================== */

.sc-customization-wizard {
    background: var(--sc-color-background);
    border-radius: var(--sc-border_radius_lg);
    border: 1px solid var(--sc-color-border);
    overflow: hidden;
}

.sc-wizard-header {
    background: var(--sc-color-surface);
    padding: var(--sc-spacing_lg);
    border-bottom: 1px solid var(--sc-color-border);
}

.sc-steps-container {
    display: flex;
    justify-content: center;
    gap: var(--sc-spacing_md);
    margin-bottom: var(--sc-spacing_lg);
    flex-wrap: wrap;
}

.sc-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: var(--sc-spacing_sm);
    border-radius: var(--sc-border_radius_md);
    transition: all var(--sc-transition-fast);
    min-width: 120px;
}

.sc-step-item:hover {
    background: var(--sc-color-surface);
}

.sc-step-item.active {
    background: var(--sc-color-primary-light);
}

.sc-step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--sc-color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--sc-font_weight_bold);
    color: var(--sc-color-text-light);
    margin-bottom: var(--sc-spacing_xs);
    transition: all var(--sc-transition-fast);
}

.sc-step-item.active .sc-step-number {
    background: var(--sc-color-primary);
    color: white;
}

.sc-step-title {
    font-size: 0.875rem;
    font-weight: var(--sc-font_weight_bold);
    text-align: center;
    margin-bottom: var(--sc-spacing_xs);
}

.sc-step-progress {
    width: 60px;
    height: 4px;
    background: var(--sc-color-surface);
    border-radius: 2px;
    overflow: hidden;
}

.sc-step-progress-fill {
    height: 100%;
    background: var(--sc-color-success);
    transition: width var(--sc-transition-fast);
}

.sc-wizard-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sc-step-indicator {
    font-size: 0.875rem;
    color: var(--sc-color-text);
    font-weight: var(--sc-font_weight_bold);
}

.sc-wizard-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--sc-spacing_xl);
    padding: var(--sc-spacing_xl);
}

@media (max-width: 1024px) {
    .sc-wizard-content {
        grid-template-columns: 1fr;
    }
}

.sc-wizard-step {
    display: none;
    animation: fadeInUp 0.3s ease-out;
}

.sc-wizard-step[style*="block"] {
    display: block;
}

.sc-step-header h3 {
    font-size: 1.5rem;
    margin-bottom: var(--sc-spacing_sm);
    color: var(--sc-color-text);
}

.sc-step-description {
    color: var(--sc-color-text-light);
    margin-bottom: var(--sc-spacing_lg);
}

.sc-step-elements {
    display: flex;
    flex-direction: column;
    gap: var(--sc-spacing_lg);
}

/* Element Containers */
.sc-element-container {
    background: var(--sc-color-surface);
    border: 1px solid var(--sc-color-border);
    border-radius: var(--sc-border_radius_md);
    padding: var(--sc-spacing_lg);
    transition: all var(--sc-transition-fast);
}

.sc-element-container:hover {
    border-color: var(--sc-color-primary-light);
}

.sc-element-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--sc-spacing_md);
}

.sc-element-title-section {
    display: flex;
    align-items: center;
    gap: var(--sc-spacing_sm);
}

.sc-element-title {
    font-size: 1.1rem;
    font-weight: var(--sc-font_weight_bold);
    margin: 0;
    color: var(--sc-color-text);
}

.sc-required-indicator {
    color: var(--sc-color-error);
    font-weight: var(--sc-font_weight_bold);
}

.sc-element-help-btn {
    background: var(--sc-color-primary-light);
    border: 1px solid var(--sc-color-primary);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--sc-color-primary-dark);
    transition: all var(--sc-transition-fast);
}

.sc-element-help-btn:hover {
    background: var(--sc-color-primary);
    color: white;
}

.sc-element-status {
    text-align: right;
}

.sc-element-completion-status {
    font-size: 0.875rem;
    color: var(--sc-color-text-light);
    margin-bottom: var(--sc-spacing_xs);
}

.sc-price-change {
    font-size: 0.875rem;
    font-weight: var(--sc-font_weight_bold);
    color: var(--sc-color-primary);
}

/* ========================================================================
   WIZARD SIDEBAR
   ======================================================================== */

.sc-wizard-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--sc-spacing_xl);
}

.sc-current-selections,
.sc-price-calculator,
.sc-quick-actions {
    background: var(--sc-color-surface);
    border: 1px solid var(--sc-color-border);
    border-radius: var(--sc-border_radius_md);
    padding: var(--sc-spacing_lg);
}

.sc-current-selections h4,
.sc-price-calculator h4,
.sc-quick-actions h4 {
    font-size: 1rem;
    margin: 0 0 var(--sc-spacing_md) 0;
    color: var(--sc-color-text);
    border-bottom: 2px solid var(--sc-color-primary);
    padding-bottom: var(--sc-spacing_xs);
}

.sc-price-items {
    display: flex;
    flex-direction: column;
    gap: var(--sc-spacing_sm);
}

.sc-price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--sc-spacing_sm) 0;
}

.sc-price-item.sc-total-price {
    border-top: 1px solid var(--sc-color-border);
    padding-top: var(--sc-spacing_md);
    margin-top: var(--sc-spacing_sm);
    font-weight: var(--sc-font_weight_bold);
}

.sc-price-label {
    color: var(--sc-color-text);
}

.sc-price-value {
    font-weight: var(--sc-font_weight_bold);
    color: var(--sc-color-primary);
}

.sc-action-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--sc-spacing_sm);
}

.sc-action-buttons .sc-btn {
    justify-content: flex-start;
}

/* ========================================================================
   SUMMARY INTERFACE
   ======================================================================== */

.sc-customization-summary {
    background: var(--sc-color-surface);
    border: 1px solid var(--sc-color-border);
    border-radius: var(--sc-border_radius_md);
    padding: var(--sc-spacing_lg);
    margin-bottom: var(--sc-spacing_lg);
}

.sc-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--sc-spacing_lg);
}

.sc-summary-header h3 {
    margin: 0;
    color: var(--sc-color-text);
}

.sc-summary-actions {
    display: flex;
    gap: var(--sc-spacing_sm);
}

.sc-completion-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--sc-spacing_lg);
    margin-bottom: var(--sc-spacing_xl);
}

.sc-stat-item {
    text-align: center;
    padding: var(--sc-spacing_md);
    background: var(--sc-color-background);
    border-radius: var(--sc-border_radius_md);
    border: 1px solid var(--sc-color-border);
}

.sc-stat-value {
    font-size: 1.5rem;
    font-weight: var(--sc-font_weight_bold);
    color: var(--sc-color-primary);
    margin-bottom: var(--sc-spacing_xs);
}

.sc-stat-label {
    font-size: 0.875rem;
    color: var(--sc-color-text-light);
}

/* ========================================================================
   MODALS (Help, Templates, Preview)
   ======================================================================== */

.sc-help-system-modal,
.sc-templates-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: var(--sc-z-modal);
    padding: var(--sc-spacing_md);
}

.sc-help-modal-content,
.sc-templates-content {
    background: var(--sc-color-background);
    border-radius: var(--sc-border_radius_lg);
    max-width: 900px;
    max-height: 90vh;
    width: 100%;
    position: relative;
    overflow: hidden;
    box-shadow: var(--sc-shadow-xl);
}

.sc-help-close,
.sc-templates-close {
    position: absolute;
    top: var(--sc-spacing_md);
    right: var(--sc-spacing_md);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5em;
    color: var(--sc-color-text);
    transition: all var(--sc-transition-fast);
    z-index: 10;
}

.sc-help-close:hover,
.sc-templates-close:hover {
    background: white;
    transform: scale(1.1);
}

.sc-help-tabs,
.sc-templates-tabs {
    display: flex;
    border-bottom: 1px solid var(--sc-color-border);
    padding: 0 var(--sc-spacing_xl);
}

.sc-help-tab,
.sc-template-tab {
    padding: var(--sc-spacing_md) var(--sc-spacing_lg);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--sc-color-text-light);
    border-bottom: 2px solid transparent;
    transition: all var(--sc-transition-fast);
}

.sc-help-tab:hover,
.sc-template-tab:hover {
    color: var(--sc-color-text);
}

.sc-help-tab.active,
.sc-template-tab.active {
    color: var(--sc-color-primary);
    border-bottom-color: var(--sc-color-primary);
    font-weight: var(--sc-font_weight_bold);
}

.sc-help-content-area,
.sc-templates-body {
    padding: var(--sc-spacing_xl);
    max-height: 60vh;
    overflow-y: auto;
}

.sc-help-panel,
.sc-template-panel {
    display: none;
}

.sc-help-panel.active,
.sc-template-panel.active {
    display: block;
}

/* Preview Panel */
.sc-preview-panel {
    position: fixed;
    top: 50%;
    right: var(--sc-spacing_md);
    transform: translateY(-50%);
    width: 300px;
    background: var(--sc-color-background);
    border: 1px solid var(--sc-color-border);
    border-radius: var(--sc-border_radius_lg);
    box-shadow: var(--sc-shadow-lg);
    z-index: var(--sc-z-dropdown);
    display: none;
}

.sc-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--sc-spacing_md);
    border-bottom: 1px solid var(--sc-color-border);
    background: var(--sc-color-surface);
}

.sc-preview-close {
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    color: var(--sc-color-text-light);
}

.sc-preview-content {
    padding: var(--sc-spacing_md);
}

.sc-suit-preview {
    width: 100%;
    height: 200px;
    background: var(--sc-color-surface);
    border-radius: var(--sc-border_radius_md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--sc-spacing_md);
}

/* ========================================================================
   RESPONSIVE DESIGN
   ======================================================================== */

@media (max-width: 768px) {
    .sc-customization-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .sc-workflow-tools {
        justify-content: center;
    }
    
    .sc-steps-container {
        flex-direction: column;
        align-items: center;
    }
    
    .sc-wizard-navigation {
        flex-direction: column;
        gap: var(--sc-spacing_sm);
    }
    
    .sc-completion-stats {
        grid-template-columns: 1fr;
    }
    
    .sc-preview-panel {
        position: relative;
        top: auto;
        right: auto;
        transform: none;
        width: 100%;
        margin-bottom: var(--sc-spacing_lg);
    }
}

@media (max-width: 480px) {
    .sc-customization-enhancement-header {
        padding: var(--sc-spacing_md);
    }
    
    .sc-wizard-content {
        padding: var(--sc-spacing_md);
    }
    
    .sc-element-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--sc-spacing_sm);
    }
    
    .sc-help-modal-content,
    .sc-templates-content {
        margin: var(--sc-spacing_sm);
        max-height: 95vh;
    }
}

/* ========================================================================
   ANIMATIONS
   ======================================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .sc-wizard-step,
    .sc-step-item,
    .sc-element-container {
        animation: none !important;
        transition: none !important;
    }
}
