/**
 * Settings Page - Design moderne avec système d'onglets
 * Style : Glassmorphism, gradients bleus, transitions fluides
 */

/* =================================================================
   CONTAINER PRINCIPAL
   ================================================================= */
.settings-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-2xl) var(--spacing-xl);
    min-height: calc(100vh - 120px);
}

/* =================================================================
   HEADER
   ================================================================= */
.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-2xl);
}

.settings-title {
    font-size: 2rem;
    font-weight: var(--font-weight-bold);
    color: var(--color-black);
    margin-bottom: var(--spacing-sm);
    font-family: var(--font-secondary);
}

.settings-subtitle {
    font-size: var(--font-size-lg);
    color: var(--color-gray-dark);
    font-weight: var(--font-weight-normal);
}

/* =================================================================
   NAVIGATION PAR ONGLETS - Style minimaliste
   ================================================================= */
.settings-tabs {
    display: flex;
    gap: var(--spacing-2xl);
    margin-bottom: var(--spacing-2xl);
    border-bottom: 2px solid rgba(12, 129, 228, 0.1);
    overflow-x: auto;
    scrollbar-width: none;
}

.settings-tabs::-webkit-scrollbar {
    display: none;
}

.settings-tab {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 0 0 var(--spacing-md) 0;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--color-gray-dark);
    font-family: var(--font-secondary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition:
        color 300ms cubic-bezier(0.4, 0, 0.2, 1),
        border-color 300ms cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    white-space: nowrap;
    margin-bottom: -2px;
}

.settings-tab:hover {
    color: var(--color-primary);
}

.settings-tab.active {
    color: var(--color-primary);
    font-weight: var(--font-weight-semibold);
    border-bottom-color: var(--color-primary);
}

.settings-tab__icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-tab__icon svg {
    width: 100%;
    height: 100%;
    /* Forcer les icônes en noir et blanc dans les paramètres */
    filter: grayscale(1);
    opacity: 0.7;
    transition: opacity 300ms ease, filter 300ms ease;
}

.settings-tab.active .settings-tab__icon svg,
.settings-tab:hover .settings-tab__icon svg {
    filter: grayscale(0);
    opacity: 1;
}

.settings-tab__icon svg .svg-primary {
    color: currentColor;
}

.settings-tab__icon svg .svg-secondary {
    color: currentColor;
    opacity: 0.4;
}

.settings-tab:hover .settings-tab__icon {
    transform: scale(1.1);
}

.settings-tab.active .settings-tab__icon svg .svg-secondary {
    opacity: 0.6;
}

/* Onglet désactivé */
.settings-tab--disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.settings-tab--disabled .settings-tab__icon svg {
    filter: grayscale(100%) opacity(0.6);
}

.settings-tab--disabled:hover {
    color: var(--color-gray-dark);
    transform: none;
}

.settings-tab--disabled:hover .settings-tab__icon {
    transform: none;
}

/* Badge "À venir" pour les onglets */
.settings-tab__badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.1) 0%, rgba(168, 85, 247, 0.08) 100%);
    color: rgb(147, 51, 234);
    border-radius: var(--border-radius-full);
    border: 1px solid rgba(147, 51, 234, 0.2);
    margin-left: var(--spacing-xs);
}

.settings-tab__text {
    display: flex;
    align-items: center;
}

/* =================================================================
   CONTENU DES ONGLETS
   ================================================================= */
.settings-content {
    position: relative;
    min-height: 500px;
}

.settings-panel {
    display: none;
    animation: fadeInPanel 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-panel.active {
    display: block;
}

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

/* =================================================================
   CARDS
   ================================================================= */
.settings-card {
    background: var(--color-white);
    border-radius: var(--border-radius-xl);
    border: 1px solid rgba(12, 129, 228, 0.15);
    overflow: hidden;
}

.settings-card__header {
    padding: var(--spacing-2xl) var(--spacing-2xl) var(--spacing-lg);
    border-bottom: 2px solid rgba(12, 129, 228, 0.1);
    background: linear-gradient(135deg,
        rgba(240, 249, 255, 0.5) 0%,
        rgba(224, 242, 254, 0.3) 100%
    );
}

.settings-card__title {
    font-size: 1.5rem;
    font-weight: var(--font-weight-semibold);
    color: var(--color-black);
    margin-bottom: var(--spacing-sm);
    font-family: var(--font-secondary);
}

.settings-card__description {
    font-size: var(--font-size-base);
    color: var(--color-gray-dark);
    line-height: 1.6;
}

.settings-card__body {
    padding: var(--spacing-2xl);
}


/* =================================================================
   BADGES
   ================================================================= */
.settings-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--border-radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-badge--success {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--color-success-light) 20%, transparent),
        color-mix(in srgb, var(--color-success) 15%, transparent)
    );
    color: var(--color-success);
    border: 1px solid color-mix(in srgb, var(--color-success) 20%, transparent);
}

.settings-badge svg {
    width: 12px;
    height: 12px;
}

/* =================================================================
   FORMULAIRES
   ================================================================= */
.settings-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

.form-label-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-sm);
}

.input-with-badge {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.input-with-badge .input {
    flex: 1;
}

.input-with-badge .settings-badge {
    position: absolute;
    right: var(--spacing-md);
    pointer-events: none;
}

.form-help {
    display: block;
    margin-top: var(--spacing-sm);
    font-size: var(--font-size-sm);
    color: var(--color-gray);
    line-height: 1.5;
}

/* Sections de formulaire */
.form-section {
    padding-bottom: var(--spacing-2xl);
    border-bottom: 1px solid rgba(12, 129, 228, 0.1);
}

.form-section:last-of-type {
    padding-bottom: 0;
    border-bottom: none;
}

.form-section__title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-black);
    margin-bottom: var(--spacing-sm);
    font-family: var(--font-secondary);
    margin-top: var(--spacing-2xl);
}

.form-section__description {
    font-size: var(--font-size-sm);
    color: var(--color-gray-dark);
    margin-bottom: var(--spacing-lg);
    line-height: 1.5;
}

/* Actions de formulaire */
.form-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: var(--spacing-xl);
    margin-top: var(--spacing-xl);
    border-top: 1px solid rgba(12, 129, 228, 0.1);
}

/* Fix pour les labels avec classe required de Symfony */
.settings-form .label.required,
.settings-form .label {
    color: var(--color-black) !important;
}

/* Boutons de submit - Style minimaliste */
.settings-form button[type="submit"] {
    margin-top: 0 !important;
    margin-bottom: var(--spacing-xl) !important;
    display: inline-flex !important;
    width: auto !important;
    max-width: fit-content !important;
    align-self: flex-end !important;
}

/* =================================================================
   ACTIONS
   ================================================================= */
.settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
}

.settings-actions--center {
    justify-content: center;
}

.settings-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.settings-actions .btn svg {
    width: 16px;
    height: 16px;
}


/* =================================================================
   RESPONSIVE
   ================================================================= */
@media (max-width: 768px) {
    .settings-container {
        padding: var(--spacing-xl) var(--spacing-md);
    }

    .settings-header {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .settings-title {
        font-size: 1.75rem;
    }

    .settings-subtitle {
        font-size: var(--font-size-base);
    }

    .settings-tabs {
        gap: var(--spacing-xl);
    }

    .settings-tab {
        font-size: var(--font-size-sm);
    }

    .settings-tab__icon {
        width: 20px;
        height: 20px;
    }

    .settings-card__header,
    .settings-card__body {
        padding: var(--spacing-xl);
    }

    .settings-actions {
        flex-direction: column;
    }

    .settings-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .input-with-badge .settings-badge {
        padding: 6px;
        gap: 0;
        font-size: 0;
    }

    .input-with-badge .settings-badge svg {
        width: 14px;
        height: 14px;
    }
}

/* =================================================================
   CONFIGURATION MOODLE - Nouveaux éléments
   ================================================================= */

/* Warning box pour les prérequis */
.settings-warning-box {
    display: flex;
    gap: var(--spacing-lg);
    padding: var(--spacing-xl);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.08) 0%, rgba(245, 158, 11, 0.05) 100%);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: var(--border-radius-lg);
    margin-bottom: var(--spacing-3xl);
}

.settings-warning-box__icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: #f59e0b;
}

.settings-warning-box__icon svg {
    width: 100%;
    height: 100%;
}

.settings-warning-box__title {
    font-size: 1rem;
    font-weight: var(--font-weight-semibold);
    color: #b45309;
    margin: 0 0 var(--spacing-sm) 0;
}

.settings-warning-box__text {
    font-size: 0.875rem;
    color: #92400e;
    margin: 0;
    line-height: 1.5;
}

/* Liste des plugins */
.settings-plugins-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.settings-plugin-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg);
    background: var(--color-gray-lightest);
    border: 1px solid var(--color-gray-border);
    border-radius: var(--border-radius-md);
    transition: all 300ms ease;
}

.settings-plugin-item:hover {
    background: var(--color-white);
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(12, 129, 228, 0.1);
}

.settings-plugin-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.settings-plugin-info strong {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--color-primary);
}

.settings-plugin-desc {
    font-size: 0.8125rem;
    color: var(--color-gray-dark);
}

/* Liste des services web */
.settings-webservices-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
}

.settings-webservice-item {
    display: grid;
    grid-template-columns: 80px 1fr 2fr;
    gap: var(--spacing-md);
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--color-gray-lightest);
    border: 1px solid var(--color-gray-border);
    border-radius: var(--border-radius-md);
    transition: all 300ms ease;
}

.settings-webservice-item:hover {
    background: var(--color-white);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.settings-webservice-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    font-size: 0.6875rem;
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    border-radius: var(--border-radius-full);
    letter-spacing: 0.5px;
}

.settings-webservice-item:nth-child(-n+4) .settings-webservice-badge {
    background: linear-gradient(135deg, rgba(12, 129, 228, 0.12) 0%, rgba(58, 158, 235, 0.08) 100%);
    color: var(--color-primary-dark);
}

.settings-webservice-item:nth-child(n+5) .settings-webservice-badge {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12) 0%, rgba(124, 58, 237, 0.08) 100%);
    color: #7c3aed;
}

.settings-webservice-name {
    font-family: 'Courier New', monospace;
    font-size: 0.8125rem;
    font-weight: var(--font-weight-medium);
    color: var(--color-black);
}

.settings-webservice-desc {
    font-size: 0.8125rem;
    color: var(--color-gray-dark);
}

/* Help text */
.settings-help-text {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    background: rgba(12, 129, 228, 0.05);
    border-left: 3px solid var(--color-primary);
    border-radius: var(--border-radius-sm);
    font-size: 0.8125rem;
    color: var(--color-gray-dark);
    line-height: 1.5;
}

.settings-help-text svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: var(--color-primary);
    margin-top: 2px;
}

/* =================================================================
   COMING SOON SECTION
   ================================================================= */
.settings-coming-soon {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--spacing-3xl) var(--spacing-2xl);
    gap: var(--spacing-xl);
}

.settings-coming-soon__icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(12, 129, 228, 0.08) 0%, rgba(58, 158, 235, 0.05) 100%);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    color: var(--color-gray-dark);
}

.settings-coming-soon__icon svg {
    width: 48px;
    height: 48px;
}

.settings-coming-soon__title {
    font-size: 1.5rem;
    font-weight: var(--font-weight-semibold);
    color: var(--color-black);
    font-family: var(--font-secondary);
}

.settings-coming-soon__text {
    font-size: var(--font-size-base);
    color: var(--color-gray-dark);
    max-width: 600px;
    line-height: 1.6;
}

.settings-coming-soon__list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-width: 500px;
    width: 100%;
    text-align: left;
}

.settings-coming-soon__list li {
    position: relative;
    padding: var(--spacing-sm) var(--spacing-md);
    padding-left: var(--spacing-2xl);
    font-size: var(--font-size-base);
    color: var(--color-gray-dark);
    border-radius: var(--border-radius-sm);
    transition: background-color 200ms ease;
}

.settings-coming-soon__list li:before {
    content: "✓";
    position: absolute;
    left: var(--spacing-md);
    color: var(--color-primary);
    font-weight: var(--font-weight-bold);
}

.settings-coming-soon__list li:hover {
    background-color: rgba(12, 129, 228, 0.05);
}

@media (max-width: 480px) {
    .settings-container {
        padding: var(--spacing-lg) var(--spacing-sm);
    }

    .settings-title {
        font-size: 1.5rem;
    }

    .settings-tabs {
        gap: var(--spacing-lg);
    }

    .settings-tab__text {
        display: none;
    }

    .settings-tab__icon {
        width: 24px;
        height: 24px;
    }

    .settings-card__header,
    .settings-card__body {
        padding: var(--spacing-lg);
    }

    .settings-card__title {
        font-size: 1.25rem;
    }

    /* Configuration Moodle responsive */
    .settings-warning-box {
        flex-direction: column;
        padding: var(--spacing-lg);
    }

    .settings-plugin-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }

    .settings-webservice-item {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .settings-webservice-badge {
        justify-self: start;
    }
}

/* =================================================================
   SLIDIA SETTINGS - Design par catégorie
   ================================================================= */

/* Section */
.slidia-settings-section {
    margin-bottom: var(--spacing-2xl);
    padding-bottom: var(--spacing-xl);
    border-bottom: 1px solid rgba(12, 129, 228, 0.1);
}

.slidia-settings-section:last-of-type {
    margin-bottom: var(--spacing-xl);
    border-bottom: none;
}

.slidia-settings-section__header {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.slidia-settings-section__icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(12, 129, 228, 0.1) 0%, rgba(58, 158, 235, 0.05) 100%);
    border-radius: var(--border-radius-lg);
    color: var(--color-primary);
    flex-shrink: 0;
}

.slidia-settings-section__text {
    flex: 1;
}

.slidia-settings-section__title {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: var(--color-black);
    margin: 0 0 2px 0;
    font-family: var(--font-secondary);
}

.slidia-settings-section__desc {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin: 0;
}

.slidia-settings-section__content {
    padding-left: 52px;
}

/* Font selector */
.slidia-font-selector {
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
}

.slidia-font-select {
    min-width: 180px;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--color-gray-border);
    border-radius: var(--border-radius-md);
    background: var(--color-white);
    font-size: var(--font-size-sm);
    color: var(--color-black);
    cursor: pointer;
    transition: border-color 150ms ease;
}

.slidia-font-select:hover {
    border-color: var(--color-primary-light);
}

.slidia-font-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(12, 129, 228, 0.1);
}

.slidia-font-preview {
    font-size: var(--font-size-lg);
    color: var(--color-text-secondary);
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--color-gray-lightest);
    border-radius: var(--border-radius-md);
}

/* Responsive */
@media (max-width: 768px) {
    .slidia-settings-section__content {
        padding-left: 0;
    }

    .color-picker-group--row {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .slidia-font-selector {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }

    .slidia-font-select {
        width: 100%;
    }
}
