/* ============================================================
   Scraper Entreprises FR - Feuille de styles
   ============================================================ */

/* Reset et base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    line-height: 1.6;
    font-size: 14px;
}

a {
    color: #2563eb;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* ============================================================
   Navigation
   ============================================================ */
.navbar {
    background: #1a1a2e;
    color: #fff;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    gap: 4px;
}

.nav-links a {
    color: #a0aec0;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 14px;
}

.nav-links a:hover,
.nav-links a.active {
    color: #fff;
    background: rgba(255,255,255,0.1);
    text-decoration: none;
}

.nav-links a.active {
    background: #2563eb;
}

/* ============================================================
   Container et cartes
   ============================================================ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.card {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
}

.card h1 {
    font-size: 24px;
    margin-bottom: 4px;
    color: #1a1a2e;
}

.card h2 {
    font-size: 18px;
    margin-bottom: 16px;
    color: #1a1a2e;
}

.subtitle {
    color: #64748b;
    margin-bottom: 20px;
}

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.text-center { text-align: center; }
.text-muted { color: #94a3b8; }

/* ============================================================
   Formulaires
   ============================================================ */
.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 180px;
}

.form-group.flex-2 {
    flex: 2;
}
.form-group.flex-1 {
    flex: 1;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #374151;
    font-size: 13px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: #94a3b8;
    font-size: 12px;
}

.form-group-btn {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding-bottom: 2px;
}

.form-actions {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.radio-group {
    display: flex;
    gap: 24px;
}

.radio-label,
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.filter-form .form-row {
    align-items: flex-end;
}

/* ============================================================
   Boutons
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    gap: 8px;
    line-height: 1.4;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
}
.btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
}

.btn-secondary {
    background: #475569;
    color: #fff;
}
.btn-secondary:hover:not(:disabled) {
    background: #334155;
}

.btn-outline {
    background: transparent;
    color: #475569;
    border: 1px solid #d1d5db;
}
.btn-outline:hover {
    background: #f1f5f9;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

/* ============================================================
   Statistiques
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    color: #2563eb;
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    color: #64748b;
    margin-top: 4px;
}

.stats-mini {
    display: flex;
    gap: 24px;
    margin-top: 12px;
    font-size: 13px;
    color: #64748b;
}

/* ============================================================
   Barre de progression
   ============================================================ */
.progress-zone {
    margin-top: 20px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.progress-zone h3 {
    margin-bottom: 12px;
    font-size: 16px;
}

.progress-bar-container {
    width: 100%;
    height: 28px;
    background: #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    border-radius: 14px;
    width: 0%;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
}

.progress-bar span {
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.progress-message {
    margin-top: 8px;
    color: #64748b;
    font-size: 13px;
}

/* ============================================================
   Tableaux
   ============================================================ */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table thead th {
    background: #f8fafc;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
}

.table tbody tr:hover {
    background: #f8fafc;
}

.table code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #475569;
}

/* ============================================================
   Badges
   ============================================================ */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-nouveau {
    background: #e2e8f0;
    color: #475569;
}
.badge-api_ok {
    background: #dbeafe;
    color: #1e40af;
}
.badge-pj_ok {
    background: #fef3c7;
    color: #92400e;
}
.badge-email_ok {
    background: #d1fae5;
    color: #065f46;
}
.badge-erreur {
    background: #fee2e2;
    color: #991b1b;
}

/* ============================================================
   Pagination
   ============================================================ */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.pagination-info {
    margin-left: 16px;
    color: #64748b;
    font-size: 13px;
}

/* ============================================================
   Alertes
   ============================================================ */
.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* ============================================================
   Utilitaires
   ============================================================ */
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.result-zone {
    margin-top: 20px;
}

.result-actions {
    margin-top: 12px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        height: auto;
        padding: 12px;
        gap: 8px;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
    }

    .container {
        padding: 12px;
    }

    .card {
        padding: 16px;
    }

    .form-row {
        flex-direction: column;
    }

    .form-group {
        min-width: 100%;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn-lg {
        width: 100%;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Animations
   ============================================================ */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

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

.progress-zone {
    animation: slideIn 0.3s ease;
}
