/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
                'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #f5f5f5;
    color: #262626;
    font-size: 14px;
    line-height: 1.5715;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

header {
    margin-bottom: 24px;
}

header h1 {
    color: #722ed1;
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-logo {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.main-content {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.left-panel {
    flex: 1;
    background: white;
    border-radius: 6px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #d9d9d9;
}

.right-panel {
    flex: 1;
    background: white;
    border-radius: 6px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #d9d9d9;
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: 400px;
}

.section {

}


.section h3 {
    font-size: 16px;
    font-weight: 600;
    color: #262626;
    margin-bottom: 16px;
}

/* Zone de saisie texte */
/* Options de type de contenu */
.content-type-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.content-type-options {
    display: flex;
    gap: 24px;
}

.reset-btn {
    background: none;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    color: #8c8c8c;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.reset-btn:hover {
    border-color: #ff4d4f;
    color: #ff4d4f;
    background: #fff1f0;
}

.reset-btn:active {
    background: #ffccc7;
}

#content {
    width: 100%;
    min-height: 120px;
    max-height: 400px;
    padding: 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    line-height: 1.4;
    resize: none;
    overflow-y: auto;
    transition: all 0.3s;
}

#content:focus {
    border-color: #722ed1;
    box-shadow: 0 0 0 2px rgba(114, 46, 209, 0.2);
    outline: none;
}

/* Options de radio */
.option-group {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.radio-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
}

.radio-option input[type="radio"] {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    cursor: pointer;
    accent-color: #722ed1;
}

.radio-label {
    color: #262626;
    font-weight: 500;
}

.input-with-unit {
    display: flex;
    align-items: center;
    gap: 4px;
}

.input-with-unit input {
    width: 80px;
    padding: 4px 8px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
    transition: all 0.3s;
}

.input-with-unit input:focus {
    border-color: #722ed1;
    box-shadow: 0 0 0 2px rgba(114, 46, 209, 0.2);
    outline: none;
}

.input-with-unit input:disabled {
    background-color: #f5f5f5;
    color: #8c8c8c;
    cursor: not-allowed;
}

.unit {
    color: #8c8c8c;
    font-size: 14px;
    font-weight: 500;
}

.quartile-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.quartile-label {
    color: #8c8c8c;
}

.quartile-value {
    color: #262626;
    font-weight: 500;
}

/* Boutons de téléchargement */
.download-actions {
    display: flex;
    gap: 12px;
}

.download-btn {
    flex: 1;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.download-btn--primary {
    background: #722ed1;
    color: white;
}

.download-btn--primary:hover {
    background: #5a1f99;
    box-shadow: 0 4px 12px rgba(114, 46, 209, 0.3);
}

.download-btn--primary:active {
    background: #3d1580;
}

.download-btn--secondary {
    background: white;
    color: #722ed1;
    border: 1px solid #722ed1;
}

.download-btn--secondary:hover {
    background: #f9f0ff;
}

.download-btn--secondary:active {
    background: #efdbff;
}

/* Zone de prévisualisation */
.preview-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    flex: 1;
    justify-content: center;
    min-height: 200px;
}

.qr-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    width: 100%;
    background: #fafafa;
    border: 2px dashed #d9d9d9;
    padding: 20px;
    transition: all 0.3s;
}

.qr-preview.has-qr {
    background: white;
    border: 1px solid #d9d9d9;
}



/* Avertissement de taille */
.size-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fff2e8;
    border: 1px solid #ffbb96;
    border-radius: 4px;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}

.warning-text {
    color: #ad4e00;
    font-size: 13px;
}

.warning-text span {
    font-weight: 600;
}

.warning-label {
    color: #ff7a45;
    font-size: 12px;
    font-weight: 500;
    text-transform: lowercase;
}

/* Slider de redondance */
.redundancy-slider {
    margin-top: 12px;
    width: 100%;
}

#redundancy-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #d9d9d9;
    outline: none;
    transition: all 0.3s;
    cursor: pointer;
    -webkit-appearance: none;
}

#redundancy-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #722ed1;
    cursor: pointer;
    transition: all 0.3s;
}

#redundancy-slider::-webkit-slider-thumb:hover {
    background: #5a1f99;
    transform: scale(1.1);
}

#redundancy-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #722ed1;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}

#redundancy-slider::-moz-range-thumb:hover {
    background: #5a1f99;
    transform: scale(1.1);
}

#redundancy-slider:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#redundancy-slider:disabled::-webkit-slider-thumb {
    cursor: not-allowed;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 11px;
    color: #8c8c8c;
    padding: 0 2px;
}

/* Contrôles simplifiés */
.control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 0 0 6px 6px;
}

.control-row:first-child {
    border-radius: 6px 6px 0 0;
    border-bottom: none;
}

.control-row:last-child {
    border-radius: 0 0 6px 6px;
    border-top: none;
}

.control-label {
    font-size: 14px;
    font-weight: 500;
    color: #262626;
    white-space: nowrap;
}

.control-input {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Le slider prend tout l'espace disponible */
.control-input input[type="range"] {
    flex: 1;
    min-width: 0;
}

/* Le bloc slider+valeur s'étend pour remplir la ligne */
.control-row:first-child .control-input {
    flex: 1;
    min-width: 0;
}

#pixel-size-input {
    padding: 3px;
    width: 52px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
    transition: border-color 0.2s;
}

#pixel-size-input:focus {
    border-color: #722ed1;
    box-shadow: 0 0 0 2px rgba(114, 46, 209, 0.2);
    outline: none;
}

.control-value {
    font-size: 14px;
    font-weight: 600;
    color: #722ed1;
    min-width: 50px;
}

.error-level {
    font-size: 12px;
    font-weight: 500;
    color: #8c8c8c;
    margin-left: 4px;
}

/* Affichage des résultats */
.result-display {
    background: #fff;
    border: 2px solid #722ed1;
    border-radius: 8px;
    padding: 16px;
    margin-top: 12px;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.result-row:last-child {
    margin-bottom: 0;
}

.result-label {
    font-size: 14px;
    color: #666;
}

.result-value {
    font-size: 14px;
    font-weight: 600;
    color: #722ed1;
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .container {
        padding: 16px;
    }
    
    .left-panel,
    .right-panel {
        padding: 16px;
        width: 100%;
        flex: none;
    }
    
    .radio-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .format-options {
        flex-direction: column;
        gap: 12px;
    }
}

/* États spéciaux */
.radio-option input[type="radio"]:checked + .radio-label {
    color: #722ed1;
    font-weight: 600;
}

/* Animation de loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #722ed1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Placeholder pour QR code */
.qr-placeholder {
    color: #8c8c8c;
    font-size: 14px;
    text-align: center;
    padding: 40px 20px;
}

/* Messages d'erreur */
.error-message {
    color: #ff4d4f;
    font-size: 12px;
    margin-top: 4px;
}

/* Style pour les options désactivées */
.radio-option input[type="radio"]:disabled + .radio-label {
    color: #bfbfbf;
    cursor: not-allowed;
}

.radio-option input[type="radio"]:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}