/* ==========================
   SUGAM INDOOR NAVIGATION — global.css
   Brand colors, typography, navbar, footer, SOS, drawer
   ======================== */

/* ── CSS Variables ───────────────────────────────────────── */
:root {
  --red:        #C0392B;
  --red-dark:   #922B21;
  --red-light:  #FADBD8;
  --blue:       #1A5276;
  --blue-dark:  #154360;
  --blue-light: #D6EAF8;
  --amber:      #B7950B;
  --amber-light:#FAEEDA;
  --green:      #1E8449;
  --green-light:#EAF3DE;
  --text:       #1C2833;
  --muted:      #566573;
  --page-bg:    #FFF8F5;
  --white:      #FFFFFF;
  --gray-light: #F2F3F4;
  --border:     #EEEEEE;
  --font:       'Segoe UI', Calibri, sans-serif;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--page-bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: var(--font); }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ── Navbar ──────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--red);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Hamburger */
.nav-hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: all 0.3s;
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-decoration: none;
}
.nav-logo img {
  height: 32px;
  width: 32px;
  object-fit: contain;
}
.nav-logo-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.04em;
}

/* Nav links - desktop */
.nav-links {
  display: flex;
  gap: 4px;
  margin-left: 60px;
}
.nav-links a {
  padding: 6px 12px;
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  border-radius: 6px;
  transition: background 0.2s;
}
.nav-links a:hover,
.nav-links a.active {
  background: var(--red-dark);
  color: var(--white);
}

/* Nav search */
.nav-search {
  flex: 1;
  max-width: 280px;
  margin-left: 12px;
  position: relative;
}
.nav-search input {
  width: 100%;
  height: 34px;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  padding: 0 12px 0 34px;
  font-size: 13px;
  color: var(--white);
  outline: none;
  font-family: var(--font);
  transition: background 0.2s;
}
.nav-search input::placeholder { color: rgba(255,255,255,0.7); }
.nav-search input:focus { background: rgba(255,255,255,0.3); }
.nav-search .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.8);
  font-size: 14px;
}

/* Nav right */
.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* SOS Button */
.btn-sos {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--red-dark);
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, background 0.2s;
  white-space: nowrap;
}
.btn-sos:hover { background: #7B241C; }
.btn-sos:active { transform: scale(0.96); }
.btn-sos i { font-size: 14px; }

/* Nav user avatar */
.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--red-light);
  border: 2px solid rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--red);
  cursor: pointer;
  overflow: hidden;
}
.nav-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── Main Content Wrapper ────────────────────────────────── */
.main-content {
  margin-top: 56px;
  flex: 1;
}

/* ── Side Drawer ─────────────────────────────────────────── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.drawer-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.drawer {
  position: fixed;
  top: 0; left: 0;
  height: 100%;
  width: 280px;
  background: var(--white);
  z-index: 201;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.drawer.open { transform: translateX(0); }

/* Drawer header */
.drawer-header {
  background: var(--red);
  padding: 20px 16px 16px;
  flex-shrink: 0;
}
.drawer-app-icon {
  width: 56px;
  height: 56px;
  background: var(--white);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  overflow: hidden;
}
.drawer-app-icon img { width: 40px; height: 40px; object-fit: contain; }
.drawer-brand { font-size: 26px; font-weight: 700; color: var(--white); }
.drawer-subtitle { font-size: 13px; color: rgba(255,255,255,0.75); font-style: italic; margin-top: 2px; }
.drawer-logos {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.drawer-logos img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  background: var(--white);
  border-radius: 6px;
  padding: 2px;
}

/* Drawer menu items */
.drawer-menu { flex: 1; padding: 8px 0; }
.drawer-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 0.5px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  color: inherit;
}
.drawer-item:hover { background: var(--gray-light); }
.drawer-item i {
  font-size: 20px;
  color: var(--red);
  width: 24px;
  flex-shrink: 0;
}
.drawer-item-texts { flex: 1; }
.drawer-item-title { font-size: 15px; font-weight: 500; color: var(--text); }
.drawer-item-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.drawer-item i.arrow { font-size: 14px; color: #CCC; width: auto; }

/* Drawer footer */
.drawer-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.btn-logout {
  width: 100%;
  padding: 10px;
  border: 1.5px solid var(--red);
  border-radius: 8px;
  color: var(--red);
  font-size: 14px;
  font-weight: 500;
  background: var(--white);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-logout:hover { background: var(--red); color: var(--white); }
.drawer-version {
  text-align: center;
  font-size: 12px;
  color: #AAAAAA;
  font-style: italic;
  margin-top: 10px;
}

/* ── SOS Modal ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.sos-modal {
  background: var(--white);
  border-radius: 16px;
  padding: 28px 24px;
  max-width: 340px;
  width: 90%;
  text-align: center;
}
.sos-modal .sos-icon {
  width: 64px;
  height: 64px;
  background: var(--red-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.sos-modal .sos-icon i { font-size: 28px; color: var(--red); }
.sos-modal h2 { font-size: 20px; color: var(--text); margin-bottom: 8px; }
.sos-modal p { font-size: 14px; color: var(--muted); margin-bottom: 20px; line-height: 1.5; }
.sos-modal-btns { display: flex; gap: 10px; }
.btn-cancel {
  flex: 1;
  padding: 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--muted);
  background: var(--white);
  cursor: pointer;
}
.btn-confirm-sos {
  flex: 1;
  padding: 10px;
  background: var(--red);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  cursor: pointer;
  transition: background 0.2s;
}
.btn-confirm-sos:hover { background: var(--red-dark); }

/* ── Footer ──────────────────────────────────────────────── */
.footer {
  background: var(--blue-dark);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}
.footer-left { font-size: 12px; color: #8AAABB; line-height: 1.6; }
.footer-center { display: flex; gap: 16px; }
.footer-center a { font-size: 12px; color: #8AAABB; transition: color 0.2s; }
.footer-center a:hover { color: var(--white); }
.footer-right { display: flex; gap: 8px; align-items: center; }
.footer-right img {
  width: 28px;
  height: 28px;
  background: var(--white);
  border-radius: 5px;
  padding: 2px;
  object-fit: contain;
}

/* ── Utility Buttons ─────────────────────────────────────── */
.btn-primary {
  background: var(--red);
  color: var(--white);
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  border: none;
  font-family: var(--font);
}
.btn-primary:hover { background: var(--red-dark); }
.btn-primary:active { transform: scale(0.97); }

.btn-outline {
  background: var(--white);
  color: var(--red);
  border: 1.5px solid var(--red);
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  font-family: var(--font);
}
.btn-outline:hover { background: var(--red); color: var(--white); }

/* ── Toast Notification ──────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text);
  color: var(--white);
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 500;
  transition: transform 0.3s;
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-search { display: none; }
  .nav-logo { position: static; transform: none; }
  .footer { flex-direction: column; text-align: center; }
  .footer-center { justify-content: center; }
  .footer-right { justify-content: center; }
}
