/* Helpin - Style plateforme utilisateur (aligné app mobile) */
:root {
    --helpin-primary: #3A8DFF;
    --helpin-primary-rgb: 58, 141, 255;
    --helpin-dark: #2C2C2C;
    --helpin-success: #27AE60;
    --helpin-danger: #E74C3C;
}

/* Bouton Payer / Accepter — vue mission */
.helpin-btn-payer {
    background: linear-gradient(135deg, var(--helpin-primary) 0%, #5ba3ff 100%);
    box-shadow: 0 2px 8px rgba(var(--helpin-primary-rgb), 0.35);
}
.helpin-btn-payer:hover {
    box-shadow: 0 4px 12px rgba(var(--helpin-primary-rgb), 0.4);
}
.dark .helpin-btn-payer {
    background: linear-gradient(135deg, var(--helpin-primary) 0%, #4a9aff 100%);
    box-shadow: 0 2px 8px rgba(var(--helpin-primary-rgb), 0.3);
}

/* Modal Stripe — design professionnel */
.helpin-stripe-modal {
    animation: helpin-modal-in 0.25s ease-out;
}
@keyframes helpin-modal-in {
    from { opacity: 0; transform: scale(0.96) translateY(-8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Page Accueil (alignée app mobile) */
.helpin-accueil {
    max-width: 56rem;
}
.helpin-accueil-mobile {
    min-height: 60vh;
}
.helpin-suggestion-card:hover {
    background: rgba(var(--helpin-primary-rgb), 0.06) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.dark .helpin-suggestion-card:hover {
    background: rgba(var(--helpin-primary-rgb), 0.12) !important;
}
.helpin-banner-mobile {
    border: 1px solid rgba(var(--helpin-primary-rgb), 0.2);
}

/* Zone publicité vide bien visible */
.helpin-pub-placeholder {
    background: rgba(255, 255, 255, 0.9);
}
.dark .helpin-pub-placeholder {
    background: rgba(30, 41, 59, 0.5);
}

/* Header gradient comme app mobile */
.helpin-header {
    background: linear-gradient(160deg, var(--helpin-primary) 0%, #5ba3ff 50%, #7eb8ff 100%);
    box-shadow: 0 8px 24px rgba(var(--helpin-primary-rgb), 0.3);
}

/* Barre de recherche (dans le header) */
.helpin-search {
    transition: transform 0.2s, box-shadow 0.2s;
}
.helpin-search:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Cartes catégories : plus grandes, icône dans un bloc dédié */
.helpin-category-icon {
    min-height: 3.5rem;
    min-width: 3.5rem;
}
.helpin-category-icon img {
    display: block;
}
.helpin-category-icon .hidden {
    display: none;
}
.helpin-category-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
}
.helpin-category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(var(--helpin-primary-rgb), 0.18);
    border-color: rgba(var(--helpin-primary-rgb), 0.4);
}

/* Cartes sous-catégories / services */
.helpin-subcard:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

/* Pastille service (Demande de service) */
.helpin-pill {
    border: 1px solid rgba(var(--helpin-primary-rgb), 0.3);
}

/* Masquer scrollbar sur défilement horizontal */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Barre du haut bleue Helpin (panel app uniquement) */
.fi-topbar nav {
    background: linear-gradient(135deg, var(--helpin-primary) 0%, #5ba3ff 100%) !important;
    box-shadow: 0 2px 8px rgba(var(--helpin-primary-rgb), 0.25);
}
.fi-topbar nav a,
.fi-topbar nav button,
.fi-topbar nav [class*="text-gray"] {
    color: rgba(255, 255, 255, 0.95) !important;
}
.fi-topbar nav svg {
    color: rgba(255, 255, 255, 0.95);
}
.fi-topbar .fi-topbar-open-sidebar-btn,
.fi-topbar .fi-topbar-close-sidebar-btn {
    color: white !important;
}

/* Sidebar & header bleu Helpin */
.fi-sidebar,
.filament-sidebar {
    --tw-border-opacity: 0.1;
}
.fi-sidebar-nav-groups .fi-sidebar-item-button.active {
    background: rgba(var(--helpin-primary-rgb), 0.15);
    color: var(--helpin-primary);
}
.fi-sidebar-item-button:hover {
    background: rgba(var(--helpin-primary-rgb), 0.08);
}
.fi-sidebar-header {
    border-color: rgba(var(--helpin-primary-rgb), 0.2);
}
.fi-topbar {
    border-color: rgba(0, 0, 0, 0.05);
}
.fi-btn-primary,
.fi-btn-primary:hover {
    background: var(--helpin-primary);
    border-color: var(--helpin-primary);
}
.fi-link {
    color: var(--helpin-primary);
}
.fi-link:hover {
    color: #2a7ae6;
}
.fi-ta-row:hover {
    background: rgba(var(--helpin-primary-rgb), 0.04);
}
.fi-section-header-heading {
    color: var(--helpin-dark);
}
.fi-badge-success { --tw-bg-opacity: 1; background: rgba(39, 174, 96, 0.2); color: var(--helpin-success); }
.fi-badge-danger { --tw-bg-opacity: 1; background: rgba(231, 76, 60, 0.2); color: var(--helpin-danger); }
.fi-badge-warning { --tw-bg-opacity: 1; background: rgba(243, 156, 18, 0.2); color: #f39c12; }

/* ── Barre de recherche dans le topbar ───────────────────────────── */
.hp-topbar-search {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 22px;
    padding: 5px 14px 5px 10px;
    color: rgba(255,255,255,0.95);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s, border-color .15s;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    cursor: pointer;
}
.hp-topbar-search:hover {
    background: rgba(255,255,255,0.28);
    border-color: rgba(255,255,255,0.4);
    color: #fff;
}
.hp-topbar-search svg {
    flex-shrink: 0;
    color: rgba(255,255,255,0.85);
}
.hp-topbar-search span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Masquer "About Filament" du menu utilisateur ─────────────────── */
.fi-user-menu .fi-dropdown-footer,
a[href*="filamentphp.com"] {
    display: none !important;
}

/* ── Cloche de notification dans la topbar ────────────────────────── */
.helpin-notif-bell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 2.25rem;
    width: 2.25rem;
    border-radius: 9999px;
    color: rgba(255,255,255,0.9);
    transition: background 0.15s;
}
.helpin-notif-bell:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}
/* ── Bouton Devenir Helper + menu (téléchargements en bas du menu) ───── */
.helpin-topbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.helpin-topbar-dropdown-section {
    padding: 8px 16px 4px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.dark .helpin-topbar-dropdown-section { border-bottom-color: rgba(255,255,255,0.08); }
.helpin-topbar-dropdown-title {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.dark .helpin-topbar-dropdown-title { color: #94a3b8; }
.helpin-topbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    padding: 5px 12px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
    cursor: pointer;
}
.helpin-topbar-btn:hover {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}
.helpin-topbar-btn-icon {
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
}
.helpin-topbar-btn-label {
    overflow: hidden;
    text-overflow: ellipsis;
}
.helpin-topbar-btn-chevron {
    width: 0.9rem;
    height: 0.9rem;
    margin-left: 2px;
    opacity: 0.9;
}
.helpin-topbar-dropdown-wrap {
    position: relative;
}
.helpin-topbar-dropdown-panel {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    min-width: 220px;
    background: #fff !important;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.18);
    border: 1px solid rgba(0,0,0,0.1);
    padding: 6px 0;
    z-index: 9999;
    pointer-events: auto;
}
.dark .helpin-topbar-dropdown-panel {
    background: #1e293b !important;
    border-color: rgba(255,255,255,0.12);
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}
.helpin-topbar-dropdown-panel .helpin-topbar-dropdown-item {
    display: block;
    padding: 12px 16px;
    color: #0f172a !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    pointer-events: auto;
}
.helpin-topbar-dropdown-panel .helpin-topbar-dropdown-item:hover {
    background: rgba(58, 141, 255, 0.12) !important;
    color: var(--helpin-primary) !important;
}
.dark .helpin-topbar-dropdown-panel .helpin-topbar-dropdown-item {
    color: #f1f5f9 !important;
}
.dark .helpin-topbar-dropdown-panel .helpin-topbar-dropdown-item:hover {
    background: rgba(58, 141, 255, 0.2) !important;
    color: #93c5fd !important;
}
.helpin-topbar-dropdown-item-disabled {
    color: #64748b !important;
    cursor: not-allowed;
    font-weight: 500;
}
.helpin-topbar-dropdown-item-disabled:hover {
    background: rgba(0,0,0,0.03) !important;
    color: #64748b !important;
}
.dark .helpin-topbar-dropdown-item-disabled {
    color: #94a3b8 !important;
}
.dark .helpin-topbar-dropdown-item-disabled:hover {
    background: rgba(255,255,255,0.05) !important;
    color: #94a3b8 !important;
}
[x-cloak] { display: none !important; }

@media (max-width: 1023px) {
    .helpin-topbar-btn-label { display: none; }
    .helpin-topbar-btn { padding: 6px 10px; }
    .helpin-topbar-btn-chevron { margin-left: 0; }
}

.helpin-notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 1rem;
    height: 1rem;
    padding: 0 3px;
    border-radius: 9999px;
    background: #ef4444;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    border: 1.5px solid transparent;
}

/* ── Avatar utilisateur dans la topbar bleue ───────────────────────── */
.fi-topbar .fi-user-menu .fi-user-avatar,
.fi-topbar .fi-user-menu img.fi-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.2);
}
.fi-topbar .fi-user-menu button:focus .fi-user-avatar,
.fi-topbar .fi-user-menu button:hover img.fi-avatar {
    border-color: rgba(255, 255, 255, 0.9);
}

/* ── Menu utilisateur (dropdown) — lisibilité en mode clair ─────────── */
html:not(.dark) .fi-dropdown-panel:has(.fi-theme-switcher) .fi-dropdown-list-item,
html:not(.dark) .fi-dropdown-panel:has(.fi-theme-switcher) .fi-dropdown-list-item .fi-dropdown-list-item-label,
html:not(.dark) .fi-dropdown-panel:has(.fi-theme-switcher) .fi-dropdown-header,
html:not(.dark) .fi-dropdown-panel:has(.fi-theme-switcher) .fi-dropdown-header-label {
    color: #1f2937 !important;
}
html:not(.dark) .fi-dropdown-panel:has(.fi-theme-switcher) .fi-dropdown-list-item svg,
html:not(.dark) .fi-dropdown-panel:has(.fi-theme-switcher) .fi-dropdown-header svg,
html:not(.dark) .fi-dropdown-panel:has(.fi-theme-switcher) .fi-dropdown-header-icon {
    color: #4b5563 !important;
}
html:not(.dark) .fi-dropdown-panel:has(.fi-theme-switcher) .fi-theme-switcher-btn {
    color: #374151 !important;
}
html:not(.dark) .fi-dropdown-panel:has(.fi-theme-switcher) .fi-theme-switcher-btn svg {
    color: #4b5563 !important;
}
html:not(.dark) .fi-dropdown-panel:has(.fi-theme-switcher) .fi-theme-switcher-btn.fi-active,
html:not(.dark) .fi-dropdown-panel:has(.fi-theme-switcher) .fi-theme-switcher-btn.fi-active svg {
    color: var(--helpin-primary) !important;
}

/* Texte "Déconnexion" visible */
html:not(.dark) .fi-dropdown-panel:has(.fi-theme-switcher) .fi-dropdown-list-item form .fi-dropdown-list-item-label,
html:not(.dark) .fi-dropdown-panel:has(.fi-theme-switcher) .fi-dropdown-list-item form button span {
    color: #1f2937 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Bouton Envoyer du chat — toujours bleu et visible (priorité sur Filament) */
.helpin-chat-btn-envoyer,
button.helpin-chat-btn-envoyer {
    background: #2563eb !important;
    background-color: #2563eb !important;
    color: #ffffff !important;
    border: 1px solid #1d4ed8 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) !important;
}
.helpin-chat-btn-envoyer:hover,
button.helpin-chat-btn-envoyer:hover {
    background: #1d4ed8 !important;
    background-color: #1d4ed8 !important;
    color: #ffffff !important;
}
.helpin-chat-btn-envoyer svg,
button.helpin-chat-btn-envoyer svg {
    color: #ffffff !important;
    fill: none !important;
    stroke: currentColor !important;
}

/* Bulles chat : vos messages en bleu, prestataire en couleur (pas tout gris) */
.helpin-chat-bubble-moi {
    background: #2563eb !important;
    color: #ffffff !important;
    border: 1px solid #1d4ed8 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}
.helpin-chat-bubble-moi p {
    color: #ffffff !important;
}
.helpin-chat-bubble-moi .opacity-80 {
    color: rgba(255, 255, 255, 0.9) !important;
}

.helpin-chat-bubble-prestataire {
    background: #f0f9ff !important;
    color: #1e293b !important;
    border: 1px solid #bae6fd !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}
.dark .helpin-chat-bubble-prestataire {
    background: #1e3a5f !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}
.helpin-chat-bubble-prestataire p {
    color: inherit !important;
}
