
/* =========================================
   CORE STYLES
   ========================================= */
:root {
    --primary: #FF3B30;
    --black-bg: #000000;
    --glass-bg: rgba(30, 30, 30, 0.85);
    --border: rgba(255, 255, 255, 0.15);
    --text-white: #ffffff;
    --success: #32D74B;
    --error: #ff4444;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--black-bg);
    color: var(--text-white);
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* LOADING OVERLAY */
#loader {
    position: fixed; inset: 0; background: rgba(0,0,0,0.95); z-index: 9999;
    display: none; justify-content: center; align-items: center; flex-direction: column;
}
.spinner {
    width: 50px; height: 50px; border: 5px solid #333; border-top: 5px solid var(--primary);
    border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* SMALL SPINNER FOR BUTTONS */
.btn-spinner {
    width: 20px; height: 20px; border: 3px solid rgba(255,255,255,0.3); border-top: 3px solid var(--primary);
    border-radius: 50%; animation: spin 0.8s linear infinite; display: none;
    margin-right: 10px; vertical-align: middle;
}
.loading .btn-spinner { display: inline-block; }


/* CUSTOM MESSAGE MODAL (Replaces alerts) */
#msg-modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 10000;
    display: none; justify-content: center; align-items: center; padding: 30px;
}
.msg-card {
    background: #1c1c1e; border: 1px solid var(--border); border-radius: 24px;
    padding: 30px; text-align: center; max-width: 400px; width: 100%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.msg-icon { font-size: 40px; margin-bottom: 20px; }
.msg-error .msg-icon { color: var(--error); }
.msg-success .msg-icon { color: var(--success); }


/* BUTTONS & INPUTS */
.btn-primary {
    background: var(--primary); color: white; border: none; padding: 16px;
    border-radius: 30px; font-weight: 700; font-size: 16px; cursor: pointer;
    width: 100%; transition: transform 0.2s;
    box-shadow: 0 4px 15px rgba(255, 59, 48, 0.4);
}
.btn-primary:active { transform: scale(0.96); }
.btn-primary:disabled { background: #555; cursor: not-allowed; opacity: 0.6; box-shadow:none; }

input, select, textarea {
    width: 100%; padding: 15px; margin-bottom: 15px; background: #1c1c1e;
    border: 1px solid #333; border-radius: 12px; color: white; font-size: 16px; outline: none;
}
input:focus { border-color: var(--primary); }

.glass-card {
    background: var(--glass-bg); backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border); border-radius: 24px; padding: 20px;
}

/* VIEWS */
.view {
    position: absolute; inset: 0; display: none; flex-direction: column;
    background: black; overflow-y: auto; overflow-x: hidden;
}

/* 1. LANDING */
#landing-view { z-index: 100; justify-content: center; padding: 30px; }
.brand-title { 
    font-size: 48px; font-weight: 800; 
    background: linear-gradient(to right, #fff, #ff3b30); 
    -webkit-background-clip: text; color: transparent; margin-bottom: 20px;
}

/* 2. LOGIN - NEW DESIGN */
#login-view { z-index: 90; justify-content: center; padding: 20px; background: #000; }

.login-split {
    display: flex; flex-direction: column;
    background: #111; border-radius: 30px; overflow: hidden;
    border: 1px solid #333; min-height: 500px;
}
.login-left {
    background: linear-gradient(135deg, #300, #000); padding: 40px 30px;
    display: flex; flex-direction: column; justify-content: center;
}
.login-right {
    padding: 30px; display: flex; flex-direction: column; justify-content: center; flex: 1;
    background: #0a0a0a;
}
.login-brand { font-size: 36px; font-weight: 800; color: var(--primary); line-height: 1.1; }
.login-sub { color: #888; margin-top: 15px; font-size: 14px; }
.create-btn {
    background: transparent; border: 1px solid rgba(255,255,255,0.3);
    padding: 12px 30px; border-radius: 25px; color: white; font-weight: 600; cursor: pointer;
    width: 100%; margin-top: 20px; text-align: center; transition: border-color 0.3s;
}
.create-btn:hover { border-color: var(--primary); }

/* Login Animation */
@keyframes blastOut {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.5); filter: blur(20px); }
}
.blasting-out { animation: blastOut 0.6s forwards ease-in-out; pointer-events: none; }


/* 3. REGISTER */
#register-view { z-index: 95; padding: 30px; justify-content: center; }

/* 4. DASHBOARD */
#dashboard-view { 
    z-index: 50; padding: 20px; padding-bottom: 100px; 
    background: radial-gradient(circle at 50% -20%, #220000, #000 70%);
}

.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.icon-circle { 
    width: 45px; height: 45px; border-radius: 50%; background: #222; 
    display: flex; align-items: center; justify-content: center; border: 1px solid #333; cursor: pointer;
}
/* Scanning Animation */
@keyframes pulse-red { 0% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(255, 59, 48, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); } }
.scanning-active { animation: pulse-red 2s infinite; border-color: var(--primary); background: #300 !important; color: white; }
.location-active { background: var(--success); color: white; box-shadow: 0 0 10px var(--success); }

/* FEED */
.section-head { font-size: 16px; font-weight: 700; margin: 20px 0 10px 0; color: #ccc; border-bottom: 1px solid #333; padding-bottom: 5px; }
.req-card { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; cursor: pointer; position: relative; }
.badge { 
    width: 50px; height: 50px; background: linear-gradient(135deg, var(--primary), #800); 
    border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 800; color:white;
}
.del-btn {
    position: absolute; right: 10px; top: 10px; color: #ff4444; background: rgba(50,0,0,0.5);
    width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    border: 1px solid #ff4444; z-index: 5;
}

/* DOCK */
.dock {
    position: fixed; bottom: 20px; left: 20px; right: 20px; height: 70px;
    background: rgba(30,30,30,0.9); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-radius: 35px; border: 1px solid #444; z-index: 80;
    display: none; justify-content: space-between; align-items: center; padding: 0 15px;
}
.dock-item { width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; font-size: 22px; color: #aaa; cursor: pointer; position: relative; }
.dock-main { 
    background: var(--primary); color: white; padding: 0 20px; height: 50px; 
    border-radius: 25px; display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; cursor: pointer;
}
.red-dot {
    position: absolute; top: 10px; right: 10px; width: 10px; height: 10px;
    background: red; border-radius: 50%; border: 2px solid #303030; display: none;
}

/* PANELS */
.panel {
    position: fixed; inset: 0; background: #000; z-index: 150;
    transform: translateY(100%); transition: transform 0.3s ease;
    padding: 20px; overflow-y: auto; display: flex; flex-direction: column;
}
.panel.open { transform: translateY(0); }
.panel-head { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; }
.panel-title { font-size: 22px; font-weight: 700; }

/* CHAT */
.chat-box { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.msgs { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 75%; padding: 10px 15px; border-radius: 15px; font-size: 15px; }
.mine { align-self: flex-end; background: var(--primary); color: white; }
.theirs { align-self: flex-start; background: #333; color: white; }

/* NOTIFICATION MODAL */
#notif-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95);
    z-index: 200; display: none; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px;
}

/* MEDIA QUERIES FOR LOGIN */
@media (min-width: 768px) {
    .login-split { flex-direction: row; }
    .login-left, .login-right { flex: 1; }
}
