:root {
    --primary: #E60033; 
    --bg-color: #F2F2F7;
    --glass-bg: rgba(255, 255, 255, 0.65); 
    --glass-border: rgba(255, 255, 255, 0.4); 
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07); 
    --text: #1C1C1E;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
body { background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%); color: var(--text); padding-bottom: 110px; min-height: 100vh; overflow-x: hidden; width: 100vw; }

header { 
    background: var(--glass-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border); padding: 15px; text-align: center; position: sticky; top: 0; z-index: 100; 
    display: flex; justify-content: center; align-items: center;
}
header h1 { font-size: 1.2rem; color: var(--primary); font-weight: 700; letter-spacing: 0.5px; margin: 0;}

.header-action-btn { position: absolute; right: 15px; background: none; border: none; font-size: 1.4rem; cursor: pointer; transition: transform 0.4s ease; outline: none; }
.header-action-btn:active, .header-action-btn.spin { transform: rotate(360deg); }

.app-view { display: none; padding: 15px; max-width: 600px; margin: 0 auto; animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1); width: 100%; }
.app-view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(15px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

.login-container { display: flex; flex-direction: column; gap: 20px; text-align: center; margin-top: 15vh; padding: 20px; }
.login-logo { font-size: 6rem; filter: drop-shadow(0px 10px 15px rgba(0,0,0,0.1)); animation: float 3s ease-in-out infinite; }
@keyframes float { 0% { transform: translateY(0px); } 50% { transform: translateY(-10px); } 100% { transform: translateY(0px); } }
.login-container h2 { font-size: 2rem; color: #333; margin-bottom: 20px; font-weight: 800; }
.btn-large { font-size: 1.2rem; padding: 18px; border-radius: 20px; }

#add-form, #add-depense-form { 
    background: var(--glass-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border); padding: 20px; border-radius: 24px; box-shadow: var(--glass-shadow); 
    display: flex; flex-direction: column; gap: 15px; width: 100%;
}

.input-group { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.row { display: flex; gap: 10px; width: 100%; }
.half { flex: 1; min-width: 0; } 
label { font-weight: 600; font-size: 0.9rem; color: #555; margin-left: 5px; }

input, select { 
    width: 100%; max-width: 100%; padding: 14px; border: 1px solid rgba(0,0,0,0.05); border-radius: 14px; 
    font-size: 1rem; background: rgba(255,255,255,0.9); transition: all 0.3s ease; box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}
input:focus, select:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(230,0,51,0.15); }
input[readonly] { color: #8E8E93; background: rgba(230,230,230,0.5); }

.btn { 
    width: 100%; max-width: 100%; display: flex; justify-content: center; align-items: center; gap: 5px;
    padding: 15px; border: none; border-radius: 16px; font-size: 1rem; font-weight: 700; text-align: center; cursor: pointer; transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s; 
}
.btn:active { transform: scale(0.95); } 
.btn-primary { background: var(--primary); color: white; box-shadow: 0 4px 15px rgba(230,0,51,0.3); }
.btn-secondary { background: #1C1C1E; color: white; box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
.btn-blue { background: #007AFF; color: white; box-shadow: 0 4px 15px rgba(0,122,255,0.3); }
.btn-outline { background: rgba(0,122,255,0.05); border: 2px dashed #007AFF; color: #007AFF; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

p[id$="-name"] { font-size: 0.8rem; text-align: center; color: #8E8E93; word-wrap: break-word; }
.preview-map { width: 100%; height: 140px; border-radius: 16px; display: none; margin-top: 5px; z-index: 1; border: 1px solid var(--glass-border); }

/* --- Cartes Classiques --- */
.card { 
    width: 100%; background: var(--glass-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border); border-radius: 24px; overflow: hidden; box-shadow: var(--glass-shadow); 
    margin-bottom: 20px; transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1); cursor: pointer;
}
.card:active { transform: scale(0.97); } 
.card-img-container { height: 250px; overflow: hidden; position: relative; width: 100%; }
.card img { width: 100%; height: 100%; object-fit: cover; }
.card-badge { position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.4); color: white; padding: 6px 12px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.card-price { position: absolute; top: 12px; right: 12px; background: var(--primary); color: white; padding: 6px 12px; border-radius: 20px; font-weight: bold; font-size: 0.9rem; box-shadow: 0 4px 10px rgba(230,0,51,0.4); }
.card-content { padding: 18px; width: 100%; }
.card-title { font-size: 1.3rem; font-weight: 800; margin-bottom: 8px; color: #111; word-wrap: break-word; }
.card-meta { display: flex; justify-content: space-between; font-size: 0.9rem; color: #666; font-weight: 500; }

/* --- SWIPE TO DELETE (Corrigé avec une large zone cliquable) --- */
.swipe-container { position: relative; width: 100%; overflow: hidden; border-radius: 24px; margin-bottom: 20px; background: #FF3B30; }
/* La zone d'action fait maintenant 120px de large, tout est cliquable et bien centré ! */
.swipe-action { position: absolute; right: 0; top: 0; bottom: 0; width: 120px; background: #FF3B30; color: white; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: bold; font-size: 0.85rem; z-index: 0; cursor: pointer; }
.swipe-action .icon { font-size: 1.5rem; margin-bottom: 2px; }
.swipe-content { position: relative; z-index: 1; transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); margin-bottom: 0 !important; }

#detail-content .back-btn { position: absolute; top: 15px; left: 15px; background: rgba(255,255,255,0.5); border: 1px solid rgba(255,255,255,0.3); padding: 10px 18px; border-radius: 20px; font-weight: 700; z-index: 10; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 4px 10px rgba(0,0,0,0.1); width: auto; cursor: pointer;}
#detail-content img { width: 100%; height: 350px; object-fit: cover; border-radius: 24px; margin-bottom: 15px; box-shadow: 0 8px 20px rgba(0,0,0,0.1); }
.detail-info { background: var(--glass-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); padding: 25px; border-radius: 24px; box-shadow: var(--glass-shadow); border: 1px solid var(--glass-border); width: 100%; }
.detail-info h2 { font-size: 1.8rem; font-weight: 800; margin-bottom: 20px; word-wrap: break-word;}
.info-row { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; font-size: 1.05rem; color: #444; width: 100%; }
.info-row.address { color: #007AFF; font-weight: 500; background: rgba(0,122,255,0.05); padding: 12px; border-radius: 12px; margin-top: 10px; cursor: pointer; }
.info-row.address:active { background: rgba(0,122,255,0.1); transform: scale(0.98); }

.budget-dashboard { padding: 20px; text-align: center; background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.6)); border-radius: 24px; box-shadow: var(--glass-shadow); border: 1px solid var(--glass-border); width: 100%; }
.euro-convert { margin-top: 5px; color: #8E8E93; font-style: italic; font-weight: 600; }

/* --- Barre de navigation (Bouton + figé !) --- */
.bottom-nav { 
    position: fixed; bottom: 0; left: 0; right: 0; width: 100vw; 
    background: rgba(255,255,255,0.85); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
    display: flex; justify-content: space-evenly; align-items: flex-end; padding: 10px 0 25px 0; border-top: 1px solid rgba(255,255,255,0.5); z-index: 1000; box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
}
.nav-item { flex: 1; min-width: 0; background: transparent; border: none; display: flex; flex-direction: column; align-items: center; color: #999; gap: 6px; font-size: 0.75rem; font-weight: 600; transition: all 0.2s ease; cursor: pointer; }
.nav-item .icon { font-size: 1.5rem; transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1); filter: grayscale(100%); opacity: 0.6; margin-bottom: 2px;}
.nav-item.active { color: var(--primary); }
.nav-item.active .icon { filter: grayscale(0%); opacity: 1; transform: scale(1.15) translateY(-2px); }

/* Verrouillage strict : flex-shrink 0, min-width et min-height = le cercle ne sera JAMAIS ovale */
.nav-add { 
    flex: none; flex-shrink: 0; margin: 0 10px; transform: translateY(-20px); 
    background: linear-gradient(135deg, #E60033 0%, #ff4b2b 100%); color: white; 
    border-radius: 50%; width: 56px; height: 56px; min-width: 56px; min-height: 56px; 
    display: flex; justify-content: center; align-items: center; 
    box-shadow: 0 8px 20px rgba(230,0,51,0.4); border: 3px solid white; 
}
.nav-add .icon { color: white; font-size: 1.8rem; filter: none; opacity: 1; margin: 0; }
.nav-add:active { transform: translateY(-20px) scale(0.9); box-shadow: 0 4px 10px rgba(230,0,51,0.4); }