/* ==========================================================================
   ENERGYNEWS DESIGN SYSTEM (SHADCN UI STYLE)
   ========================================================================== */

:root {
    --enw-bg: #ffffff;
    --enw-fg: #09090b;
    --enw-primary: #18181b;
    --enw-primary-fg: #fafafa;
    --enw-secondary: #f4f4f5;
    --enw-secondary-fg: #18181b;
    --enw-muted: #f4f4f5;
    --enw-muted-fg: #71717a;
    --enw-border: #e4e4e7;
    --enw-input: #e4e4e7;
    --enw-radius: 0.375rem; /* 6px */
    --enw-font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.enw-dashboard-wrap, .enw-dashboard-content, .enw-onboarding-ui {
    font-family: var(--enw-font-sans);
    color: var(--enw-fg);
    line-height: 1.5;
}

/* --- WRAPPERS & CARDS --- */
.enw-dashboard-content, .enw-onboarding-view {
    background-color: var(--enw-bg);
    border: 1px solid var(--enw-border);
    border-radius: var(--enw-radius);
    padding: 1.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    margin-top: 1.5rem;
}

.enw-section-title {
    font-size: 1.25rem; /* 20px */
    font-weight: 600;
    letter-spacing: -0.025em;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--enw-border);
    color: var(--enw-fg);
}

/* --- BUTTONS (SHADCN VARIANTS) --- */
.enw-dashboard-wrap button, 
.enw-dashboard-wrap input[type="submit"],
.enw-dashboard-wrap .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--enw-radius);
    font-size: 0.875rem;
    font-weight: 500;
    height: 2.5rem; /* 40px */
    padding: 0 1rem;
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    line-height: 1;
}

/* Primary (Black) */
.enw-dashboard-wrap .btn-primary,
.enw-dashboard-wrap input[type="submit"] {
    background-color: var(--enw-primary);
    color: var(--enw-primary-fg);
    border-color: var(--enw-primary);
}
.enw-dashboard-wrap .btn-primary:hover,
.enw-dashboard-wrap input[type="submit"]:hover {
    background-color: #27272a; /* Zinc 800 */
}

/* Secondary (Gray) */
.enw-dashboard-wrap .btn-default,
.enw-dashboard-wrap .btn-secondary {
    background-color: var(--enw-secondary);
    color: var(--enw-secondary-fg);
}
.enw-dashboard-wrap .btn-default:hover {
    background-color: #e4e4e7; /* Zinc 200 */
}

/* Outline */
.enw-dashboard-wrap .btn-outline {
    background-color: transparent;
    border: 1px solid var(--enw-border);
    color: var(--enw-fg);
}
.enw-dashboard-wrap .btn-outline:hover {
    background-color: var(--enw-secondary);
}

/* Destructive (Red/Ghost) */
.enw-delete-job {
    background: transparent !important;
    color: #ef4444 !important; /* Red 500 */
    border: 1px solid #fee2e2 !important;
}
.enw-delete-job:hover {
    background-color: #fef2f2 !important;
}

/* Small Button */
.enw-dashboard-wrap .btn-sm {
    height: 2rem; /* 32px */
    padding: 0 0.75rem;
    font-size: 0.75rem;
}

/* --- FORMS & INPUTS (ACF OVERRIDES) --- */
.acf-field {
    margin-bottom: 1.25rem !important;
    border: none !important;
    padding: 0 !important;
}

.acf-label label {
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    color: var(--enw-fg) !important;
    margin-bottom: 0.5rem !important;
}

.acf-input input[type="text"],
.acf-input input[type="email"],
.acf-input input[type="number"],
.acf-input input[type="url"],
.acf-input input[type="password"],
.acf-input textarea,
.acf-input select {
    display: flex;
    width: 100%;
    height: 2.5rem; /* 40px */
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    background-color: transparent;
    border: 1px solid var(--enw-input);
    border-radius: var(--enw-radius);
    color: var(--enw-fg);
    box-shadow: none !important;
    transition: border-color 0.2s;
}

.acf-input textarea {
    height: auto;
    min-height: 80px;
}

.acf-input input:focus,
.acf-input select:focus,
.acf-input textarea:focus {
    outline: none;
    border-color: #000; /* Ring effect */
    box-shadow: 0 0 0 1px #000 !important;
}

/* Nettoyage des bordures ACF natives */
.acf-fields.-left > .acf-field:before { display: none; }
.acf-form-submit { margin-top: 2rem; }

/* --- SELECT2 (Joli Dropdown) --- */
.select2-container .select2-selection--single {
    height: 2.5rem !important;
    border: 1px solid var(--enw-input) !important;
    border-radius: var(--enw-radius) !important;
    display: flex !important;
    align-items: center;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 2.5rem !important;
}

/* --- TABLES (Liste des Jobs) --- */
.enw-dashboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.enw-dashboard-table thead tr {
    border-bottom: 1px solid var(--enw-border);
}
.enw-dashboard-table th {
    text-align: left;
    font-weight: 500;
    color: var(--enw-muted-fg);
    padding: 0.75rem 1rem;
    background: transparent !important; /* Override JNews */
}
.enw-dashboard-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--enw-border);
    vertical-align: middle;
}
.enw-dashboard-table tr:last-child td {
    border-bottom: none;
}

/* --- ALERTS & BADGES --- */
.enw-alert-box {
    padding: 1rem;
    border-radius: var(--enw-radius);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.enw-alert-info { background: #eff6ff; color: #1d4ed8; border: 1px solid #dbeafe; } /* Blue-50 */
.enw-alert-warning { background: #fff7ed; color: #c2410c; border: 1px solid #ffedd5; } /* Orange-50 */
.enw-alert-danger { background: #fef2f2; color: #b91c1c; border: 1px solid #fee2e2; } /* Red-50 */

.enw-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    padding: 0.125rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}
.enw-status-publish { background: #dcfce7; color: #15803d; } /* Green */
.enw-status-pending { background: #fef9c3; color: #a16207; } /* Yellow */
.enw-status-draft { background: #f4f4f5; color: #52525b; } /* Gray */

/* --- ONBOARDING GRID --- */
.enw-onboarding-ui h3 {
    font-weight: 700;
    letter-spacing: -0.05em;
    margin-bottom: 2rem;
}
.enw-action-group {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* --- AMÉLIORATION UX CV (REPEATER CARDS) --- */

/* Le conteneur de chaque ligne devient une "Carte" */
.acf-repeater .acf-row {
    background: #fff;
    border: 1px solid var(--enw-border) !important;
    border-radius: var(--enw-radius);
    margin-bottom: 1.5rem !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    padding: 1.5rem !important;
}

/* On enlève les bordures moches par défaut d'ACF sur les cellules */
.acf-repeater .acf-row .acf-field {
    border-bottom: none !important;
    padding: 0 0 1rem 0 !important;
}

/* Le bouton "Supprimer" (la croix ou le texte à droite) */
.acf-repeater .acf-row-handle {
    background: transparent !important;
    border: none !important;
    color: #999;
    text-align: right;
    padding: 10px !important;
}
.acf-repeater .acf-row-handle .acf-icon.-minus {
    background: #fff;
    border: 1px solid #fee2e2;
    color: #ef4444;
    border-radius: 50%;
    padding: 5px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Le bouton "Ajouter une expérience" */
.acf-repeater .acf-actions .acf-button {
    background-color: var(--enw-secondary) !important;
    color: var(--enw-secondary-fg) !important;
    border: 1px solid var(--enw-input) !important;
    border-radius: var(--enw-radius) !important;
    padding: 0.75rem 1.5rem !important;
    font-weight: 500 !important;
    text-transform: none !important;
    text-shadow: none !important;
    box-shadow: none !important;
    display: flex;
    margin: 0 auto; /* Centré */
}
.acf-repeater .acf-actions .acf-button:hover {
    background-color: #e4e4e7 !important;
}

/* Label des champs plus discrets */
.acf-field-repeater > .acf-label {
    margin-bottom: 1rem;
    font-size: 1.1rem !important;
    border-bottom: 2px solid var(--enw-secondary);
    padding-bottom: 0.5rem;
}

/* --- FEEDBACK MODAL (ASSET REPORT) --- */
.enw-feedback-modal {
    display:none; 
    position: fixed; 
    z-index: 9999; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}
.enw-feedback-content {
    background-color: var(--enw-bg);
    margin: 10% auto;
    padding: 2rem;
    border: 1px solid var(--enw-border);
    width: 90%;
    max-width: 500px;
    border-radius: var(--enw-radius);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    position: relative;
}
.enw-close-modal {
    color: var(--enw-muted-fg);
    float: right;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}
.enw-close-modal:hover { color: var(--enw-fg); }
.enw-feedback-textarea {
    width: 100%;
    min-height: 120px;
    margin: 1rem 0;
    padding: 0.75rem;
    border: 1px solid var(--enw-input);
    border-radius: var(--enw-radius);
    font-family: inherit;
}