/* ==============================================
   PARAMÈTRES GÉNÉRAUX - STYLES SPÉCIFIQUES
   ============================================== */

/* --- Barre de progression - Une seule ligne sur tous les écrans --- */
.config-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 0;
    padding: 0.75rem 1rem;
    background: var(--clr-bg-secondary);
    border-radius: 40px;
    box-shadow: var(--clr-shadow);
    border: 1px solid var(--clr-border);
    gap: 0.25rem;
    width: 100%;
    overflow: visible;
}

.progress-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--clr-text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    flex: 1;
    white-space: nowrap;
}

.progress-item .progress-step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--clr-bg-primary);
    border: 2px solid var(--clr-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

/* Étape complétée */
.progress-item.completed {
    color: var(--clr-green);
}

.progress-item.completed .progress-step {
    background: var(--clr-green);
    border-color: var(--clr-green);
    color: white;
    position: relative;
}

.progress-item.completed .progress-step span {
    display: none;
}

.progress-item.completed .progress-step::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.9rem;
}

/* Étape active */
.progress-item.active {
    color: var(--clr-blue);
    font-weight: 600;
}

.progress-item.active .progress-step {
    background: var(--clr-blue);
    border-color: var(--clr-blue);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

/* Supprimer la ligne de progression entre les étapes */
.config-progress::before {
    display: none;
}

/* --- Onglets de navigation - Une seule ligne sur tous les écrans --- */
.param-tabs {
    display: flex;
    gap: 0.5rem;
    margin: 1.5rem 0;
    border-bottom: 1px solid var(--clr-border);
    padding-bottom: 0.5rem;
    flex-wrap: nowrap;
    width: 100%;
    overflow: visible;
}

.param-tab {
    padding: 0.6rem 1rem;
    border-radius: 30px;
    background: transparent;
    color: var(--clr-text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex: 1;
    white-space: nowrap;
    text-align: center;
}

.param-tab i {
    font-size: 1rem;
}

.param-tab:hover {
    background: var(--clr-bg-primary);
    color: var(--clr-text-primary);
}

.param-tab.active {
    background: var(--clr-blue);
    color: white;
}

.param-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.param-tab-content.active {
    display: block;
}

/* --- Sections de configuration --- */
.config-section {
    background: var(--clr-bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--clr-shadow);
    border: 1px solid var(--clr-border);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--clr-border);
}

.section-header h3 {
    font-size: 1.1rem;
    color: var(--clr-blue);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-header h3 i {
    font-size: 1.2rem;
}

/* --- Grilles de formulaire --- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.2rem;
}

.form-grid .full-width {
    grid-column: 1 / -1;
}

.form-group {
    margin-bottom: 0.8rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--clr-text-secondary);
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--clr-border);
    border-radius: 6px;
    background: var(--clr-bg-primary);
    color: var(--clr-text-primary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--clr-blue);
    outline: none;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.1);
}

.form-control[multiple] {
    height: auto;
    min-height: 100px;
}

.form-hint {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.7rem;
    color: var(--clr-text-secondary);
}

/* --- Upload de fichiers --- */
.file-upload-area {
    border: 2px dashed var(--clr-border);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--clr-bg-primary);
}

.file-upload-area:hover {
    border-color: var(--clr-blue);
    background: rgba(2, 132, 199, 0.05);
}

.file-upload-area i {
    font-size: 2.5rem;
    color: var(--clr-blue);
    margin-bottom: 0.5rem;
}

.file-upload-area p {
    margin-bottom: 0.3rem;
    font-weight: 500;
}

.file-upload-area small {
    color: var(--clr-text-secondary);
}

.logo-preview,
.signature-preview {
    position: relative;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: var(--clr-bg-primary);
    border-radius: 6px;
    display: inline-block;
}

.logo-preview img,
.signature-preview img {
    max-width: 200px;
    max-height: 60px;
    object-fit: contain;
}

.logo-preview .btn-icon,
.signature-preview .btn-icon {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--clr-red);
    color: white;
    border: none;
}

.logo-preview .btn-icon:hover,
.signature-preview .btn-icon:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* --- Tableaux de configuration --- */
.config-table {
    width: 100%;
    border-collapse: collapse;
}

.config-table th {
    text-align: left;
    padding: 0.8rem;
    background: var(--clr-bg-primary);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--clr-text-secondary);
    border-bottom: 2px solid var(--clr-border);
}

.config-table td {
    padding: 0.8rem;
    border-bottom: 1px solid var(--clr-border);
    vertical-align: middle;
}

.config-table tbody tr:hover {
    background: var(--clr-bg-primary);
}

/* --- Switch toggles --- */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--clr-border);
    transition: .3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--clr-green);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* --- Grille de paramètres --- */
.param-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.2rem;
}

.param-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.param-item.full-width {
    grid-column: 1 / -1;
}

.param-item label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--clr-text-secondary);
}

.param-item .switch {
    align-self: flex-start;
}

/* --- Sélecteur de thème --- */
.theme-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.theme-option {
    cursor: pointer;
    text-align: center;
}

.theme-preview {
    height: 100px;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.theme-option:hover .theme-preview {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.theme-option.selected .theme-preview {
    border-color: var(--clr-blue);
    box-shadow: 0 0 0 2px var(--clr-blue);
}

/* Thème clair */
.light-theme .preview-header {
    height: 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.light-theme .preview-content {
    flex: 1;
    background: #ffffff;
}

/* Thème sombre */
.dark-theme .preview-header {
    height: 20px;
    background: #0f172a;
    border-bottom: 1px solid #334155;
}

.dark-theme .preview-content {
    flex: 1;
    background: #1e293b;
}

/* Thème contraste */
.contrast-theme .preview-header {
    height: 20px;
    background: #000000;
    border-bottom: 2px solid #ffffff;
}

.contrast-theme .preview-content {
    flex: 1;
    background: #000000;
}

/* Thème système */
.system-theme .preview-header {
    height: 20px;
    background: linear-gradient(90deg, #f8fafc 50%, #0f172a 50%);
    border-bottom: 1px solid #e2e8f0;
}

.system-theme .preview-content {
    flex: 1;
    background: linear-gradient(135deg, #ffffff 50%, #1e293b 50%);
}

.theme-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0.3rem;
}

.theme-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.radio-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--clr-border);
    display: inline-block;
}

.radio-dot.active {
    border-color: var(--clr-blue);
    background: var(--clr-blue);
}

/* --- Actions de formulaire --- */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--clr-border);
}

/* --- Badges et status --- */
.badge-blue {
    background: rgba(2, 132, 199, 0.1);
    color: var(--clr-blue);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--clr-green);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-yellow {
    background: rgba(245, 158, 11, 0.1);
    color: var(--clr-yellow);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-purple {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* --- Import preview --- */
.import-preview {
    background: var(--clr-bg-primary);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    border: 1px solid var(--clr-border);
}

.import-preview h5 {
    margin-bottom: 0.5rem;
    color: var(--clr-blue);
}

.import-preview pre {
    background: var(--clr-bg-secondary);
    padding: 0.8rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.8rem;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* --- Boutons --- */
.btn-small {
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--clr-bg-primary);
    color: var(--clr-text-secondary);
    transition: all 0.3s ease;
    border: 1px solid var(--clr-border);
    cursor: pointer;
}

.btn-icon:hover {
    background: var(--clr-blue);
    color: white;
    border-color: var(--clr-blue);
}

.btn-primary {
    background: var(--clr-blue);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: #0369a1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.btn-secondary {
    background: var(--clr-bg-primary);
    color: var(--clr-text-primary);
    border: 1px solid var(--clr-border);
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: var(--clr-bg-secondary);
    border-color: var(--clr-blue);
}

/* --- Animations --- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- RESPONSIVE - TOUT SUR UNE LIGNE --- */
@media (max-width: 768px) {
    /* Barre de progression */
    .config-progress {
        padding: 0.5rem;
        gap: 0.15rem;
    }
    
    .progress-item {
        gap: 0.2rem;
        font-size: 0.65rem;
    }
    
    .progress-item .progress-step {
        width: 24px;
        height: 24px;
        font-size: 0.65rem;
    }
    
    .progress-item.completed .progress-step::after {
        font-size: 0.7rem;
    }
    
    /* Onglets */
    .param-tabs {
        gap: 0.25rem;
    }
    
    .param-tab {
        padding: 0.4rem 0.2rem;
        font-size: 0.65rem;
        gap: 0.2rem;
    }
    
    .param-tab i {
        font-size: 0.65rem;
    }
    
    /* Grilles */
    .form-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .param-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .config-section {
        padding: 1rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .section-header h3 {
        font-size: 1rem;
    }
    
    /* Tableaux */
    .config-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        font-size: 0.75rem;
    }
    
    .config-table th,
    .config-table td {
        padding: 0.5rem;
    }
    
    /* Sélecteur de thème */
    .theme-selector {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .theme-preview {
        height: 70px;
    }
    
    /* Actions */
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
    }
    
    /* Switchs */
    .param-item {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    .param-item label {
        margin-bottom: 0;
        flex: 1;
    }
    
    .param-item .switch {
        margin-left: 0.5rem;
    }
}

@media (max-width: 480px) {
    /* Barre de progression - ultra compact */
    .config-progress {
        padding: 0.4rem;
    }
    
    .progress-item {
        font-size: 0.55rem;
    }
    
    .progress-item .progress-step {
        width: 20px;
        height: 20px;
        font-size: 0.55rem;
    }
    
    /* Onglets - ultra compact */
    .param-tab {
        padding: 0.3rem 0.1rem;
        font-size: 0.55rem;
    }
    
    .param-tab i {
        font-size: 0.55rem;
    }
    
    /* Sélecteur de thème - une colonne */
    .theme-selector {
        grid-template-columns: 1fr;
    }
    
    .badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }
    
    .btn-icon {
        width: 28px;
        height: 28px;
    }
}

/* --- Version desktop (plus aérée) --- */
@media (min-width: 769px) {
    .progress-item {
        font-size: 0.85rem;
        gap: 0.5rem;
    }
    
    .progress-item .progress-step {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
    
    .param-tab {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

@media (min-width: 1024px) {
    .progress-item {
        font-size: 0.9rem;
    }
    
    .progress-item .progress-step {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    .param-tab {
        padding: 0.7rem 1.5rem;
        font-size: 0.95rem;
    }
}