/* =============================================
   ZOHE Settings — Page Paramètres
   ============================================= */

.zohe-settings {
    max-width: 600px;
    margin: 0 auto;
    padding: 10px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

/* --- Sections --- */

.zohe-settings-section {
    background: #fff;
    border-radius: 14px;
    padding: 28px 30px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.zohe-settings-section-header {
    margin-bottom: 22px;
}

.zohe-settings-title {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #1a1a1a !important;
    margin: 0 0 6px 0 !important;
    padding: 0 !important;
}

.zohe-settings-desc {
    font-size: 13.5px;
    color: #888;
    margin: 0;
    line-height: 1.5;
}

/* --- Pastilles de couleur --- */

.zohe-settings-colors {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.zohe-color-swatch {
    position: relative;
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    min-height: 56px !important;
    max-width: 56px !important;
    max-height: 56px !important;
    border-radius: 50% !important;
    border: 3px solid transparent !important;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 !important;
    margin: 0 !important;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    color: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: 1 !important;
    white-space: normal !important;
    text-align: center !important;
    box-sizing: border-box !important;
    background-image: none !important;
}

.zohe-color-swatch:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.zohe-color-swatch.active {
    border-color: #1a1a1a !important;
    transform: scale(1.1);
}

.zohe-color-check {
    width: 22px;
    height: 22px;
    opacity: 0;
    transition: opacity 0.2s ease;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.zohe-color-swatch.active .zohe-color-check {
    opacity: 1;
}

.zohe-color-label {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: #999;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.zohe-color-swatch:hover .zohe-color-label,
.zohe-color-swatch.active .zohe-color-label {
    opacity: 1;
}

/* --- Toggle Switch --- */

.zohe-settings-toggle-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.zohe-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}

.zohe-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.zohe-toggle-slider {
    position: absolute;
    inset: 0;
    background-color: #ddd;
    border-radius: 28px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.zohe-toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.zohe-toggle input:checked + .zohe-toggle-slider {
    background-color: var(--icon-color, #8A8A8A);
}

.zohe-toggle input:checked + .zohe-toggle-slider::before {
    transform: translateX(22px);
}

.zohe-toggle-label {
    font-size: 14px;
    color: #666;
    user-select: none;
}

/* --- Indicateur de sauvegarde automatique --- */

.zohe-settings-status {
    text-align: center;
    padding-top: 6px;
    min-height: 28px;
    font-size: 13px;
    color: #999;
    transition: opacity 0.3s ease;
}

.zohe-settings-status.zohe-status-saving::after {
    content: 'Enregistrement…';
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #999;
    animation: zohe-pulse 1s ease-in-out infinite;
}

.zohe-settings-status.zohe-status-saved::after {
    content: '✓ Enregistré';
    color: #6abf6a;
}

.zohe-settings-status.zohe-status-error::after {
    content: 'Erreur, veuillez réessayer';
    color: #e06060;
}

/* --- Bouton principal --- */

.zohe-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 18px;
    border: none;
    border-radius: 12px;
    background: var(--icon-color, #8A8A8A);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1;
    cursor: pointer;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        background-color 0.18s ease,
        opacity 0.18s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    appearance: none;
    -webkit-appearance: none;
    text-decoration: none;
    white-space: nowrap;
}

.zohe-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
    opacity: 0.96;
}

.zohe-button:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

.zohe-button:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 4px rgba(138, 138, 138, 0.18),
        0 4px 12px rgba(0, 0, 0, 0.12);
}

.zohe-button:disabled,
.zohe-button[disabled] {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
    box-shadow: none;
}

@keyframes zohe-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* --- Responsive --- */

@media (max-width: 600px) {
    .zohe-settings {
        padding: 10px 4px;
    }

    .zohe-settings-section {
        padding: 22px 20px;
        border-radius: 12px;
    }

    .zohe-settings-colors {
        gap: 12px;
        justify-content: center;
    }

    .zohe-color-swatch {
        width: 48px;
        height: 48px;
    }
}
