@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --bg-app: #030304;
    --bg-sidebar: #0a0a0c;
    --bg-card: #0f0f12;
    --bg-card-hover: #16161a;
    --border: rgba(255, 255, 255, 0.2);
    --border-hover: rgba(255, 255, 255, 0.15);
    --primary: #4ade80;
    --primary-glow: rgba(74, 222, 128, 0.4);
    --danger: #ef4444;
    --accent-purple: #a855f7;
    --accent-pink: #ec4899;
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --radius-l: 24px;
    --radius-m: 16px;
    --sidebar-width: 280px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --status-alive: var(--primary);
    --status-banned: var(--danger);
    --status-pending: #f59e0b;
    --status-error: var(--danger);
}

* { box-sizing: border-box; outline: none; }

body {
    margin: 0; font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-app); color: var(--text-main);
    display: flex; height: 100vh; overflow: hidden; font-size: 15px;
}

a { text-decoration: none; color: inherit; }

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-width); background: var(--bg-sidebar);
    border-right: 1px solid var(--border); display: flex; flex-direction: column;
    padding: 30px 20px; z-index: 100; flex-shrink: 0;
}

.brand {
    display: flex; align-items: center; gap: 12px; margin-bottom: 50px; padding-left: 10px;
}
.brand-logo {
    width: 40px; height: 40px; background: linear-gradient(135deg, var(--primary), var(--accent-purple));
    border-radius: 12px; display: grid; place-items: center;
    color: #000; font-weight: 900; font-size: 20px; box-shadow: 0 0 20px var(--primary-glow);
}
.brand-text { font-size: 18px; font-weight: 700; letter-spacing: -0.5px; }

.nav-menu { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }

.nav-item {
    padding: 14px 18px; border-radius: var(--radius-m); color: var(--text-muted);
    cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 14px;
    transition: var(--transition); border: 1px solid transparent;
}
.nav-item i { width: 20px; text-align: center; font-size: 18px; }
.nav-item:hover { background: rgba(255,255,255,0.03); color: #fff; }
.nav-item.active {
    background: rgba(74, 222, 128, 0.1); color: var(--primary);
    border-color: rgba(74, 222, 128, 0.15); box-shadow: 0 0 15px rgba(74, 222, 128, 0.05);
}

/* MAIN CONTENT */
.main-wrapper {
    flex: 1; overflow-y: auto; position: relative; padding: 40px;
    background-image: radial-gradient(circle at 5% 5%, rgba(74, 222, 128, 0.03) 0%, transparent 40%),
                      radial-gradient(circle at 95% 5%, rgba(168, 85, 247, 0.03) 0%, transparent 40%);
}

.top-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; }
.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}
h1 { font-size: 28px; font-weight: 800; margin: 0; letter-spacing: -1px; }
h3 { font-size: 18px; font-weight: 800; margin: 0; letter-spacing: -1px; }
.subtitle { color: var(--text-muted); font-size: 14px; margin-top: 6px; }

/* BENTO GRID */
.bento-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 40px; }

.card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-l);
    padding: 24px; position: relative; overflow: hidden; transition: var(--transition);
    display: flex; flex-direction: column; justify-content: space-between; min-height: 180px;
}
.card:hover {
    border-color: var(--border-hover); background: var(--bg-card-hover);
    transform: translateY(-4px); box-shadow: 0 10px 40px -10px rgba(0,0,0,0.5);
}

.span-2 { grid-column: span 2; }
.span-4 { grid-column: 1 / -1; }
.row-2 { grid-row: span 2; }
#worldMap {
    width: 100%;
    height: 100%;
    z-index: 1;
}
.p-0 { padding: 0 !important; }

.card-icon {
    width: 48px; height: 48px; border-radius: 14px; background: rgba(255,255,255,0.05);
    display: grid; place-items: center; font-size: 20px; margin-bottom: 16px; color: #fff;
}
.card-icon.green { color: var(--primary); background: rgba(74, 222, 128, 0.1); }
.card-icon.purple { color: var(--accent-purple); background: rgba(168, 85, 247, 0.1); }
.card-icon.pink { color: var(--accent-pink); background: rgba(236, 72, 153, 0.1); }

.card-value { font-size: 36px; font-weight: 800; color: #fff; margin-bottom: 4px; }
.card-label { color: var(--text-muted); font-size: 14px; font-weight: 500; }

.btn {
    padding: 12px 24px; 
    border-radius: 10px; 
    font-weight: 700; 
    font-size: 14px;
    cursor: pointer; 
    border: none; 
    display: inline-flex; 
    align-items: center; 
    gap: 8px;
    transition: var(--transition);
}
.btn-primary {
    background: var(--primary); color: #000; box-shadow: 0 4px 20px rgba(74, 222, 128, 0.2); gap:12px;
}
.btn-primary:hover { background: #34d399; transform: scale(1.05); }

/* ANIMATION */
.page-view { animation: fadeInUp 0.5s ease; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.map-avatar-marker {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: #333; /* Fond gris si pas d'image */
    box-shadow: 0 0 10px rgba(0,0,0,0.7); /* Ombre pour le relief */
    transition: transform 0.2s ease;
}

.map-avatar-marker:hover {
    transform: scale(1.2); /* Grossit au survol */
    z-index: 1000;
}

/* La Carte de profil */
.acc-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    overflow: hidden;
    position: relative;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.acc-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-hover);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.acc-card:hover .card-img {
    transform: scale(1.05);
}

/* Zone Image (Haut) */
.acc-header {
    height: 280px; /* Hauteur de la photo */
    position: relative;
    background-color: #222;
}

.acc-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.acc-card:hover .acc-img {
    transform: scale(1.05);
}

/* Badge Statut (Coin haut gauche) */
.acc-status {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    backdrop-filter: blur(4px);
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.acc-status.alive { background: rgba(74, 222, 128, 0.9); color: #000; }
.acc-status.banned { background: rgba(239, 68, 68, 0.9); color: #fff; }
.acc-status.error { background: rgba(249, 115, 22, 0.9); color: #fff; }

.banned-text {
    background: #ef4444;
    color: white;
    font-weight: 900;
    font-size: 24px;
    padding: 10px 0;
    width: 150%; /* Plus large que la carte pour couvrir les coins */
    text-align: center;
    transform: rotate(-15deg);
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    border: 2px solid white;
    letter-spacing: 2px;
}

/* Infos (Bas) */
.acc-body {
    padding: 16px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.acc-name {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    display: flex; justify-content: space-between; align-items: center;
}

.acc-location {
    font-size: 13px;
    color: var(--text-muted);
    display: flex; align-items: center; gap: 6px;
}

/* Stats Row */
.acc-stats {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.stat-pill {
    flex: 1;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}
.stat-pill b { display: block; font-size: 16px; color: #fff; margin-bottom: 2px; }

/* Actions Overlay (Apparaît au survol sur l'image) */
.acc-actions {
    position: absolute;
    bottom: 15px;
    left: 0; width: 100%;
    display: flex; justify-content: center; gap: 10px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 3;
}

.acc-card:hover .acc-actions {
    opacity: 1;
    transform: translateY(0);
}

.action-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: grid; place-items: center;
    font-size: 16px;
    transition: 0.2s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
}
.btn-edit { background: #333; color: #fff; }
.btn-edit:hover { background: #fff; color: #000; }
.btn-sync { background: var(--primary); color: #000; }
.btn-sync:hover { transform: scale(1.1); }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 10px; margin-top: 20px; }
.page-link { 
    padding: 10px 16px; background: var(--bg-card); border: 1px solid var(--border); 
    border-radius: 8px; color: var(--text-muted); font-weight: 600;
}
.page-link.active { background: var(--primary); color: #000; border-color: var(--primary); }
.page-link:hover:not(.active) { background: var(--bg-card-hover); color: #fff; }

/* Filtres Tabs */
.filter-tabs { display: flex; gap: 10px; margin-bottom: 25px; }
    .tab-btn {
        background: none;
        border: none;
        color: var(--text-muted, #94a3b8);
        padding: 10px 5px;
        cursor: pointer;
        font-family: 'DM Sans', sans-serif;
        font-weight: 500;
        font-size: 0.95rem;
        position: relative;
        transition: color 0.3s;
    }
    .tab-btn:hover { color: #fff; }
    .tab-btn.active {
        color: var(--primary, #4ade80);
    }
    .tab-btn.active::after {
        content: '';
        position: absolute;
        bottom: -1px; left: 0; right: 0;
        height: 2px;
        background: var(--primary, #4ade80);
        box-shadow: 0 0 10px var(--primary-glow, rgba(74, 222, 128, 0.4));
    }
.tab-btn:hover:not(.active) { background: rgba(255,255,255,0.05); color: #fff; }

.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); /* Cartes un peu plus larges */
    gap: 20px;
    padding-bottom: 50px;
}

/* Adaptation Responsive */
@media (max-width: 1600px) { .accounts-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 1200px) { .accounts-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .accounts-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .accounts-grid { grid-template-columns: 1fr; } }

.acc-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
}

.acc-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border-color: var(--border-hover);
}

.card-header {
    height: 300px; /* Grande image comme sur Tinder */
    position: relative;
    background: #1a1a1a;
    overflow: hidden;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

/* --- BADGE STATUS (GAUCHE) --- */
.badge-status {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 5;
    border: 2px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 6px;
}

.badges-right-stack {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 5;
}

.badges-right-stack .badge-class{
  position: relative;
  top: auto; left: auto;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Couleurs dynamiques */
.badge-status[data-status="alive"] { color: #10b981; border-color: rgba(16, 185, 129, 1); }
.badge-status[data-status="banned"] { color: #ef4444; border-color: rgba(239, 68, 68, 1); }
.badge-status[data-status="pending"] { color: #f59e0b; border-color: rgba(245, 158, 11, 1); }
.badge-status[data-status="error"] { color: #ef4444; border-color: rgba(239, 68, 68, 1); }

/* --- BADGE CLASS (SOUS LE STATUS) --- */
.badge-class {
    position: absolute;
    top: 54px; /* Juste en dessous du status */
    left: 15px;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.75rem; font-weight: 700;
    color: rgba(255,255,255,0.9);
    background: rgba(0,0,0,0.6); /* Fond sombre */
    border: 1px solid rgba(255,255,255,0.5);
    backdrop-filter: blur(6px);
    z-index: 9;
}
.badge-class i { color: #0ea5e9; font-size: 0.8rem; }

.badge-likes {
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    padding: 4px 10px;
    border-radius: 20px;
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    transition: transform 0.2s;
}
.badge-likes:hover { transform: scale(1.1); background: rgba(0,0,0,0.8); }

.badge-likes.normal {
    color: rgb(253, 41, 123);
    border: 1px solid rgba(253, 41, 123, 0.5);
    box-shadow: 0 0 10px rgba(253, 41, 123, 0.1);
}
.badge-likes.normal i {
    color: rgb(253, 41, 123);
}

.badge-likes.gold {
    color: #ffd700;
    border: 1px solid #ffd700;
    background: rgba(255, 215, 0, 0.15);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.3);
    animation: goldPulse 2s infinite;
}
.badge-likes.gold i {
    color: #ffd700;
}

@keyframes goldPulse {
    0% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.3); }
    50% { box-shadow: 0 0 15px rgba(255, 215, 0, 0.5); }
    100% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.3); }
}

.banned-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex; align-items: center; justify-content: center;
    z-index: 3;
    pointer-events: none;
}

.banned-diagonal {
    border: 4px solid #ef4444;
    border-radius: 12px;
    color: #ef4444;
    font-size: 2rem;
    font-weight: 900;
    text-transform: uppercase;
    padding: 10px 40px;
    transform: rotate(-15deg);
    background: rgba(0,0,0,0.7);
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
}

.card-main-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 60px 15px 15px 15px; /* Gradient padding */
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.6) 50%, transparent 100%);
    z-index: 4;
    pointer-events: none;
}

.name-age { font-size: 1.6rem; font-weight: 800; text-shadow: 0 2px 4px rgba(0,0,0,0.8); color: #fff; line-height: 1.2; }
.loc-text { font-size: 0.9rem; color: #ccc; margin-top: 5px; display: flex; align-items: center; gap: 6px; font-weight: 500; }

.details-content {
    padding: 16px;
    background: var(--bg-card);
    flex: 1; /* Pousse le footer vers le bas */
    font-size: 0.9rem;
}

.section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-dim);
    font-weight: 700;
    margin-bottom: 12px;
    margin-top: 8px;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 4px;
}
.section-title:first-child { margin-top: 0; }

.detail-row {
    display: flex;
    align-items: center; /* ou flex-start si la bio est longue */
    gap: 12px;
    margin-bottom: 10px;
}

.detail-icon {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 0.8rem;
    background: rgba(255,255,255,0.05);
    color: var(--text-dim);
}

.icon-phone { color: #3b82f6; background: rgba(59, 130, 246, 0.1); }
.icon-coords { color: #f97316; background: rgba(249, 115, 22, 0.1); }
.icon-job { color: #a855f7; background: rgba(168, 85, 247, 0.1); }
.icon-school { color: #eab308; background: rgba(234, 179, 8, 0.1); }
.icon-link { color: #ec4899; background: rgba(236, 72, 153, 0.1); }
.detail-val {
    color: var(--text-main);
    font-size: 0.9rem;
    word-break: break-all;
    line-height: 1.4;
}
.detail-val { font-weight: 500; word-break: break-word; line-height: 1.4; }
.detail-val.bio {
    font-style: italic;
    color: var(--text-muted);
    background: rgba(255,255,255,0.03);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 3px solid var(--primary);
}
.detail-val.link { color: var(--primary); text-decoration: none; }
.detail-val.link:hover { text-decoration: underline; }
.detail-val.coords { color: #38bdf8; font-family: monospace; background: rgba(56, 189, 248, 0.1); padding: 2px 6px; border-radius: 4px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
    background: rgba(255,255,255,0.08);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #cbd5e1;
    border: 1px solid rgba(255,255,255,0.05);
}
.card-actions {
    padding: 12px 16px;
    background: rgba(0,0,0,0.2);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.copy-token-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-muted);
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
}
.copy-token-btn:hover { background: #fff; color: #000; }

.card-actions-right { display: flex; gap: 6px; }

.icon-btn {
    width: 32px; height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.03);
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.9rem;
}
.icon-btn:hover { background: var(--bg-card-hover); color: #fff; border-color: rgba(255,255,255,0.3); }

/* =======================
   TOAST NOTIFICATIONS (FLASH EFFECT)
   ======================= */
.toast-host {
    position: fixed;
    bottom: 20px; left: 50%;
    transform: translateX(-50%);
    display: flex; flex-direction: column; gap: 10px;
    z-index: 9999999;
    pointer-events: none;
    width: max-content; max-width: 90vw;
}

@keyframes toastFlash {
    0%   { box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
    50%  { box-shadow: 0 0 25px var(--toast-color); } /* Eclat un peu moins agressif */
    100% { box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
}

.toast {
    pointer-events: auto;
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.1);
    
    /* On utilise une variable pour la couleur, appliquée à la bordure et à l'ombre */
    border-left: 4px solid var(--toast-color);
    
    border-radius: 12px;
    padding: 12px 16px;
    color: #fff;
    
    /* Ombre par défaut */
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    
    display: flex; align-items: center; gap: 12px;
    min-width: 300px;
    
    /* État initial (caché) */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
}

/* DÉFINITION DES COULEURS (Variables) */
.toast[data-type="success"] { --toast-color: #10b981; }
.toast[data-type="error"]   { --toast-color: #ef4444; }
.toast[data-type="warn"]    { --toast-color: #f59e0b; }
.toast[data-type="info"]    { --toast-color: #3b82f6; }

/* QUAND LE TOAST EST AFFICHÉ */
.toast.show {
    opacity: 1;
    transform: translateY(0);
    animation: toastFlash 2.5s ease-in-out infinite;
}

/* Contenu du toast (inchangé) */
.t-ic { font-size: 1.2rem; display: flex; align-items: center; }
.t-body { flex: 1; display: flex; flex-direction: column; }
.t-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 2px; }
.t-msg { font-size: 0.8rem; color: #94a3b8; }
.t-close { background: none; border: none; color: #666; cursor: pointer; padding: 4px; }
.t-close:hover { color: #fff; }

/* --- SEARCH BAR STYLE --- */
.search-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 15px;
    border-radius: 16px;
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-form {
    display: flex;
    gap: 10px;
    width: 100%;
}

.search-input-group {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--bg-app);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 15px;
    transition: 0.2s;
}

.search-input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.1);
}

.search-icon { color: var(--text-muted); }

.search-input {
    width: 100%;
    background: transparent;
    border: none;
    color: #fff;
    padding: 12px 10px;
    font-size: 0.95rem;
    font-family: inherit;
}

.search-select {
    background: var(--bg-app);
    color: #fff;
    border: 1px solid var(--border);
    padding: 0 15px;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    min-width: 150px;
}
.search-select:focus { border-color: var(--primary); }

.btn-search {
    background: var(--primary);
    color: #000;
    border: none;
    border-radius: 10px;
    padding: 0 20px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}
.btn-search:hover { transform: scale(1.05); }

.btn-reset {
    background: rgba(255,255,255,0.05);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 10px;
    width: 44px;
    display: grid; place-items: center;
    cursor: pointer;
    transition: 0.2s;
}
.btn-reset:hover { background: rgba(239, 68, 68, 0.2); color: #ef4444; border-color: #ef4444; }

/* --- ACTION BAR & FILTERS (CCLeaf Style) --- */

.action-bar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 40px; /* Espace par rapport à la grille des comptes */
}

.input-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-wrap label {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted); /* ou #64748b */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-left: 2px;
}

/* --- CCLEAF SELECT STYLE --- */

.input-wrap select {
    /* 1. On supprime le style natif moche du navigateur */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    /* 2. Dimensions et Fond */
    width: 100%;
    height: 44px;
    background-color: #050505; /* Fond très noir */
    border: 1px solid rgba(255, 255, 255, 0.15); /* Bordure subtile */
    border-radius: 12px;
    
    /* 3. Texte */
    color: #e2e8f0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0 40px 0 16px; /* Padding droit pour laisser place à la flèche */
    
    /* 4. La Flèche Custom (SVG encodé) */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Effet au Survol */
.input-wrap select:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background-color: #0a0a0a;
}

/* Effet au Focus (Quand on clique dessus) */
.input-wrap select:focus {
    outline: none;
    border-color: var(--primary); /* Vert néon */
    box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.1); /* Petit halo vert */
    color: #fff;
    
    /* On change la flèche en vert quand actif */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234ade80' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

/* --- STYLISATION DES OPTIONS (Limité par le navigateur) --- */
/* Cela permet d'avoir le menu déroulant sombre sur Chrome/Edge/Firefox */

.input-wrap select option {
    background-color: #111 !important; /* Fond noir pour la liste */
    color: #fff;
    padding: 12px;
    font-size: 14px;
}

/* Option désactivée ou titre */
.input-wrap select option[value=""][disabled] {
    color: #666;
    font-style: italic;
}

/* Bouton Reset */
.btn-ghost {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: #94a3b8;
    font-size: 0.8rem;
    padding: 0 20px;
    height: 42px; /* Même hauteur que les selects */
    border-radius: 10px;
    transition: 0.2s;
}

.btn-ghost:hover {
    background: rgba(239, 68, 68, 0.15); /* Rouge léger au survol */
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-classic {
    background: rgb(5 5 5);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 0 20px;
    height: 42px; /* Même hauteur que les selects */
    border-radius: 10px;
    transition: 0.2s;
}

.btn-classic:hover {
    background: rgb(255 255 255 / 15%);
    color: #4ade80;
    border-color: rgb(255 255 255 / 30%);
}

.automation-bar {
    margin-top: 15px;      /* Espace entre les filtres et cette barre */
    justify-content: space-between; /* Titre à gauche, boutons à droite */
    align-items: center;   /* Alignement vertical centré */
    padding: 15px 20px;    /* Un peu plus fin que la barre de filtres */
}

/* Titre "Sélection" */
.actions-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Badge du compteur */
.badge-count {
    background: var(--primary);
    color: #000;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.9rem;
    min-width: 24px;
    text-align: center;
}

/* Groupe de boutons à droite */
.actions-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Bouton Danger (Rouge) */
.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
    padding: 0 20px;
    height: 42px; /* Même hauteur que les autres inputs */
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-danger:active {
    transform: translateY(0);
}

/* Ajustement responsive mobile */
@media (max-width: 768px) {
    .automation-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .actions-toolbar {
        width: 100%;
        justify-content: space-between;
    }
    .btn-danger, .btn-ghost, .btn-primary {
        flex: 1;
        justify-content: center;
    }
}

/* État sélectionné */
.acc-card.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.acc-card.selected .card-header {
    /* Utilise box-shadow INSET pour simuler une outline large sans décalage */
    box-shadow: inset 0 0 0 6px var(--primary) !important;
    overflow: hidden;
}

/* Neutralisation du zoom */
.acc-card.selected .card-img, 
.acc-card.selected:hover .card-img {
    transform: none !important;
    filter: brightness(0.7); /* Assombrit pour faire ressortir le nom */
}

/* Sécurité pour forcer la visibilité du texte */
.acc-card.selected .name-age,
.acc-card.selected .loc-text {
    opacity: 1 !important;
    visibility: visible !important;
}

.name-age {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.loc-text {
    font-size: 0.85rem;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* --- CUSTOMS PAGE STYLES --- */
.customs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
    align-items: start;
}

.custom-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.custom-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.custom-title { font-size: 18px; font-weight: 800; color: #fff; }
.custom-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.custom-textarea {
    width: 100%;
    min-height: 100px;
    background: var(--bg-app);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    color: #fff;
    font-family: inherit;
    resize: vertical;
    outline: none;
}
.custom-textarea:focus { border-color: var(--primary); }

.custom-input-simple {
    width: 100%;
    padding: 12px;
    background: var(--bg-app);
    color: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;
}

.custom-list-head {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.custom-count {
    background: var(--primary);
    color: #000;
    padding: 2px 8px;
    border-radius: 6px;
}

.custom-list {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.custom-item {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px;
}

.custom-item-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.custom-item-date { font-size: 11px; color: var(--text-muted); }

.custom-item-text {
    font-size: 13px;
    line-height: 1.5;
    color: #e2e8f0;
}

.custom-mini-btn.danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: none;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
}
.custom-mini-btn.danger:hover { background: #ef4444; color: #fff; }

/* --- TASKS PAGE SPECIFICS --- */

.tasks-main-container {
    padding: 0 !important;
    overflow: hidden;
    margin-bottom: 25px;
}

.tasks-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tasks-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 400px;
}

.task-col {
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.task-col:first-child { border-right: 1px solid var(--border); }

.col-title {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.task-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 5px;
}

/* Items Task */
.task-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.task-name { font-weight: 700; font-size: 0.95rem; margin-bottom: 2px; }
.task-meta { font-size: 0.75rem; color: var(--text-muted); }

.t-btn {
    width: 32px; height: 32px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.8rem;
}

.t-btn.start { background: var(--primary); color: #000; }
.t-btn.delete { background: rgba(239, 68, 68, 0.1); color: #ef4444; margin-left: 5px;}
.t-btn.stop { background: #ef4444; color: #fff; }

/* Progress Bar */
.progress-bar {
    width: 100%; height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    margin-top: 8px;
}
.progress-fill { height: 100%; background: var(--primary); border-radius: 10px; box-shadow: 0 0 10px var(--primary); }

/* LOWER GRID */
.tasks-lower-grid {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 25px;
}

.tasks-stats-stack { display: flex; flex-direction: column; gap: 15px; }

.stat-box {
    border-radius: 16px;
    padding: 20px;
    border: 2px solid transparent;
}
.stat-box .val { font-size: 2.2rem; font-weight: 800; }
.stat-box .lab { font-weight: 700; text-transform: uppercase; font-size: 0.8rem; opacity: 0.8; }

.stat-box.alive { background: rgba(16, 185, 129, 0.1); border-color: #10b981; color: #10b981; }
.stat-box.shadow { background: rgba(245, 158, 11, 0.1); border-color: #f59e0b; color: #f59e0b; }
.stat-box.banned { background: rgba(239, 68, 68, 0.1); border-color: #ef4444; color: #ef4444; }

.mini-stats-grid { 
    display: grid; 
    /* Passage à 3 colonnes de largeur égale */
    grid-template-columns: repeat(3, 1fr); 
    gap: 15px; 
}

/* Ajustement optionnel pour que les cartes soient bien proportionnées */
.mini-card {
    background: #111817;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    position: relative;
    overflow: hidden;
    min-height: 100px; /* Optionnel : réduit un peu la hauteur si besoin */
}
.mini-card i { position: absolute; right: 10px; bottom: 10px; opacity: 1; font-size: 2rem; color: #1fa580; }

/* TERMINAL */
.terminal-container {
    background: #08080a;
    border: 1px solid var(--border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.terminal-header {
    background: #121214;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 20px;
}

.term-dots { display: flex; gap: 6px; }
.term-dots span { width: 10px; height: 10px; border-radius: 50%; }
.term-dots span:nth-child(1) { background: #ff5f56; }
.term-dots span:nth-child(2) { background: #ffbd2e; }
.term-dots span:nth-child(3) { background: #27c93f; }
.term-title { font-size: 0.75rem; color: var(--text-muted); font-family: monospace; }

.terminal-body {
    flex: 1;
    height: 350px;
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #e2e8f0;
}

.log-row { margin-bottom: 6px; line-height: 1.4; }
.log-row .time { color: #64748b; }
.log-row .sys { color: var(--primary); font-weight: bold; }
.log-row .api { color: #a855f7; }
.log-row.success { color: #4ade80; }

.btn-stop-all {
    background: #ef4444;
    color: #fff;
    border: none;
    padding: 15px;
    font-weight: 800;
    cursor: pointer;
    text-transform: uppercase;
}

/* SCROLLBARS */
.scrollable::-webkit-scrollbar { width: 5px; }
.scrollable::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }

/* --- SETTINGS PAGE STYLES --- */

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 25px;
}

.settings-card {
    padding: 30px !important;
    gap: 20px;
    min-height: auto !important;
}

.settings-section-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.settings-section-title i {
    color: var(--primary);
    font-size: 1rem;
}

/* Input Group (pour le bouton eye) */
.input-group {
    display: flex;
    gap: 10px;
}
.input-group input { flex: 1; }

.settings-card input[type="text"],
.settings-card input[type="number"],
.settings-card input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    background: #050505;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: #fff;
    font-family: inherit;
    outline: none;
}
.settings-card input:focus { border-color: var(--primary); }

/* Switch Toggle Style */
.settings-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255,255,255,0.02);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.toggle-label { font-weight: 700; font-size: 0.9rem; }
.toggle-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* Custom Switch Slider */
.switch {
    position: relative; display: inline-block;
    width: 44px; height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #333; transition: .4s; border-radius: 34px;
}
.slider:before {
    position: absolute; content: "";
    height: 18px; width: 18px; left: 3px; bottom: 3px;
    background-color: white; transition: .4s; border-radius: 50%;
}
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(20px); }

/* Danger Zone */
.danger-zone { border-color: rgba(239, 68, 68, 0.3); }
.danger-sub { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; }

.btn-danger-outline {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ef4444;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    transition: 0.2s;
}
.btn-danger-outline:hover { background: #ef4444; color: #fff; }

.danger-actions { display: flex; gap: 10px; margin-top: 10px; }

/* --- STYLES MODAL V7 --- */
.modal-wrap {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: none; /* Caché par défaut */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.modal-wrap.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-inner {
    background: #111; /* Fond très sombre */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    transform: scale(0.95);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.modal-wrap.active .modal-inner {
    transform: scale(1);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
}

.modal-tabs {
        display: flex;
        gap: 15px;
        padding: 0 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        margin-bottom: 20px;
    }

.modal-tab {
    background: transparent;
    border: none;
    color: #888;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-tab:hover {
    color: #ccc;
}

.modal-tab.active {
    background: var(--primary); /* Ta couleur verte/accent */
    color: #000; /* Texte noir sur l'accent */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* --- INPUTS DANS LE MODAL --- */
.modal-inner input[type="text"], 
.modal-inner select,
.modal-inner textarea {
    width: 100%;
    padding: 12px;
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 8px;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.modal-inner input:focus, 
.modal-inner select:focus,
.modal-inner textarea:focus {
    border-color: var(--primary);
}

.modal-inner label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    color: #666;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

/* =========================
   MODALS (Add Account + Mass Edit)
   ========================= */

.modal-overlay{
  display:none;                 /* caché par défaut */
  position:fixed;
  inset:0;
  z-index:9999;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:rgba(0,0,0,.70);
  backdrop-filter: blur(6px);
}

.modal-box{
  width:min(620px, 100%);
  max-height:85vh;
  overflow:auto;
  border-radius:16px;
  background: var(--bg-card, #0b1120);
  border:1px solid var(--border, rgba(255,255,255,.08));
  box-shadow: 0 30px 90px rgba(0,0,0,.55);
  animation: modalPop .16s ease-out;
}

@keyframes modalPop{
  from { transform: translateY(10px) scale(.98); opacity:.6; }
  to   { transform: translateY(0)   scale(1);   opacity:1;  }
}

.modal-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:16px 18px;
  border-bottom:1px solid var(--border, rgba(255,255,255,.08));
}

.modal-header h3{
  margin:0;
  font-size:1rem;
  font-weight:800;
  letter-spacing:.2px;
}

.close-modal{
  width:36px;
  height:36px;
  border-radius:10px;
  border:1px solid var(--border, rgba(255,255,255,.08));
  background: rgba(255,255,255,.06);
  color: var(--text-main, #f1f5f9);
  cursor:pointer;
  display:grid;
  place-items:center;
  transition:.15s;
}
.close-modal:hover{
  background: rgba(255,255,255,.10);
  transform: translateY(-1px);
}

.modal-body{
  padding:16px 18px;
}

.modal-footer{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  padding:14px 18px;
  border-top:1px solid var(--border, rgba(255,255,255,.08));
  background: rgba(255,255,255,.02);
}

.modal-body .input-group{
  margin-bottom:14px;
}

.modal-body .input-group label{
  display:block;
  margin-bottom:8px;
  font-size:.85rem;
  color: var(--text-dim, #94a3b8);
}

.modal-body code{
  padding:2px 6px;
  border-radius:8px;
  border:1px solid var(--border, rgba(255,255,255,.08));
  background: rgba(255,255,255,.04);
  color: var(--text-main, #f1f5f9);
}

.modal-body textarea,
.modal-body input,
.modal-body select{
  width:100%;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid var(--border, rgba(255,255,255,.08));
  background: var(--bg-item, rgba(255,255,255,.03));
  color: var(--text-main, #f1f5f9);
  outline:none;
}

.modal-body textarea{
  min-height:160px;
  resize:vertical;
}

.modal-body textarea:focus,
.modal-body input:focus,
.modal-body select:focus{
  border-color: color-mix(in srgb, var(--primary, #0ea5e9) 55%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary, #0ea5e9) 22%, transparent);
}

.badge-uid{
  position:absolute;
  top:46px;
  left:12px;
  background:rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  padding:4px 10px;
  border-radius:20px;
  font-size:0.72rem;
  font-weight:800;
  letter-spacing:0.6px;
  z-index:5;
  border:1px solid rgba(255,255,255,0.1);
  display:inline-flex;
  align-items:center;
  gap:6px;
  color:rgba(255,255,255,0.85);
}
.badge-uid i{ opacity:0.75; }