/* ========================================
   ESPACE DONATEUR - CSS MOBILE FIRST
   ======================================== */

/* Variables CSS pour la cohérence */
:root {
    --primary-color: #007bff;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --light-gray: #f8f9fa;
    --dark-gray: #6c757d;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

/* ========================================
   NAVIGATION MOBILE POUR ESPACE DONATEUR
   ======================================== */

/* Navigation pour mobile - Bouton flottant */
.espace-donateur-nav {
    position: relative;
    margin-bottom: 2rem;
}

/* Bouton flottant mobile */
.mobile-nav-fab {
    display: flex;
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(0,123,255,0.4);
    z-index: 99999 !important;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.mobile-nav-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0,123,255,0.5);
}

.mobile-nav-fab i {
    transition: transform 0.3s ease;
}

.mobile-nav-fab.active i {
    transform: rotate(45deg);
}

/* Menu déroulant mobile */
.mobile-nav-menu {
    position: fixed;
    bottom: 5rem;
    right: 2rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    z-index: 99998 !important;
    min-width: 200px;
    max-width: 280px;
    transform: scale(0.8) translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    overflow: hidden;
}

.mobile-nav-menu.active {
    transform: scale(1) translateY(0);
    opacity: 1;
    visibility: visible;
}

.mobile-nav-menu__item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: var(--dark-gray);
    font-weight: 500;
    transition: var(--transition);
    border-bottom: 1px solid var(--light-gray);
    position: relative;
}

.mobile-nav-menu__item:last-child {
    border-bottom: none;
}

.mobile-nav-menu__item:hover {
    background: var(--light-gray);
    color: var(--primary-color);
    text-decoration: none;
}

.mobile-nav-menu__item--active {
    background: var(--primary-color);
    color: white;
}

.mobile-nav-menu__item--active:hover {
    color: white;
    background: var(--primary-color);
}

.mobile-nav-menu__item i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.mobile-nav-menu__item .badge {
    margin-left: auto;
    background: var(--success-color);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    min-width: 50px;
    text-align: center;
}

/* Navigation desktop - Cachée sur mobile et tablette portrait */
.desktop-nav {
    display: none;
    flex-direction: row;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--light-gray);
    border-radius: var(--border-radius);
    flex-wrap: wrap;
    align-items: stretch;
}

.desktop-nav__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    background: white;
    border: none;
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--dark-gray);
    font-weight: 500;
    transition: var(--transition);
    box-shadow: var(--box-shadow);
    flex: 1 1 auto;
    min-width: 180px;
    max-width: 250px;
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
    justify-content: center;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.desktop-nav__item:hover,
.desktop-nav__item:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    text-decoration: none;
    color: var(--primary-color);
}

.desktop-nav__item--active {
    background: var(--primary-color);
    color: white !important;
}

.desktop-nav__item--active:hover {
    color: white !important;
}

.desktop-nav__item--active * {
    color: white !important;
}

.desktop-nav__item--active .badge {
    background: var(--success-color) !important;
    color: white !important;
}

.desktop-nav__item i {
    font-size: 1.1rem !important;
    width: 20px !important;
    height: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.desktop-nav__item .badge {
    font-size: 0.75rem !important;
    padding: 0.25rem 0.5rem !important;
    line-height: 1 !important;
    height: auto !important;
    min-height: auto !important;
}

.desktop-nav__item .badge {
    margin-left: 0.5rem;
    background: var(--success-color);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    white-space: nowrap;
    flex-shrink: 0;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
}

/* Gestion adaptative pour très petits écrans desktop */
@media (min-width: 768px) and (max-width: 991px) {
    .desktop-nav {
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .desktop-nav__item {
        min-width: 140px;
        max-width: 200px;
        font-size: 0.9rem;
        height: 52px !important;
        min-height: 52px !important;
        max-height: 52px !important;
    }
    
    .desktop-nav__item .badge {
        font-size: 0.7rem;
        max-width: 60px;
        padding: 0.2rem 0.4rem;
    }
    
    .desktop-nav__item i {
        font-size: 0.9rem;
    }
    
    .desktop-nav__item--active,
    .desktop-nav__item--active:hover {
        color: white !important;
    }
    
    .desktop-nav__item--active * {
        color: white !important;
    }
}

/* ========================================
   SECTIONS DE CONTENU
   ======================================== */

.espace-donateur-section {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.espace-donateur-section__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--primary-color);
    border-bottom: 2px solid var(--light-gray);
    padding-bottom: 0.4rem;
    line-height: 1.3;
}

.espace-donateur-section__title i {
    color: var(--primary-color);
}

/* ========================================
   CARDS POUR REMPLACER LES TABLEAUX
   ======================================== */

.promesse-card,
.paiement-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    margin-bottom: 0.75rem;
    overflow: hidden;
    transition: var(--transition);
}

.promesse-card:hover,
.paiement-card:hover {
    box-shadow: var(--box-shadow);
    transform: translateY(-1px);
}

.promesse-card__header,
.paiement-card__header {
    background: var(--light-gray);
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dee2e6;
}

.promesse-card__title,
.paiement-card__title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: var(--primary-color);
    line-height: 1.3;
}

.promesse-card__checkbox {
    transform: scale(1.2);
}

.promesse-card__body,
.paiement-card__body {
    padding: 0.75rem 1rem 1rem;
}

.promesse-card__info,
.paiement-card__info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.promesse-card__info-item,
.paiement-card__info-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.promesse-card__info-label,
.paiement-card__info-label {
    font-size: 0.8rem;
    color: var(--dark-gray);
    font-weight: 500;
    line-height: 1.2;
}

.promesse-card__info-value,
.paiement-card__info-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.promesse-card__actions,
.paiement-card__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--light-gray);
}

/* ========================================
   BOUTONS OPTIMISÉS MOBILE
   ======================================== */

.btn-mobile {
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px; /* Taille minimum recommandée pour touch */
}

.btn-mobile--primary {
    background: var(--primary-color);
    color: white;
}

.btn-mobile--primary:hover {
    background: #0056b3;
    color: white;
    text-decoration: none;
}

.btn-mobile--success {
    background: var(--success-color);
    color: white;
}

.btn-mobile--success:hover {
    background: #1e7e34;
    color: white;
    text-decoration: none;
}

.btn-mobile--outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-mobile--outline:hover {
    background: var(--primary-color);
    color: white;
    text-decoration: none;
}

.btn-mobile--full {
    width: 100%;
    justify-content: center;
}

/* ========================================
   MODAL RESPONSIVE
   ======================================== */

.modal-mobile {
    z-index: 100000 !important;
}

.modal-mobile .modal-dialog {
    margin: 0;
    max-width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.modal-mobile .modal-content {
    height: 100%;
    border-radius: 0;
    border: none;
}

.modal-mobile .modal-header {
    border-bottom: 1px solid var(--light-gray);
    padding: 1rem;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

.modal-mobile .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.modal-mobile .modal-footer {
    border-top: 1px solid var(--light-gray);
    padding: 1rem;
    position: sticky;
    bottom: 0;
    background: white;
    z-index: 1;
}

/* Formulaire dans la modal */
.modal-mobile .form-group {
    margin-bottom: 1rem;
}

.modal-mobile .form-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
    color: #333;
}

.modal-mobile .form-control {
    border-radius: var(--border-radius);
    border: 1px solid #ced4da;
    padding: 0.75rem;
    font-size: 1rem;
    min-height: 44px;
}

.modal-mobile .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

/* ========================================
   STRIPE ELEMENT RESPONSIVE
   ======================================== */

#stripe {
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: var(--border-radius);
    background: white;
    min-height: 44px;
    display: flex;
    align-items: center;
}

#stripe:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

#card-errors {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* ========================================
   ÉTATS VIDES
   ======================================== */

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--dark-gray);
}

.empty-state img {
    max-width: 150px;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.empty-state p {
    margin: 0;
    font-size: 1rem;
}

/* ========================================
   SPINNER ET LOADING
   ======================================== */

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
}

.spinner-border {
    width: 1.5rem;
    height: 1.5rem;
    border-width: 2px;
}

/* ========================================
   BADGES ET INDICATEURS
   ======================================== */

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge--paid {
    background: #d4edda;
    color: #155724;
}

.status-badge--pending {
    background: #fff3cd;
    color: #856404;
}

.status-badge--partial {
    background: #cce7ff;
    color: #004085;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* Tablette paysage et desktop uniquement */
@media (min-width: 1024px), (min-width: 768px) and (orientation: landscape) {
    /* Masquer le bouton flottant sur desktop */
    .mobile-nav-fab,
    .mobile-nav-menu {
        display: none;
    }
    
    /* Afficher la navigation desktop */
    .desktop-nav {
        display: flex;
    }
    
    .promesse-card__info,
    .paiement-card__info {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .modal-mobile .modal-dialog {
        margin: 1rem auto;
        max-width: 90%;
        height: auto;
        max-height: calc(100vh - 2rem);
    }
    
    .modal-mobile .modal-content {
        height: auto;
        border-radius: var(--border-radius);
        border: 1px solid #dee2e6;
    }
}

/* Desktop - 992px and up */
@media (min-width: 992px) {
    .desktop-nav__item {
        min-width: 170px;
        max-width: 240px;
        height: 52px !important;
        min-height: 52px !important;
        max-height: 52px !important;
    }
    
    .promesse-card__info,
    .paiement-card__info {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 1rem;
    }
    
    .modal-mobile .modal-dialog {
        max-width: 800px;
    }
    
    .btn-mobile--full {
        width: auto;
    }
}

/* Large Desktop - 1200px and up */
@media (min-width: 1200px) {
    .desktop-nav {
        gap: 1rem;
    }
    
    .desktop-nav__item {
        min-width: 200px;
        max-width: 280px;
        height: 52px !important;
        min-height: 52px !important;
        max-height: 52px !important;
    }
    
    .desktop-nav__item .badge {
        max-width: 100px;
        font-size: 0.8rem;
    }
}

/* Extra Large Desktop - 1400px and up */
@media (min-width: 1400px) {
    .desktop-nav__item {
        min-width: 220px;
        max-width: 300px;
        height: 52px !important;
        min-height: 52px !important;
        max-height: 52px !important;
    }
    
    .desktop-nav__item .badge {
        max-width: 120px;
    }
}

/* Ajustements supplémentaires pour les grandes tailles */
@media (min-width: 1200px) {
    .espace-donateur-section {
        padding: 2rem;
    }
    
    .promesse-card,
    .paiement-card {
        margin-bottom: 1.5rem;
    }
    
    .promesse-card__info,
    .paiement-card__info {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.25rem;
    }
}

/* ========================================
   PAGE D'ACCUEIL - DASHBOARD
   ======================================== */

.welcome-header {
    text-align: center;
    margin-bottom: 2rem;
}

.welcome-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.welcome-subtitle {
    color: var(--dark-gray);
    margin: 0;
    font-size: 1rem;
}

/* Cards de résumé */
.summary-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
    height: 100%;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.summary-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 20px 20px;
    border-color: transparent transparent var(--primary-color) transparent;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.summary-card:hover::after {
    opacity: 1;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    text-decoration: none;
    color: inherit;
}

.summary-card:hover .summary-card__title {
    color: var(--primary-color);
}

.summary-card:hover .summary-card__amount {
    color: var(--primary-color);
    transform: scale(1.05);
}

.summary-card__icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}

.summary-card--promesses .summary-card__icon {
    background: var(--warning-color);
}

.summary-card--dons .summary-card__icon {
    background: var(--success-color);
}

.summary-card__content {
    flex: 1;
}

.summary-card__title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.summary-card__amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.summary-card__count {
    font-size: 0.875rem;
    color: var(--dark-gray);
    margin: 0;
}

/* Suppression de la section action avec flèche */

.btn-nav-quick {
    cursor: pointer;
}

/* Styles spécifiques pour les boutons circulaires (non utilisés pour les cartes) */
.btn-nav-quick:not(.summary-card) {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--light-gray);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: var(--transition);
    border: none;
}

.btn-nav-quick:not(.summary-card):hover {
    background: var(--primary-color);
    color: white;
    text-decoration: none;
}

.btn-nav-quick.btn-mobile {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
}

/* Actions rapides */
.quick-actions {
    margin: 2rem 0;
}

.quick-actions__title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
}

/* Informations de contact */
.contact-info {
    background: var(--light-gray);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-top: 2rem;
}

.contact-info__title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
}

.contact-info__items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contact-info__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.contact-info__item i {
    width: 20px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.contact-info__item a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.contact-info__item a:hover {
    text-decoration: underline;
}

/* Informations personnelles spécifiques */
.personal-info-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
}

.personal-info-card .promesse-card__info {
    margin-bottom: 0;
}

/* Responsive pour la page d'accueil */
@media (min-width: 768px) {
    .welcome-header {
        text-align: left;
    }
    
    .contact-info__items {
        flex-direction: row;
        gap: 2rem;
    }
}

/* ========================================
   UTILITAIRES
   ======================================== */

.text-mobile-center {
    text-align: center;
}

@media (min-width: 768px) {
    .text-mobile-center {
        text-align: left;
    }
}

.mb-mobile {
    margin-bottom: 1rem;
}

.mt-mobile {
    margin-top: 1rem;
}

.hidden {
    display: none;
}

/* Amélioration de l'accessibilité */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus states améliorés */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus,
.btn-mobile:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Z-index pour éléments déplacés par JavaScript */
body > .mobile-nav-fab {
    z-index: 10000 !important;
    position: fixed !important;
}

body > .mobile-nav-menu {
    z-index: 9999 !important;
    position: fixed !important;
}

.modal-mobile {
    z-index: 10001 !important;
}