/* ============================================================
   TextFlow — Admin Settings Styles
   Palette : dark #111827 · amber accent #f59e0b · slate text
   ============================================================ */

/* ------ Layout ------ */
.aicf-settings-wrap {
    max-width: 860px;
    margin-top: 20px;
}

/* ------ Header ------ */
.aicf-settings-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px 28px;
    background: #111827;
    border-radius: 10px;
    color: #fff;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    border-left: 4px solid #f59e0b;
}

.aicf-header-icon {
    font-size: 26px;
    line-height: 1;
    flex-shrink: 0;
    opacity: 0.75;
}

.aicf-header-title {
    margin: 0 !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #fff !important;
    line-height: 1.2;
}

.aicf-header-subtitle {
    margin: 5px 0 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
}

/* ------ Notice personnalisée (en dessous du header WP) ------ */
.aicf-notice {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 500;
}

.aicf-notice-warning {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    color: #92400e;
}

/* ------ Cards de section ------ */
.aicf-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.aicf-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.aicf-card-header h2 {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none !important;
}

.aicf-card-body {
    padding: 4px 0;
}

.aicf-section-desc {
    margin: 12px 20px 0;
    font-size: 13px;
    color: #64748b;
}

/* ------ Override des styles de form-table dans nos cards ------ */
.aicf-card .form-table {
    margin: 0;
    border: none;
    box-shadow: none;
}

.aicf-card .form-table th {
    padding: 16px 20px;
    font-weight: 600;
    color: #374151;
    width: 220px;
    font-size: 13px;
}

.aicf-card .form-table td {
    padding: 16px 20px;
}

.aicf-card .form-table tr:not(:last-child) th,
.aicf-card .form-table tr:not(:last-child) td {
    border-bottom: 1px solid #f1f5f9;
}

/* ------ Grille de sélection de fournisseur ------ */
.aicf-provider-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.aicf-provider-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 14px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    min-width: 130px;
    text-align: center;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    background: #f9fafb;
    position: relative;
}

.aicf-provider-card:hover {
    border-color: #fbbf24;
    background: #fffbeb;
}

.aicf-provider-card.active {
    border-color: #f59e0b;
    background: #fffbeb;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.aicf-provider-card input[type="radio"] {
    position: absolute;
    top: 8px;
    right: 8px;
    margin: 0;
    accent-color: #f59e0b;
}

.aicf-provider-icon {
    font-size: 28px;
    line-height: 1;
}

.aicf-provider-name {
    font-weight: 600;
    font-size: 12px;
    color: #1f2937;
    line-height: 1.3;
}

.aicf-provider-desc {
    font-size: 11px;
    color: #6b7280;
    line-height: 1.3;
}

/* ------ Champ clé API ------ */
.aicf-api-key-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.aicf-api-key-input {
    font-family: monospace !important;
    font-size: 13px !important;
}

.aicf-toggle-key {
    padding: 4px 8px !important;
    min-width: 34px !important;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.aicf-toggle-key .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
}

.aicf-test-api {
    white-space: nowrap !important;
}

/* ------ Résultat du test API ------ */
.aicf-test-result {
    display: inline-block;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 4px;
    transition: all 0.2s;
}

.aicf-test-result:empty {
    display: none;
}

.aicf-test-success {
    color: #065f46;
    background: #d1fae5;
    border: 1px solid #6ee7b7;
}

.aicf-test-error {
    color: #991b1b;
    background: #fee2e2;
    border: 1px solid #fca5a5;
}

/* ------ Zone d'upload de fichier ------ */
.aicf-file-upload-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.aicf-file-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    font-size: 13px;
}

.aicf-file-icon {
    font-size: 18px;
    line-height: 1;
}

.aicf-file-name {
    font-weight: 500;
    color: #065f46;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aicf-file-type {
    font-size: 10px;
    background: #d1fae5;
    color: #065f46;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.aicf-remove-file {
    background: none !important;
    border: none !important;
    cursor: pointer;
    color: #9ca3af;
    font-size: 14px;
    padding: 0 2px !important;
    line-height: 1;
    box-shadow: none !important;
}

.aicf-remove-file:hover {
    color: #dc2626;
}

.aicf-select-file {
    white-space: nowrap !important;
}

/* ------ Bouton de soumission ------ */
.aicf-settings-wrap .submit {
    padding: 0;
    margin-top: 4px;
}

.aicf-settings-wrap .submit input[type="submit"] {
    background: #f59e0b !important;
    border: none !important;
    color: #111827 !important;
    padding: 10px 28px !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3) !important;
    transition: background 0.15s, box-shadow 0.15s;
    height: auto !important;
}

.aicf-settings-wrap .submit input[type="submit"]:hover {
    background: #d97706 !important;
    box-shadow: 0 2px 12px rgba(245, 158, 11, 0.4) !important;
}

/* ------ Color picker & Elementor global swatches ------ */
.aicf-color-field-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.aicf-global-colors {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.aicf-global-colors-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
}

.aicf-global-colors-swatches {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.aicf-color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.1s, box-shadow 0.15s;
    padding: 0;
    outline: none;
}

.aicf-color-swatch:hover {
    border-color: #f59e0b;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* ------ Pro badge ------ */
.aicf-pro-badge {
    display: inline-block;
    background: #1e293b;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.8px;
    padding: 2px 7px;
    border-radius: 3px;
    vertical-align: middle;
    margin-left: 6px;
    line-height: 1.4;
}

/* ------ Upgrade link ------ */
.aicf-upgrade-link {
    color: #b45309 !important;
    font-weight: 600;
    text-decoration: none !important;
    margin-left: 4px;
}

.aicf-upgrade-link:hover {
    color: #92400e !important;
    text-decoration: underline !important;
}

/* ------ Notice upgrade (Free plan) ------ */
.aicf-notice-upgrade {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    color: #92400e;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.aicf-notice-upgrade-content {
    flex: 1;
}

.aicf-notice-upgrade-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.aicf-btn-upgrade {
    background: #f59e0b;
    color: #111827 !important;
    font-weight: 700;
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 5px;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background 0.15s;
}

.aicf-btn-upgrade:hover {
    background: #d97706;
    color: #111827 !important;
}

.aicf-btn-license-key {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #92400e;
    font-weight: 600;
    font-size: 12px;
    text-decoration: none;
    border-bottom: 1px dashed #d97706;
    padding-bottom: 1px;
    white-space: nowrap;
    line-height: inherit;
}

.aicf-btn-license-key:hover {
    color: #451a03;
    border-bottom-style: solid;
}

/* ------ Formulaire inline d'activation de licence ------ */
.aicf-license-inline-form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.08);
}

.aicf-license-key-input {
    flex: 1 1 200px;
    max-width: 280px;
    padding: 6px 10px;
    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 4px;
    font-size: 13px;
    font-family: monospace;
    letter-spacing: 0.05em;
}

.aicf-btn-activate-license {
    padding: 6px 14px;
    background: #059669;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.aicf-btn-activate-license:hover { background: #047857; }
.aicf-btn-activate-license:disabled { opacity: 0.6; cursor: not-allowed; }

.aicf-btn-cancel-license {
    padding: 6px 12px;
    background: transparent;
    color: rgba(0,0,0,0.45);
    border: 1px solid rgba(0,0,0,0.18);
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.aicf-btn-cancel-license:hover { color: rgba(0,0,0,0.7); border-color: rgba(0,0,0,0.3); }

.aicf-license-result { font-size: 12px; }
.aicf-license-result-success { color: #059669; font-weight: 600; }
.aicf-license-result-error   { color: #dc2626; }

/* ------ Pro locked state ------ */
.aicf-pro-locked {
    opacity: 0.5;
    pointer-events: none;
}
