:root {
    --primary: #6366f1;
    --primary-hover: #818cf8; 
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --border-color: #334155;
    --text-main: #f8fafc;
    --text-light: #94a3b8;
    --danger: #ef4444;
}

body { font-family: 'Inter', sans-serif; margin: 0; padding: 0; background: var(--bg-color); color: var(--text-main); overflow: hidden; }

.fullscreen-splash { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; z-index: 100000; display: flex; justify-content: center; align-items: flex-end; background: #000; transition: opacity 0.4s ease-in-out; }
.fullscreen-splash img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.8; }
.splash-gradient { position: absolute; bottom: 0; left: 0; width: 100%; height: 60%; background: linear-gradient(to top, rgba(15,23,42,1), transparent); z-index: 1; }
.splash-content { position: relative; z-index: 2; color: white; text-align: center; padding-bottom: 12vh; width: 100%; }
.splash-overlay-text { font-size: 3.5rem; font-weight: 800; font-family: 'Playfair Display', serif; margin: 0 0 10px 0; text-shadow: 0 4px 15px rgba(0,0,0,0.8); letter-spacing: 1px; }
.splash-content p { margin: 0; font-family: 'Inter', sans-serif; font-size: 1.1rem; opacity: 0.8; }
.splash-loader { border: 3px solid rgba(255,255,255,0.2); border-top: 3px solid var(--primary); border-radius: 50%; width: 30px; height: 30px; animation: spin 1s linear infinite; margin: 20px auto 0 auto; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.text-center { text-align: center; }
.text-left { text-align: left; }
.mt-2 { margin-top: 10px; }
.mt-4 { margin-top: 20px; }
.primary-btn { background: var(--primary); color: white; border: none; padding: 12px 24px; border-radius: 8px; font-weight: 600; cursor: pointer; transition: 0.2s; width: 100%; display: flex; justify-content: center; gap: 8px; align-items: center; }
.primary-btn:hover { background: var(--primary-hover); }
.secondary-btn { background: transparent; color: var(--text-main); border: 1px solid var(--border-color); padding: 10px 16px; border-radius: 8px; font-weight: 600; cursor: pointer; transition: 0.2s; display: inline-block; text-align: center; width: 100%; box-sizing: border-box; }
.secondary-btn:hover { background: var(--border-color); color: white; }
.danger-btn { background: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); padding: 12px 24px; border-radius: 8px; font-weight: 600; cursor: pointer; transition: 0.2s; width: 100%; }
.danger-btn:hover { background: var(--danger); color: white; }
.btn-sm { padding: 8px 12px; font-size: 13px; }

#login-screen { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background: var(--bg-color); display: flex; justify-content: center; align-items: center; z-index: 9999; }
.login-card { background: var(--card-bg); padding: 50px 40px; border-radius: 20px; text-align: center; max-width: 350px; width: 90%; box-shadow: 0 20px 50px rgba(0,0,0,0.5); border: 1px solid var(--border-color); }
.login-card h1 { margin: 0 0 10px 0; font-weight: 800; font-size: 32px; color: var(--text-main); }
.login-card p { color: var(--text-light); margin-bottom: 30px; font-size: 14px; }

#app-interface { display: flex; flex-direction: column; height: 100vh; }
header { background: var(--card-bg); padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 4px 10px rgba(0,0,0,0.2); z-index: 10; border-bottom: 1px solid var(--border-color); }
.logo { font-weight: 800; font-size: 28px; color: var(--primary); }
.user-controls { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; color: var(--text-main); }

.avatar-circle { width: 38px; height: 38px; border-radius: 50%; background-color: var(--primary); color: white; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; overflow: hidden; border: 2px solid var(--border-color); transition: 0.2s; }
.avatar-circle:hover { transform: scale(1.05); border-color: var(--primary); }
.avatar-circle img { width: 100%; height: 100%; object-fit: cover; }
.avatar-circle.large { width: 100px; height: 100px; font-size: 36px; margin: 0 auto; border-width: 4px; pointer-events: none; }

.app-nav { display: flex; justify-content: space-around; background: var(--card-bg); padding: 10px; border-bottom: 1px solid var(--border-color); z-index: 10; }
.tab-btn { background: none; border: none; padding: 10px 20px; font-weight: 600; color: var(--text-light); cursor: pointer; border-radius: 20px; transition: 0.2s; display: flex; gap: 8px; align-items: center; }
.tab-btn:hover { background: var(--border-color); color: var(--text-main); }
.tab-btn.active { background: rgba(99, 102, 241, 0.15); color: var(--primary); }

.content-area { padding:5px; flex-grow: 1; position: relative; overflow-y: auto; }
.view-section { display: none; padding: 20px; height: 100%; box-sizing: border-box; }
.view-section h2 { color: var(--text-main); margin-top: 0; }
.view-section.active-view { display: block; }

#view-map { padding: 0; position: relative; }
#map { width: 100%; height: 100%; background: #e5e7eb; z-index: 1; }

.map-search-container { position: absolute; top: 15px; left: 50%; transform: translateX(-50%); z-index: 1000; width: 90%; max-width: 420px; }
.map-search-bar { display: flex; align-items: center; gap: 10px; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; padding: 10px 14px; box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.map-search-bar i { color: var(--text-light); font-size: 16px; flex-shrink: 0; }
.map-search-bar input { background: transparent; border: none; outline: none; color: var(--text-main); font-size: 14px; flex: 1; padding: 0; margin: 0; }
.map-search-bar input::placeholder { color: #475569; }
.map-search-bar input:focus { box-shadow: none; border: none; }
#map-search-btn { background: var(--primary); border: none; color: white; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: 0.2s; }
#map-search-btn:hover { background: var(--primary-hover); }
.map-search-results { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; margin-top: 6px; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,0.4); display: none; }
.map-search-result-item { padding: 12px 16px; cursor: pointer; font-size: 13px; color: var(--text-main); border-bottom: 1px solid var(--border-color); transition: background 0.15s; }
.map-search-result-item:last-child { border-bottom: none; }
.map-search-result-item:hover { background: rgba(99,102,241,0.1); color: var(--primary); }

.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--card-bg) !important; color: var(--text-main) !important; box-shadow: 0 10px 25px rgba(0,0,0,0.5) !important; }
.leaflet-container a.leaflet-popup-close-button { color: var(--text-light) !important; }

.fab { position: fixed; bottom: 30px; right: 30px; width: 60px; height: 60px; border-radius: 50%; background: var(--primary); color: white; font-size: 24px; border: none; cursor: pointer; box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4); z-index: 1000; transition: transform 0.2s; }
.fab:hover { transform: scale(1.1); }

.grid-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; padding-bottom: 80px; }
.list-card { background: var(--card-bg); border-radius: 16px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.2); border: 1px solid var(--border-color); cursor: pointer; transition: transform 0.2s; }
.list-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.4); border-color: var(--primary); }
.list-img { width: 100%; height: 150px; object-fit: cover; background: var(--border-color); opacity: 0.9; }
.list-info { padding: 15px; }
.list-title { margin: 0 0 5px 0; font-size: 18px; font-weight: 800; color: var(--text-main); }
.badge { font-size: 11px; font-weight: 800; padding: 4px 8px; border-radius: 8px; text-transform: uppercase; display: inline-block; margin-bottom: 8px; }
.badge.food { background: rgba(234, 179, 8, 0.15); color: #e5c120; border: 1px solid rgba(188, 145, 15, 0.3); }
.badge.deal { background: rgba(34, 197, 94, 0.15); color: #86efac; border: 1px solid rgba(34, 197, 94, 0.3); }
.badge.event { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, 0.3); }

.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(8px); z-index: 2000; justify-content: center; align-items: center; }
.modal-content { background: var(--card-bg); width: 90%; max-width: 400px; border-radius: 20px; overflow: hidden; box-shadow: 0 25px 50px rgba(0,0,0,0.5); border: 1px solid var(--border-color); animation: popUp 0.3s ease-out; }
@keyframes popUp { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px; border-bottom: 1px solid var(--border-color); }
.modal-header h3 { margin: 0; font-size: 18px; color: var(--text-main); }
.close-modal { background: none; border: none; font-size: 20px; color: var(--text-light); cursor: pointer; transition: 0.2s; }
.close-modal:hover { color: white; }
.modal-body { padding: 20px; max-height: 70vh; overflow-y: auto; }

.detail-text { margin: 0 0 15px 0; font-size: 15px; font-weight: 600; color: var(--text-main); }
.phone-group { display: flex; gap: 10px; }
.phone-group input { margin: 0; }

label { display: block; font-size: 12px; font-weight: 700; margin: 15px 0 5px 0; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; }
input, select, textarea { width: 100%; padding: 12px; border: 1px solid var(--border-color); border-radius: 8px; box-sizing: border-box; font-family: 'Inter'; font-size: 14px; background: #0b101e; color: white; transition: 0.2s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2); }
input::placeholder, textarea::placeholder { color: #475569; }
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(1); opacity: 0.5; cursor: pointer; }

/* 🌟 NEW: Styling for the file upload input */
input[type="file"] { padding: 9px; cursor: pointer; color: var(--text-light); }
input[type="file"]::-webkit-file-upload-button { background: var(--primary); color: white; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; margin-right: 10px; font-weight: 600; font-family: 'Inter'; }
input[type="file"]::-webkit-file-upload-button:hover { background: var(--primary-hover); }

.splash-card { max-width: 450px; position: relative; }
.splash-close { position: absolute; top: 15px; right: 15px; background: rgba(0,0,0,0.6); color: white; width: 30px; height: 30px; border-radius: 50%; display: flex; justify-content: center; align-items: center; z-index: 10; border: none; cursor: pointer; transition: 0.2s; backdrop-filter: blur(4px); }
.splash-close:hover { background: var(--danger); transform: scale(1.1); }
.splash-img { width: 100%; height: 250px; object-fit: cover; display: block; background: var(--border-color); opacity: 0.9; }
.splash-info { padding: 25px; }
.splash-meta { background: rgba(0,0,0,0.2); border: 1px solid var(--border-color); padding: 15px; border-radius: 12px; margin: 15px 0; font-size: 14px; display: grid; gap: 8px; }
.splash-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--border-color); }
.spotted-by { margin: 0; font-size: 13px; color: var(--text-light); }
.icon-btn { background: rgba(255,255,255,0.05); border: 1px solid var(--border-color); padding: 8px; border-radius: 6px; cursor: pointer; transition: 0.2s; }
.icon-btn.edit { color: #818cf8; }
.icon-btn.delete { color: #fca5a5; }
.icon-btn:hover { background: var(--border-color); }

.custom-map-marker { background: var(--card-bg); border-radius: 50%; width: 36px; height: 36px; display: flex; justify-content: center; align-items: center; box-shadow: 0 4px 10px rgba(0,0,0,0.6); font-size: 18px; border: 2px solid var(--primary); }
.marker-food { border-color: #c71212; color: #c71212; }
.marker-deal { border-color: #86efac; color: #86efac; }
.marker-event { border-color: #a5b4fc; color: #a5b4fc; }

.budget-container { padding: 20px; padding-bottom: 80px; display: flex; flex-direction: column; gap: 16px; max-width: 600px; margin: 0 auto; }
.budget-card { background: var(--card-bg); border-radius: 16px; padding: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.2); border: 1px solid var(--border-color); }
.budget-card h2, .budget-card h3 { margin: 0 0 15px 0; color: var(--text-main); }
.budget-card h2 { font-size: 22px; margin-bottom: 4px; }
.budget-subtitle { color: var(--text-light); font-size: 13px; margin: 0 0 20px 0; }
.budget-overview { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.budget-circle-wrap { position: relative; width: 120px; height: 120px; flex-shrink: 0; }
.budget-ring { width: 120px; height: 120px; }
.budget-circle-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }
#budget-percent-text { font-size: 22px; font-weight: 800; color: var(--primary); display: block; }
.budget-circle-label { font-size: 11px; color: var(--text-light); }
.budget-stats { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.stat-box { background: rgba(0,0,0,0.2); border: 1px solid var(--border-color); border-radius: 10px; padding: 10px 14px; }
.stat-label { font-size: 11px; font-weight: 700; color: var(--text-light); text-transform: uppercase; display: block; }
.stat-value { font-size: 18px; font-weight: 800; color: var(--text-main); }
.stat-value.spent { color: #ef4444; }
.stat-value.remaining { color: #22c55e; }
.budget-input-row { display: flex; gap: 10px; }
.budget-input-row input { margin: 0; flex: 1; }
.expense-row { display: flex; gap: 10px; margin-top: 10px; }
.expense-row input, .expense-row select { margin: 0; flex: 1; }
.expense-list-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.expense-list-header h3 { margin: 0; }
.expense-item { display: flex; justify-content: space-between; align-items: center; padding: 12px; background: rgba(0,0,0,0.2); border: 1px solid var(--border-color); border-radius: 10px; margin-bottom: 8px; }
.expense-item-left { display: flex; align-items: center; gap: 10px; }
.expense-emoji { font-size: 20px; }
.expense-name { font-weight: 600; font-size: 14px; color: var(--text-main); }
.expense-cat { font-size: 11px; color: var(--text-light); text-transform: capitalize; }
.expense-amount { font-weight: 800; color: #ef4444; font-size: 15px; }
.expense-delete { background: none; border: none; color: var(--text-light); cursor: pointer; font-size: 16px; padding: 4px; transition: 0.2s; }
.expense-delete:hover { color: var(--danger); }
.no-expenses { text-align: center; color: var(--text-light); padding: 20px; font-size: 14px; }