/* ========================================
   ANNUAIRE ADHÉRENTS UNPNC - CSS STANDALONE
   À uploader dans /wp-content/plugins/unpnc-task-manager/assets/css/
   Nom du fichier: annuaire-adherents.css
   ======================================== */

:root {
    --unpnc-primary: #2271b1;
    --unpnc-primary-dark: #135e96;
    --unpnc-success: #00a32a;
    --unpnc-warning: #dba617;
    --unpnc-danger: #d63638;
    --unpnc-light: #f6f7f7;
    --unpnc-border: #dcdcde;
    --unpnc-text: #1d2327;
    --unpnc-text-light: #50575e;
}

.unpnc-adherents-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.unpnc-adherents-header {
    background: linear-gradient(135deg, var(--unpnc-primary), var(--unpnc-primary-dark)) !important;
    color: white !important;
    padding: 30px !important;
    border-radius: 12px !important;
    margin-bottom: 25px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}

.unpnc-adherents-header h2 {
    margin: 0 0 8px 0;
    font-size: 28px;
    color: white;
}

.unpnc-adherents-header p {
    margin: 0;
    opacity: 0.95;
    font-size: 15px;
}

.unpnc-search-container {
    position: relative;
    margin-bottom: 25px;
}

#adherents-search {
    width: 100%;
    padding: 15px 50px 15px 20px;
    font-size: 16px;
    border: 2px solid var(--unpnc-border);
    border-radius: 10px;
    transition: all 0.3s;
}

#adherents-search:focus {
    outline: none;
    border-color: var(--unpnc-primary);
    box-shadow: 0 0 0 3px rgba(34,113,177,0.1);
}

#search-loader {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

#initial-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.initial-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

#initial-state h3 {
    font-size: 24px;
    color: var(--unpnc-text);
    margin: 0 0 10px 0;
}

#initial-state p {
    color: var(--unpnc-text-light);
    margin: 0;
}

#adherents-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
    gap: 20px !important;
}

.adherent-card {
    background: white !important;
    border: 2px solid var(--unpnc-border) !important;
    border-radius: 12px !important;
    padding: 20px !important;
    cursor: pointer !important;
    transition: all 0.3s !important;
    position: relative !important;
}

.adherent-card:hover {
    border-color: var(--unpnc-primary);
    box-shadow: 0 4px 16px rgba(34,113,177,0.15);
    transform: translateY(-2px);
}

.adherent-card-header {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.adherent-avatar {
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, var(--unpnc-primary), var(--unpnc-primary-dark)) !important;
    color: white !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 20px !important;
    font-weight: bold !important;
    flex-shrink: 0 !important;
}

.adherent-info {
    flex: 1;
    min-width: 0;
}

.adherent-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--unpnc-text);
    margin: 0 0 5px 0;
}

.adherent-npa {
    font-size: 13px;
    color: var(--unpnc-text-light);
    font-family: monospace;
}

.adherent-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.badge {
    padding: 4px 10px !important;
    border-radius: 12px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    display: inline-block !important;
}

.badge-profession {
    background: #e7f5ff !important;
    color: #0c5460 !important;
}

.badge-service {
    background: #fff3cd !important;
    color: #856404 !important;
}

.tasks-count {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--unpnc-warning);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

/* MODAL FICHE ADHÉRENT */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    margin: 3% auto;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    background: linear-gradient(135deg, var(--unpnc-primary), var(--unpnc-primary-dark));
    color: white;
    padding: 25px 30px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 24px;
}

.modal-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.modal-close:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
}

.fiche-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--unpnc-light);
}

.fiche-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--unpnc-primary), var(--unpnc-primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(34,113,177,0.3);
}

.fiche-main-info h2 {
    margin: 0 0 8px 0;
    font-size: 28px;
    color: var(--unpnc-text);
}

.fiche-main-info p {
    margin: 0;
    color: var(--unpnc-text-light);
    font-family: monospace;
    font-size: 16px;
}

.fiche-section {
    margin-bottom: 30px;
}

.fiche-section h4 {
    font-size: 18px;
    color: var(--unpnc-text);
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--unpnc-light);
}

.fiche-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.fiche-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.fiche-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--unpnc-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fiche-value {
    font-size: 15px;
    color: var(--unpnc-text);
    font-weight: 500;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-box {
    background: white;
    border: 2px solid var(--unpnc-border);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s;
}

.stat-box:hover {
    border-color: var(--unpnc-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: var(--unpnc-primary);
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    color: var(--unpnc-text-light);
    margin-top: 5px;
}

.timeline-item {
    padding: 15px;
    margin-bottom: 12px;
    background: white;
    border: 2px solid var(--unpnc-border);
    border-left: 4px solid var(--unpnc-warning);
    border-radius: 8px;
    transition: all 0.2s;
}

.timeline-item:hover {
    border-color: var(--unpnc-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.timeline-item.completed {
    border-left-color: var(--unpnc-success);
    opacity: 0.8;
}

.timeline-date {
    font-size: 12px;
    color: var(--unpnc-text-light);
    font-weight: 600;
    margin-bottom: 5px;
}

.timeline-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--unpnc-text);
    margin-bottom: 5px;
}

.timeline-desc {
    font-size: 13px;
    color: var(--unpnc-text-light);
    margin: 5px 0;
}

.timeline-badge {
    display: inline-block;
    padding: 3px 8px;
    background: var(--unpnc-light);
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 5px;
}

.notes-section {
    background: #fffbf0;
    border: 2px dashed var(--unpnc-warning);
    border-radius: 10px;
    padding: 20px;
}

.notes-section textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 2px solid var(--unpnc-border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

.notes-section textarea:focus {
    outline: none;
    border-color: var(--unpnc-primary);
}

.btn-save-notes {
    background: var(--unpnc-primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s;
}

.btn-save-notes:hover {
    background: var(--unpnc-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34,113,177,0.3);
}

.fiche-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.btn-action {
    flex: 1;
    min-width: 150px;
    padding: 12px 20px;
    border: 2px solid var(--unpnc-primary);
    background: white;
    color: var(--unpnc-primary);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-action:hover {
    background: var(--unpnc-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34,113,177,0.2);
}

/* SYSTÈME D'ONGLETS */
.tabs-container {
    width: 100%;
}

.tabs-header {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid var(--unpnc-border);
    margin-bottom: 25px;
    overflow-x: auto;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--unpnc-text-light);
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    white-space: nowrap;
    position: relative;
    bottom: -2px;
}

.tab-btn:hover {
    color: var(--unpnc-primary);
    background: rgba(34,113,177,0.05);
}

.tab-btn.active {
    color: var(--unpnc-primary);
    font-weight: 600;
    border-bottom-color: var(--unpnc-primary);
    background: rgba(34,113,177,0.05);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

@media (max-width: 768px) {
    .unpnc-adherents-wrapper { padding: 15px; }
    .unpnc-adherents-header { padding: 20px; }
    .unpnc-adherents-header h2 { font-size: 22px; }
    #adherents-list { grid-template-columns: 1fr !important; }
    .modal-content { width: 95%; margin: 5% auto; }
    .fiche-header { flex-direction: column; text-align: center; }
    .fiche-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    .fiche-actions { flex-direction: column; }
    .btn-action { min-width: 100%; }
    .tabs-header { gap: 2px; }
    .tab-btn { padding: 10px 16px; font-size: 14px; }
}
