/* Custom styles for Bâtiment A36 */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Poppins', sans-serif; background: #f0f4ff; color: #1e293b; overscroll-behavior: none; }

/* Gradient hero */
.hero-gradient { background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #06b6d4 100%); }

/* Glass card */
.glass { background: rgba(255,255,255,0.9); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.5); }

/* Section animations */
.section-page { display: none; opacity: 0; transform: translateY(10px); transition: all 0.3s ease; }
.section-page.active { display: block; opacity: 1; transform: translateY(0); }

/* Bottom nav */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: white; border-top: 1px solid #e2e8f0; z-index: 50; padding-bottom: env(safe-area-inset-bottom); }
.nav-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; padding: 8px 4px; cursor: pointer; transition: all 0.2s; color: #94a3b8; min-width: 0; }
.nav-btn.active { color: #2563eb; }
.nav-btn svg { width: 22px; height: 22px; }
.nav-btn span { font-size: 10px; margin-top: 2px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* Top sub-nav for sections with multiple sub-tabs */
.sub-nav { display: flex; overflow-x: auto; gap: 8px; padding: 12px 16px; background: white; border-bottom: 1px solid #e2e8f0; scrollbar-width: none; }
.sub-nav::-webkit-scrollbar { display: none; }
.sub-btn { flex-shrink: 0; padding: 6px 16px; border-radius: 20px; font-size: 13px; font-weight: 500; border: none; cursor: pointer; transition: all 0.2s; background: #f1f5f9; color: #64748b; }
.sub-btn.active { background: #2563eb; color: white; }

/* Cards */
.card { background: white; border-radius: 16px; padding: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); margin-bottom: 12px; }
.card-hover { transition: transform 0.2s, box-shadow 0.2s; }
.card-hover:active { transform: scale(0.98); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }

/* Status badges */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-green { background: #dcfce7; color: #16a34a; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-yellow { background: #fef9c3; color: #ca8a04; }
.badge-red { background: #fee2e2; color: #dc2626; }
.badge-gray { background: #f1f5f9; color: #64748b; }
.badge-purple { background: #f3e8ff; color: #7c3aed; }
.badge-orange { background: #ffedd5; color: #ea580c; }

/* Owner card */
.owner-card { background: white; border-radius: 16px; padding: 16px; display: flex; gap: 14px; align-items: center; box-shadow: 0 2px 8px rgba(0,0,0,0.06); margin-bottom: 10px; cursor: pointer; transition: transform 0.15s; }
.owner-card:active { transform: scale(0.98); }
.owner-avatar { width: 50px; height: 50px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; color: white; flex-shrink: 0; }

/* Chat */
.chat-bubble { max-width: 80%; padding: 10px 14px; border-radius: 18px; font-size: 14px; line-height: 1.5; word-break: break-word; }
.chat-bubble.mine { background: #2563eb; color: white; border-bottom-right-radius: 4px; }
.chat-bubble.other { background: white; color: #1e293b; border-bottom-left-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.chat-bubble.admin-msg { background: #7c3aed; color: white; border-bottom-left-radius: 4px; }
.chat-time { font-size: 10px; color: #94a3b8; margin-top: 3px; }
#chat-messages { max-height: calc(100vh - 280px); overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }

/* Buttons */
.btn { padding: 10px 20px; border-radius: 12px; font-weight: 600; font-size: 14px; border: none; cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.btn-primary { background: #2563eb; color: white; }
.btn-primary:hover { background: #1d4ed8; }
.btn-primary:active { background: #1e40af; transform: scale(0.97); }
.btn-success { background: #16a34a; color: white; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: #dc2626; color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-warning { background: #d97706; color: white; }
.btn-ghost { background: transparent; color: #64748b; border: 1.5px solid #e2e8f0; }
.btn-whatsapp { background: #25D366; color: white; }
.btn-call { background: #059669; color: white; }

/* Inputs */
.input { width: 100%; padding: 12px 14px; border: 1.5px solid #e2e8f0; border-radius: 12px; font-size: 14px; background: white; transition: border 0.2s; font-family: 'Poppins', sans-serif; }
.input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.label { font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; display: block; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 100; display: flex; align-items: flex-end; justify-content: center; padding: 0; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box { background: white; border-radius: 24px 24px 0 0; width: 100%; max-height: 90vh; overflow-y: auto; padding: 24px; transform: translateY(100%); transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.modal-overlay.open .modal-box { transform: translateY(0); }

/* Emergency cards */
.emergency-card { background: linear-gradient(135deg, #fee2e2, #fecaca); border: 1px solid #fca5a5; border-radius: 16px; padding: 16px; display: flex; align-items: center; gap: 14px; }
.emergency-icon { width: 48px; height: 48px; border-radius: 14px; background: white; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }

/* Progress bar */
.progress-bar { height: 8px; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; transition: width 0.5s ease; }

/* Vote option */
.vote-option { border: 2px solid #e2e8f0; border-radius: 12px; padding: 12px 16px; cursor: pointer; transition: all 0.2s; margin-bottom: 8px; }
.vote-option:hover { border-color: #2563eb; background: #eff6ff; }
.vote-option.selected { border-color: #2563eb; background: #eff6ff; }

/* Calendar */
.cal-day { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 14px; cursor: pointer; transition: all 0.15s; }
.cal-day.today { background: #2563eb; color: white; font-weight: 700; }
.cal-day.has-event { background: #dbeafe; color: #1d4ed8; font-weight: 600; }
.cal-day:hover { background: #f1f5f9; }

/* Stats */
.stat-card { background: white; border-radius: 16px; padding: 20px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.stat-num { font-size: 32px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 12px; color: #64748b; margin-top: 4px; font-weight: 500; }

/* Floor card */
.floor-card { border-radius: 16px; overflow: hidden; margin-bottom: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.floor-header { padding: 12px 16px; font-weight: 700; color: white; font-size: 14px; }

/* Toast notification */
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-100px); background: #1e293b; color: white; padding: 12px 24px; border-radius: 12px; font-size: 14px; font-weight: 500; z-index: 999; transition: transform 0.3s; white-space: nowrap; box-shadow: 0 8px 24px rgba(0,0,0,0.15); }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: #16a34a; }
.toast.error { background: #dc2626; }

/* Pull to refresh */
.ptr-indicator { text-align: center; padding: 12px; color: #64748b; font-size: 13px; display: none; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse-ring { 0% { transform: scale(0.8); opacity: 1; } 100% { transform: scale(2); opacity: 0; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.4s ease forwards; }
.slide-up { animation: slideUp 0.3s ease forwards; }
.stagger > * { opacity: 0; animation: fadeIn 0.4s ease forwards; }
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.10s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.20s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.30s; }
.pulse-dot { width: 10px; height: 10px; border-radius: 50%; background: #22c55e; position: relative; display: inline-block; }
.pulse-dot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: #22c55e; animation: pulse-ring 1.5s infinite; }

/* Search */
.search-box { position: relative; }
.search-box input { padding-left: 42px; }
.search-box svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #94a3b8; width: 18px; height: 18px; }

/* Main content padding */
.content-area { padding-bottom: 80px; min-height: 100vh; }
.page-header { background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%); color: white; padding: 60px 16px 40px; position: relative; overflow: hidden; }
.page-header::before { content: ''; position: absolute; top: -50%; right: -20%; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,0.08); }
.page-header::after { content: ''; position: absolute; bottom: -30%; left: -10%; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,0.06); }

/* Category colors */
.cat-plomberie { background: #dbeafe; color: #1d4ed8; }
.cat-electricite { background: #fef9c3; color: #ca8a04; }
.cat-ascenseur { background: #f3e8ff; color: #7c3aed; }
.cat-commun { background: #dcfce7; color: #16a34a; }
.cat-autre { background: #f1f5f9; color: #64748b; }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }

/* Loading spinner */
.spinner { width: 24px; height: 24px; border: 3px solid #e2e8f0; border-top-color: #2563eb; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty state */
.empty-state { text-align: center; padding: 40px 20px; color: #94a3b8; }
.empty-state svg { width: 60px; height: 60px; margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 15px; font-weight: 500; }
.empty-state span { font-size: 13px; }
