/* ===========================
   RESET & VARIABLES MODERNES
   =========================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Couleurs modernes avec gradients */
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    
    --success: #10b981;
    --success-light: #34d399;
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    
    --danger: #ef4444;
    --danger-light: #f87171;
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    
    --warning: #f59e0b;
    --warning-light: #fbbf24;
    
    /* Mode sombre par défaut */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --border: #334155;
    
    /* Ombres et effets */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Animations */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Espacement */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
}

/* Mode clair */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border: #e2e8f0;
}

/* ===========================
   BASE STYLES
   =========================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: all var(--transition-base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===========================
   HEADER MODERNE
   =========================== */
.header {
    background: var(--primary-gradient);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-buttons {
    display: flex;
    gap: 0.75rem;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width var(--transition-base), height var(--transition-base);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-icon:hover::before {
    width: 100px;
    height: 100px;
}

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

/* ===========================
   TABS MODERNES
   =========================== */
.tabs {
    background-color: var(--bg-secondary);
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: var(--shadow);
    scrollbar-width: thin;
    -ms-overflow-style: none;
    padding: 0.25rem;
    gap: 0.25rem;
    border-bottom: 1px solid var(--border);
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling sur iOS */
    position: relative;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    border-radius: var(--radius);
    transition: all var(--transition-fast);
    font-size: 1rem; /* Augmenté pour une meilleure lisibilité */
    font-weight: 600;
    position: relative;
    overflow: hidden;
    flex-shrink: 0; /* Empêche les tabs de se rétrécir */
    min-width: fit-content; /* Assure une largeur minimale */
}

.tab::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary-gradient);
    transform: translateY(100%);
    transition: transform var(--transition-fast);
}

.tab.active {
    color: #ff0000;
    background: rgba(59, 130, 246, 0.1);
}

.tab.active::before {
    transform: translateY(0);
}

.tab:hover:not(.active) {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.add-tab {
    padding: 0.75rem 1rem;
    border: 2px dashed var(--border);
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    font-size: 1.25rem;
    font-weight: bold;
    border-radius: var(--radius);
    transition: all var(--transition-fast);
    min-width: 44px;
    flex-shrink: 0; /* Empêche le bouton + de se rétrécir */
}

.add-tab:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

/* ===========================
   CONTENU PRINCIPAL
   =========================== */
.content {
    flex: 1;
    padding: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.tab-content {
    display: none;
    animation: fadeIn var(--transition-base);
}

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

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

/* ===========================
   CARTES UTILISATEURS MODERNES
   =========================== */
.dashboard {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.user-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
}

.user-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.user-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.user-card:hover::before {
    transform: scaleX(1);
}

.user-card h3 {
    font-size: 1.375rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stats {
    display: grid;
    gap: 1.25rem;
}

.stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1.25rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.stat:hover {
    background: var(--bg-primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.stat-value.income {
    color: var(--success);
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

.stat-value.expense {
    color: var(--danger);
    text-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

.stat-value.balance {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===========================
   SECTIONS MODERNES
   =========================== */
.section {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: all var(--transition-base);
}

.section:hover {
    box-shadow: var(--shadow-lg);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

/* ===========================
   BOUTONS MODERNES
   =========================== */
.btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width var(--transition-base), height var(--transition-base);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

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

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.btn-danger {
    background: var(--danger-gradient);
}

/* ===========================
   FAB MODERNE
   =========================== */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    box-shadow: var(--shadow-xl);
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.fab:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
}

.fab svg {
    transition: transform var(--transition-base);
}

/* Menu FAB moderne */
.fab-menu {
    position: fixed;
    bottom: 7rem;
    right: 2rem;
    display: flex;
    flex-direction: column-reverse;
    gap: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-base);
}

.fab-menu.active {
    opacity: 1;
    pointer-events: all;
}

.fab-menu.active .fab-item {
    animation: fabItemIn var(--transition-base) forwards;
}

@keyframes fabItemIn {
    from {
        opacity: 0;
        transform: scale(0) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.fab-item {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-lg);
}

.fab-item:nth-child(1) {
    background: var(--success-gradient);
    animation-delay: 0ms;
}

.fab-item:nth-child(2) {
    background: var(--danger-gradient);
    animation-delay: 50ms;
}

.fab-item:nth-child(3) {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    animation-delay: 100ms;
}

.fab-item:hover {
    transform: scale(1.15);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.fab-label {
    position: absolute;
    right: 65px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-fast);
    transform: translateX(10px);
}

.fab-item:hover .fab-label {
    opacity: 1;
    transform: translateX(0);
}

/* ===========================
   INPUTS MODERNES
   =========================== */
.input {
    padding: 0.875rem 1.125rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 0.9375rem;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    width: 100%;
}

.input:focus {
    outline: none;
    border-color: var(--primary);
    background-color: var(--bg-primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.input::placeholder {
    color: var(--text-secondary);
}

/* ===========================
   LISTES D'ITEMS MODERNES
   =========================== */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.item:hover {
    background: var(--bg-primary);
    border-color: var(--border);
    transform: translateX(4px);
}

.item-info {
    flex: 1;
}

.item-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.item-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.item-amount {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.item-amount.income {
    color: var(--success);
}

.item-amount.expense {
    color: var(--danger);
}

/* ===========================
   MODALS MODERNES
   =========================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: modalFadeIn var(--transition-base);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 450px;
    width: 100%;
    max-height: 100vh;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    animation: modalSlideIn var(--transition-base);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

.modal-body {
    margin-bottom: 1.5rem;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* ===========================
   PARTICIPANTS CHECKBOX
   =========================== */
.participants {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.participant-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem;
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 2px solid transparent;
}

.participant-checkbox:hover {
    border-color: var(--primary);
    background-color: var(--bg-primary);
}

.participant-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

.participant-checkbox label {
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 500;
}

/* ===========================
   CALCULATRICE MODERNE
   =========================== */
.calculator {
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.06);
}

.calc-display {
    background-color: var(--bg-primary);
    padding: 1.5rem;
    text-align: right;
    font-size: 2rem;
    font-weight: 700;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    min-height: 4rem;
    word-wrap: break-word;
    letter-spacing: -0.025em;
    box-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.06);
    color: var(--text-primary);
}

.calc-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.calc-btn {
    padding: 1.25rem;
    font-size: 1.25rem;
    font-weight: 600;
    border: none;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.calc-btn:hover {
    background-color: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

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

.calc-btn.operator {
    background: var(--primary-gradient);
    color: white;
}

.calc-btn.operator:hover {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.calc-btn.equal {
    background: var(--success-gradient);
    color: white;
    grid-column: span 2;
}

.calc-btn.equal:hover {
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* ===========================
   EMPTY STATES
   =========================== */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    opacity: 0.7;
}

/* ===========================
   DONATION POPUP MODERNE
   =========================== */
.donation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn var(--transition-base);
}

.donation-popup {
    background: var(--bg-secondary);
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    text-align: center;
    max-width: 450px;
    width: 90%;
    position: relative;
    animation: slideIn var(--transition-base);
    border: 1px solid var(--border);
}

@keyframes slideIn {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.donation-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
    background: var(--bg-tertiary);
}

.donation-close:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.donation-popup h3 {
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.donation-popup p {
    margin-bottom: 2rem;
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.9375rem;
}

.donation-link {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #FFDD00 0%, #FBB034 100%);
    color: #000000;
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-base);
    box-shadow: var(--shadow);
    font-size: 1rem;
}

.donation-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(251, 176, 52, 0.4);
    background: linear-gradient(135deg, #FBB034 0%, #FFDD00 100%);
}

/* ===========================
   ANIMATIONS GLOBALES
   =========================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }
    
    .header h1 {
        font-size: 1.25rem;
    }
    
    .header-buttons {
        gap: 0.5rem;
    }
    
    .btn-icon {
        width: 40px;
        height: 40px;
    }
    
    .content {
        padding: 1rem;
    }
    
    .dashboard {
        grid-template-columns: 1fr;
    }
    
    .user-card {
        padding: 1.25rem;
    }
    
    .section {
        padding: 1.25rem;
    }
    
    .fab {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 56px;
        height: 56px;
    }
    
    .modal-content {
        padding: 1.5rem;
        border-radius: var(--radius-lg);
    }
     
	 .tabs {
        padding: 0.5rem 0.25rem;
    }
    
    .tab {
        font-size: 1.125rem; /* 18px sur mobile */
        padding: 1rem 1.25rem;
        font-weight: 600;
    }
    
    .add-tab {
        font-size: 1.5rem; /* Bouton + plus grand aussi */
    }
}

@media (max-width: 640px) {
    .modal {
        padding: 0;
    }
    
	.header h1 {
        font-size: 1.125rem;
    }
	
	.tab {
        font-size: 1.125rem; /* Plus grand sur mobile */
        padding: 1.25rem 1.5rem;
        font-weight: 700;
    }
	
    .modal-content {
        max-width: 100%;
        width: 100%;
     /* height: 100vh; */
        max-height: 100vh;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }
    
    .modal-body {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 2rem;
    }
    
    .modal-header {
        position: sticky;
        top: 0;
        background-color: var(--bg-secondary);
        z-index: 10;
        padding: 1.5rem 1.5rem 1rem;
        margin: -1.5rem -1.5rem 1rem;
        border-bottom: 1px solid var(--border);
    }
    
    .modal-footer {
        position: sticky;
        bottom: 0;
        background-color: var(--bg-secondary);
        padding: 1rem 1.5rem 1.5rem;
        margin: 1rem -1.5rem -1.5rem;
        border-top: 1px solid var(--border);
    }
}

/* ===========================
   SUPPORT PWA
   =========================== */
@media (display-mode: standalone) {
    .header {
        padding-top: env(safe-area-inset-top, 1rem);
    }
    
    .fab {
        bottom: calc(1.5rem + env(safe-area-inset-bottom, 0));
    }
}

/* Support pour les encoches iPhone */
@supports (padding: max(0px)) {
    .header {
        padding-top: max(1rem, env(safe-area-inset-top));
    }
    
    .content {
        padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    }
}

/* ===========================
   FOCUS VISIBLE
   =========================== */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ===========================
   SCROLLBAR PERSONNALISÉE
   =========================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: var(--radius);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border);
}

/* Mode clair - scrollbar */
[data-theme="light"] ::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: var(--border);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Bouton d'installation avec animation pulse */
.install-pulse {
    animation: pulse 2s infinite;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}
.install-pulse:hover {
    animation: none;
}
/* Animation slide down */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
/* Animation plus fluide pour slideUp */
@keyframes slideUp {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Animations pour la bannière d'installation */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(100px) scale(0.3);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) translateY(-20px) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

@keyframes bounceOut {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(100px) scale(0.3);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes slideOutUp {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-100%);
    }
}

/* Styles pour le PIN */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

.pin-btn {
    background: var(--bg-tertiary);
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
}

.pin-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.pin-btn:active {
    transform: scale(0.95);
}

#pinModal .modal-content {
    position: relative;
}