/**
 * SUREMESURE Configurateur - Styles CSS
 */

/* Variables */
:root {
    --primary-color: #2C3E50;
    --secondary-color: #3498DB;
    --success-color: #2ECC71;
    --border-radius: 8px;
    --box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Container principal */
.suremesure-wrap {
    max-width: 1400px;
    margin: 40px auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Barre de progression */
.suremesure-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    background: white;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.progress-step {
    flex: 1;
    text-align: center;
    position: relative;
    padding: 10px;
    cursor: default;
}

.progress-step::after {
    content: '';
    position: absolute;
    top: 25px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #e0e0e0;
    z-index: 0;
}

.progress-step:last-child::after {
    display: none;
}

.step-number {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #999;
    font-weight: bold;
    position: relative;
    z-index: 1;
    margin-bottom: 8px;
}

.progress-step.active .step-number {
    background: var(--secondary-color);
    color: white;
}

.progress-step.completed .step-number {
    background: var(--success-color);
    color: white;
}

.progress-step.completed .step-number::before {
    content: '✓';
}

.step-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.progress-step.active .step-label {
    color: var(--secondary-color);
    font-weight: 600;
}

/* Contenu principal */
.suremesure-content {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

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

    .suremesure-preview {
        order: -1;
    }
}

/* Panneau latéral */
.suremesure-sidebar {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    min-height: 600px;
}

.suremesure-sidebar h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--primary-color);
    font-size: 20px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.suremesure-sidebar h4 {
    margin-top: 25px;
    margin-bottom: 12px;
    color: #555;
    font-size: 16px;
}

/* Types de sacs */
.bag-types {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.bag-type-card {
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bag-type-card:hover {
    border-color: var(--secondary-color);
    background: #f8f9fa;
    transform: translateY(-2px);
}

.bag-type-card.selected {
    border-color: var(--secondary-color);
    background: #e3f2fd;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

.bag-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.bag-name {
    font-weight: 600;
    color: #333;
}

/* Select personnalisé */
.suremesure-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.suremesure-select:focus {
    outline: none;
    border-color: var(--secondary-color);
}

/* Contrôles de dimensions */
.dimension-control {
    margin-bottom: 25px;
}

.dimension-control label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.dimension-control input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
}

.dimension-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--secondary-color);
    cursor: pointer;
}

.dimension-control input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--secondary-color);
    cursor: pointer;
    border: none;
}

.dimension-control output {
    display: block;
    margin-top: 8px;
    font-size: 14px;
    color: var(--secondary-color);
    font-weight: 600;
}

.volume-display {
    margin-top: 20px;
    padding: 15px;
    background: #f0f8ff;
    border-radius: var(--border-radius);
    text-align: center;
}

.volume-display span {
    color: var(--secondary-color);
    font-size: 24px;
    font-weight: bold;
}

/* Matières */
.materials {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.material-card {
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.material-card:hover {
    border-color: var(--secondary-color);
    transform: translateY(-2px);
}

.material-card.selected {
    border-color: var(--secondary-color);
    background: #e3f2fd;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

.material-swatch {
    width: 100%;
    height: 60px;
    border-radius: 4px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
}

.material-name {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.material-eco {
    font-size: 11px;
    color: #2ECC71;
}

/* Sélecteur de couleurs */
.color-picker {
    margin-top: 15px;
}

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

.color-swatch {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 4px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s ease;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.selected {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--secondary-color);
}

#custom-color {
    width: 100%;
    height: 40px;
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    cursor: pointer;
}

/* Accessoires */
.accessories-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.accessories-group label {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.accessories-group label:hover {
    background: #f8f9fa;
    border-color: var(--secondary-color);
}

.accessories-group input {
    margin-right: 10px;
    cursor: pointer;
}

.accessories-group input:checked + label,
.accessories-group label:has(input:checked) {
    background: #e3f2fd;
    border-color: var(--secondary-color);
    font-weight: 600;
}

/* Logo upload */
.logo-upload {
    margin-bottom: 20px;
}

.logo-upload label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.logo-upload input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed #e0e0e0;
    border-radius: var(--border-radius);
    cursor: pointer;
}

.logo-upload .description {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

/* Techniques d'impression */
.printing-techniques {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.printing-techniques label {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.printing-techniques label:hover {
    background: #f8f9fa;
    border-color: var(--secondary-color);
}

.printing-techniques input {
    margin-right: 10px;
}

/* Formulaire de devis */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.form-group .description {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

/* Zone de prévisualisation */
.suremesure-preview {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.preview-header h3 {
    margin: 0;
    color: var(--primary-color);
}

.preview-actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

#bag-canvas {
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius);
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
}

.preview-info {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: var(--border-radius);
}

.specs-list {
    line-height: 1.8;
}

.specs-list div {
    margin-bottom: 8px;
}

.specs-list strong {
    color: var(--primary-color);
    min-width: 100px;
    display: inline-block;
}

/* Navigation */
.suremesure-nav {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 20px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.suremesure-btn,
.suremesure-btn-primary {
    padding: 14px 30px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    max-width: 300px;
}

.suremesure-btn {
    background: white;
    color: var(--primary-color);
    border: 2px solid #e0e0e0;
}

.suremesure-btn:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: var(--primary-color);
}

.suremesure-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.suremesure-btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .suremesure-wrap {
        padding: 10px;
    }

    .suremesure-progress {
        overflow-x: auto;
        padding: 15px 10px;
    }

    .progress-step {
        min-width: 100px;
    }

    .step-label {
        font-size: 10px;
    }

    .suremesure-content {
        gap: 20px;
    }

    .suremesure-sidebar {
        padding: 20px;
    }

    .bag-types {
        grid-template-columns: 1fr;
    }

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

    .preset-colors {
        grid-template-columns: repeat(4, 1fr);
    }

    .suremesure-nav {
        flex-direction: column;
    }

    .suremesure-btn,
    .suremesure-btn-primary {
        max-width: 100%;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.config-step {
    animation: fadeIn 0.3s ease;
}
