/**
 * Ze User Manager - Frontend Styles
 */

/* Bloc HTML utilisateur */
.user-bloc-html {
    margin: 1.5em 0;
    line-height: 1.6;
}

.user-bloc-html * {
    max-width: 100%;
}

.user-bloc-html img {
    height: auto;
    display: block;
    margin: 1em 0;
}

.user-bloc-html h1,
.user-bloc-html h2,
.user-bloc-html h3,
.user-bloc-html h4,
.user-bloc-html h5,
.user-bloc-html h6 {
    margin: 1.2em 0 0.6em 0;
    font-weight: bold;
}

.user-bloc-html h1 { font-size: 2em; }
.user-bloc-html h2 { font-size: 1.75em; }
.user-bloc-html h3 { font-size: 1.5em; }
.user-bloc-html h4 { font-size: 1.25em; }

.user-bloc-html p {
    margin: 0.8em 0;
}

.user-bloc-html ul,
.user-bloc-html ol {
    margin: 1em 0 1em 1.5em;
    padding: 0;
}

.user-bloc-html li {
    margin: 0.4em 0;
}

.user-bloc-html a {
    color: #0073aa;
    text-decoration: underline;
}

.user-bloc-html a:hover {
    color: #005177;
}

.user-bloc-html table {
    border-collapse: collapse;
    width: 100%;
    margin: 1em 0;
}

.user-bloc-html th,
.user-bloc-html td {
    padding: 0.75em;
    border: 1px solid #ddd;
    text-align: left;
}

.user-bloc-html th {
    background-color: #f5f5f5;
    font-weight: bold;
}

/* Message de condition refusée */
.ze-condition-denied {
    padding: 1em 0;
    text-align: center;
    color: #000000;
}

/* Sélecteur de club POI - Dropdown personnalisé */
.ze-club-dropdown {
    position: relative;
    display: inline-block;
}

.ze-club-dropdown-toggle,
.ze-club-dropdown-toggle:hover,
.ze-club-dropdown-toggle:focus,
.ze-club-dropdown-toggle:active,
.ze-club-dropdown-toggle:visited {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    cursor: pointer;
    text-align: left;
    min-width: 200px;
}


.ze-club-dropdown-current {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ze-club-dropdown-name {
    font-size: 12px;
    font-weight: 600;
    color: #000;
    line-height: 1.3;
}

.ze-club-dropdown-address {
    font-size: 10px;
    color: #000;
    line-height: 1.3;
}

.ze-club-dropdown-arrow {
    font-size: 10px;
    color: #9ca3af;
    transition: transform 0.2s;
}

.ze-club-dropdown.open .ze-club-dropdown-arrow {
    transform: rotate(180deg);
}

.ze-club-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    display: none;
    max-height: 250px;
    overflow-y: auto;
}

.ze-club-dropdown.open .ze-club-dropdown-menu {
    display: block;
}

.ze-club-option-form {
    margin: 0;
    padding: 0;
}

.ze-club-dropdown-option {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    padding: 10px 12px;
    background: none;
    border: none;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.15s;
}


.ze-club-option-form:last-child .ze-club-dropdown-option {
    border-bottom: none;
}

/* Legacy - Ancien sélecteur (fallback) */
.ze-club-selector-form {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.ze-club-selector-form label {
    font-weight: 500;
    white-space: nowrap;
}

.ze-club-selector-form select {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    min-width: 250px;
    cursor: pointer;
}

.ze-club-info {
    padding: 0.5rem 0;
}

.ze-club-address {
    color: #64748b;
    font-size: 0.9em;
}

/* Carte club */
.ze-club-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.ze-club-card-name {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    color: #111827;
}

.ze-club-card p {
    margin: 0.5rem 0;
    color: #4b5563;
}

.ze-club-card a {
    color: #2563eb;
    text-decoration: none;
}

.ze-club-card a:hover {
    text-decoration: underline;
}

.ze-club-map-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #f0f9ff;
    border-radius: 6px;
    margin-top: 0.5rem;
}

.ze-no-club {
    color: #64748b;
    font-style: italic;
}

/* Mode sombre */
@media (prefers-color-scheme: dark) {
    .user-bloc-html a {
        color: #4a9eff;
    }

    .user-bloc-html a:hover {
        color: #6db3ff;
    }

    .user-bloc-html th,
    .user-bloc-html td {
        border-color: #444;
    }

    .user-bloc-html th {
        background-color: #2a2a2a;
    }

    .ze-condition-denied {
        color: #ffffff;
    }

    .ze-club-card {
        background: #1f2937;
        border-color: #374151;
    }

    .ze-club-card-name {
        color: #f9fafb;
    }

    .ze-club-card p {
        color: #d1d5db;
    }

    .ze-club-map-link {
        background: #1e3a5f;
    }

    /* Dropdown club - Dark mode */
    .ze-club-dropdown-name,
    .ze-club-dropdown-address {
        color: #000;
    }

    .ze-club-dropdown-menu {
        background: #1f2937;
        border-color: #374151;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    }

    .ze-club-dropdown-menu .ze-club-dropdown-name,
    .ze-club-dropdown-menu .ze-club-dropdown-address {
        color: #f9fafb;
    }

    .ze-club-dropdown-option {
        border-bottom-color: #374151;
    }
}

/* ============================================
   FACTURES - [ze_invoices]
   Design compact et professionnel
   ============================================ */

.ze-invoices {
    margin: 1.5em 0;
}

.ze-invoices__title {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    letter-spacing: -0.01em;
}

.ze-invoices__empty,
.ze-invoices-login-required {
    color: #6b7280;
    font-size: 0.9rem;
    padding: 1rem 1.25rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    text-align: center;
}

/* Liste des factures */
.ze-invoices__list {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

/* Ligne de facture */
.ze-invoices__row {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.15s ease;
}

.ze-invoices__row:last-child {
    border-bottom: none;
}

.ze-invoices__row:hover {
    background-color: #f9fafb;
}

/* Cellules */
.ze-invoices__cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ze-invoices__cell--ref {
    flex: 2;
    min-width: 0;
}

.ze-invoices__cell--date {
    flex: 1;
    min-width: 90px;
}

.ze-invoices__cell--ht,
.ze-invoices__cell--ttc {
    flex: 1;
    min-width: 100px;
    text-align: right;
    align-items: flex-end;
}

.ze-invoices__cell--action {
    flex: 0 0 70px;
    min-width: 70px;
    margin-left: 1rem;
    text-align: center;
}

/* Labels (masqués sur desktop, visibles sur mobile) */
.ze-invoices__label {
    display: none;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
}

/* Valeurs */
.ze-invoices__value {
    font-size: 0.875rem;
    color: #4b5563;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ze-invoices__value--ref {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.9rem;
}

.ze-invoices__value--ttc {
    font-weight: 700;
    color: #059669;
    font-size: 0.9rem;
}

/* Bouton téléchargement */
.ze-invoices__btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.4rem 0.75rem;
    background: #7A3EFF;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.ze-invoices__btn:hover {
    background: #6D28D9;
    transform: translateY(-1px);
    color: #fff !important;
}

.ze-invoices__btn svg {
    flex-shrink: 0;
}

.ze-invoices__no-file {
    color: #d1d5db;
    font-size: 0.875rem;
}

/* En-tête des colonnes */
.ze-invoices__header {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

.ze-invoices__header .ze-invoices__cell--ht,
.ze-invoices__header .ze-invoices__cell--ttc {
    text-align: right;
    justify-content: flex-end;
}

.ze-invoices__heading {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== MODE SOMBRE ===== */
@media (prefers-color-scheme: dark) {
    .ze-invoices__title {
        color: #f3f4f6;
    }

    .ze-invoices__empty,
    .ze-invoices-login-required {
        background: #1f2937;
        border-color: #374151;
        color: #9ca3af;
    }

    .ze-invoices__list {
        background: #111827;
        border-color: #374151;
    }

    .ze-invoices__row {
        border-bottom-color: #1f2937;
    }

    .ze-invoices__row:hover {
        background-color: #1f2937;
    }

    .ze-invoices__label {
        color: #6b7280;
    }

    .ze-invoices__value {
        color: #d1d5db;
    }

    .ze-invoices__value--ref {
        color: #f3f4f6;
    }

    .ze-invoices__value--ttc {
        color: #34d399;
    }

    .ze-invoices__btn {
        background: #8B5CF6;
    }

    .ze-invoices__btn:hover {
        background: #7C3AED;
    }

    .ze-invoices__no-file {
        color: #4b5563;
    }

    .ze-invoices__header {
        background: #1f2937;
        border-bottom-color: #374151;
    }

    .ze-invoices__heading {
        color: #9ca3af;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .user-bloc-html {
        font-size: 0.95em;
    }

    .ze-club-selector-form {
        flex-direction: column;
        align-items: flex-start;
    }

    .ze-club-selector-form select {
        min-width: 100%;
    }

    /* Factures - Mobile : passage en mode carte */
    .ze-invoices__header {
        display: none;
    }

    .ze-invoices__row {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 1rem;
    }

    .ze-invoices__cell {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
    }

    .ze-invoices__cell--ref {
        flex: 0 0 100%;
        order: 1;
        padding-bottom: 0.5rem;
        margin-bottom: 0.25rem;
        border-bottom: 1px solid #f3f4f6;
    }

    .ze-invoices__cell--date {
        flex: 1 1 auto;
        order: 2;
    }

    .ze-invoices__cell--ht {
        flex: 0 0 auto;
        order: 3;
        text-align: left;
        align-items: flex-start;
    }

    .ze-invoices__cell--ttc {
        flex: 0 0 auto;
        order: 4;
        text-align: left;
        align-items: flex-start;
    }

    .ze-invoices__cell--action {
        flex: 0 0 100%;
        order: 5;
        margin-left: 0;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid #f3f4f6;
    }

    /* Afficher les labels sur mobile */
    .ze-invoices__label {
        display: block;
    }

    .ze-invoices__btn {
        width: 100%;
        justify-content: center;
        padding: 0.6rem 1rem;
    }
}

/* Dark mode - Mobile */
@media (max-width: 768px) and (prefers-color-scheme: dark) {
    .ze-invoices__cell--ref {
        border-bottom-color: #374151;
    }

    .ze-invoices__cell--action {
        border-top-color: #374151;
    }
}
