/* ─────────────────────────────────────────────────────────────
   LOKY — Pixel-Perfect Campus Companion UI for Web/PWA
   ───────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&display=swap');

:root {
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --bg-cotton: #FFFFFF;
  --theme-crimson-bg: #631F1C;
  --theme-crimson-panel: #F2EBD6;
  --ticket-red: #BA2222;
  --chip-selected: #D44538;
  --text-dark: #171F33;
  --text-grey: #8E8E93;
  --text-muted: rgba(23, 31, 51, 0.6);
  --card-radius: 26px;
  --shadow-ticket: 0 10px 24px rgba(186, 34, 34, 0.35);
  --shadow-card: 0 8px 20px rgba(0, 0, 0, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-main);
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-cotton);
  color: var(--text-dark);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── App Background Image ─────────────────────────────────────── */
.app-bg-layer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('../assets/home_bg.png');
  background-size: cover;
  background-position: center top;
  opacity: 0.72;
  pointer-events: none;
  z-index: 0;
}

.app-container {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: env(safe-area-inset-top, 16px) 16px 40px 16px;
}

/* ── Top Welcome Bar ─────────────────────────────────────────── */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-top: 10px;
  margin-bottom: 14px;
}

.welcome-sub {
  font-size: 14px;
  color: #71717A;
  font-weight: 500;
}

.welcome-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.2;
}

.contact-pill-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #FFFFFF;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text-dark);
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease;
}

.contact-pill-btn:active {
  transform: scale(0.96);
}

.contact-pill-btn svg {
  width: 14px;
  height: 14px;
  fill: var(--text-dark);
}

/* ── Big Samarth Portal Banner ───────────────────────────────── */
.samarth-banner {
  height: 64px;
  width: 100%;
  background-color: var(--theme-crimson-bg);
  border-radius: 22px;
  border: 1px solid rgba(242, 235, 214, 0.2);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.16);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  margin-bottom: 22px;
  text-decoration: none;
  color: #FFFFFF;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.samarth-banner:active {
  transform: scale(0.985);
}

.samarth-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.samarth-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(242, 235, 214, 0.15);
  border: 1px solid rgba(242, 235, 214, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
}

.samarth-icon-box svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.samarth-title {
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.2;
}

.samarth-open-badge {
  background: rgba(242, 235, 214, 0.18);
  border: 1px solid rgba(242, 235, 214, 0.25);
  color: #FFFFFF;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.shortcut-title {
  font-size: 10.5px;
  font-weight: 600;
  color: #FFFFFF;
  letter-spacing: 0.2px;
}

/* ── Up Next Section Header ───────────────────────────────────── */
.up-next-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 900;
  color: #71717A;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.up-next-header svg {
  width: 14px;
  height: 14px;
  fill: #71717A;
}

.near-label {
  font-size: 10.5px;
  font-weight: 700;
  color: #71717A;
  margin-bottom: 6px;
}

/* ── Stop Filter Pills ────────────────────────────────────────── */
.stops-scroll-container {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.stops-scroll-container::-webkit-scrollbar {
  display: none;
}

.stop-pill {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #FFFFFF;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dark);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.stop-pill.active {
  background-color: var(--chip-selected);
  border-color: var(--chip-selected);
  color: #FFFFFF;
  box-shadow: 0 4px 10px rgba(212, 69, 56, 0.3);
}

/* ─────────────────────────────────────────────────────────────
   AUTHENTIC BUS TICKET CARD
   ───────────────────────────────────────────────────────────── */
.bus-ticket-wrapper {
  margin-bottom: 20px;
  cursor: pointer;
  transition: transform 0.15s ease;
  filter: drop-shadow(0 10px 18px rgba(186, 34, 34, 0.32));
}

.bus-ticket-wrapper:active {
  transform: scale(0.985);
}

.bus-ticket {
  position: relative;
  height: 178px;
  background-color: var(--ticket-red);
  border-radius: 22px;
  display: flex;
  overflow: hidden;
  color: #FFFFFF;
  -webkit-mask: 
    radial-gradient(circle 13px at 108px 0px, transparent 13px, #000000 13.5px) top / 100% 51% no-repeat,
    radial-gradient(circle 13px at 108px 100%, transparent 13px, #000000 13.5px) bottom / 100% 51% no-repeat;
  mask: 
    radial-gradient(circle 13px at 108px 0px, transparent 13px, #000000 13.5px) top / 100% 51% no-repeat,
    radial-gradient(circle 13px at 108px 100%, transparent 13px, #000000 13.5px) bottom / 100% 51% no-repeat;
}

/* Vertical Perforation Line */
.ticket-perforation {
  position: absolute;
  left: 108px;
  top: 18px;
  bottom: 18px;
  border-left: 2px dashed rgba(255, 255, 255, 0.38);
  z-index: 5;
}

/* Ticket Background Watermark Bus Icon */
.ticket-watermark {
  position: absolute;
  right: 12px;
  bottom: 4px;
  width: 112px;
  height: 112px;
  opacity: 0.08;
  pointer-events: none;
}

/* Left Stub Section */
.ticket-stub {
  width: 108px;
  height: 100%;
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  z-index: 2;
}

.stub-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.stub-number {
  font-size: 56px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -1px;
}

.stub-unit {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
}

/* Right Details Section */
.ticket-right {
  flex: 1;
  position: relative;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.ticket-pages-track {
  display: flex;
  height: 100%;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.ticket-details {
  flex: 0 0 100%;
  width: 100%;
  padding: 14px 18px 14px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 2;
  box-sizing: border-box;
}

.ticket-details.with-dots {
  padding-bottom: 24px;
}

.ticket-dots {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  z-index: 3;
  pointer-events: none;
}

.ticket-dot {
  width: 5px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  transition: all 0.2s ease;
}

.ticket-dot.active {
  width: 16px;
  background: #FFFFFF;
}

.route-stop-block {
  display: flex;
  flex-direction: column;
}

.stop-label {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.6px;
  margin-bottom: 2px;
}

.stop-value {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
}

.stop-via {
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

/* ─────────────────────────────────────────────────────────────
   EXPLORE CARDS (2-COLUMN GRID)
   ───────────────────────────────────────────────────────────── */
.explore-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.explore-card {
  height: 178px;
  border-radius: var(--card-radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease;
  color: #FFFFFF;
}

.explore-card:active {
  transform: scale(0.97);
}

/* Card 1: Holidays Card (Warm Amber Gradient) */
.card-holidays {
  background: linear-gradient(135deg, #B85E29 0%, #96461E 100%);
}

/* Card 2: Complaints & Helpdesk (Deep Teal Gradient) */
.card-complaints {
  background: linear-gradient(135deg, #145E59 0%, #0D424F 100%);
}

.card-watermark {
  position: absolute;
  top: 0;
  right: 8px;
  width: 84px;
  height: 84px;
  opacity: 0.09;
  pointer-events: none;
}

.card-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: auto;
}

.card-icon-circle svg {
  width: 22px;
  height: 22px;
  fill: #FFFFFF;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 4px;
}

.card-subtitle {
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.25;
}

/* ─────────────────────────────────────────────────────────────
   FULL SCREEN MODAL SHEETS (Schedule, Holidays, Helpdesk)
   ───────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  display: block;
  opacity: 1;
}

.modal-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 540px;
  margin: 0 auto;
  height: 92vh;
  background: #FFFFFF;
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
}

.modal-overlay.open .modal-sheet {
  transform: translateY(0);
}

.sheet-handle {
  width: 36px;
  height: 4px;
  background: #E4E4E7;
  border-radius: 2px;
  margin: 12px auto 6px auto;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px 14px 20px;
  border-bottom: 1px solid #F4F4F5;
}

.sheet-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-dark);
}

.sheet-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #F4F4F5;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #71717A;
}

.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 40px 20px;
  -webkit-overflow-scrolling: touch;
}

/* ── Modal Controls & Lists ───────────────────────────────────── */
.segmented-bar {
  display: flex;
  background: #F4F4F5;
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 14px;
}

.segment-item {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 4px;
  font-size: 13px;
  font-weight: 700;
  color: #71717A;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.segment-item.active {
  background: #FFFFFF;
  color: var(--text-dark);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.sheet-search-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid #E4E4E7;
  background: #FAFAFA;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  outline: none;
  margin-bottom: 14px;
}

.sheet-search-input:focus {
  border-color: var(--chip-selected);
  background: #FFFFFF;
}

/* Schedule Row */
.sched-row {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #F4F4F5;
}

.sched-time-col {
  width: 56px;
  flex-shrink: 0;
}

.sched-dep {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-dark);
}

.sched-arr {
  font-size: 16px;
  font-weight: 800;
  color: #A1A1AA;
  flex-shrink: 0;
  text-align: right;
}

.sched-route-col {
  flex: 1;
  padding-left: 8px;
}

.sched-stops {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dark);
}

.sched-via {
  font-size: 12px;
  font-weight: 500;
  color: #71717A;
}

/* Holiday Row */
.hol-row {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #F4F4F5;
  gap: 12px;
}

.hol-date-badge {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(184, 94, 41, 0.1);
  color: #B85E29;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hol-badge-m {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.hol-badge-d {
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}

.hol-info {
  flex: 1;
}

.hol-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-dark);
}

.hol-sub {
  font-size: 12px;
  color: #71717A;
  font-weight: 500;
}

.hol-pill {
  font-size: 10px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.hol-pill.gaz {
  background: rgba(52, 199, 89, 0.14);
  color: #2E7D32;
}

.hol-pill.res {
  background: rgba(255, 149, 0, 0.14);
  color: #D97706;
}

/* Complaint Link Row */
.comp-link-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #FAFAFA;
  border: 1px solid #F4F4F5;
  border-radius: 16px;
  text-decoration: none;
  color: var(--text-dark);
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.15s ease;
}

.comp-link-card:active {
  background: #F4F4F5;
  border-color: #E4E4E7;
}

.comp-arrow {
  color: #A1A1AA;
  font-size: 16px;
}

.comp-section-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  color: #71717A;
  margin: 20px 0 10px 0;
  letter-spacing: 0.5px;
}

/* ── Live Bus Floating Button & Running Highlights ───────────── */
.floating-live-bus-btn {
  position: absolute;
  bottom: 24px;
  right: 20px;
  width: 52px;
  height: 52px;
  background-color: #16A34A;
  color: #FFFFFF;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(22, 163, 74, 0.4);
  cursor: pointer;
  z-index: 100;
  transition: transform 0.15s ease;
}

.floating-live-bus-btn:active {
  transform: scale(0.94);
}

.floating-live-bus-btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.sched-row.is-running-row {
  background: rgba(22, 163, 74, 0.08);
  border-radius: 12px;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(22, 163, 74, 0.15);
}

.sched-row.running-flash {
  animation: flashPulse 1.2s ease 2;
}

@keyframes flashPulse {
  0% { background: rgba(22, 163, 74, 0.08); }
  50% { background: rgba(22, 163, 74, 0.28); }
  100% { background: rgba(22, 163, 74, 0.08); }
}

.live-running-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 800;
  color: #16A34A;
  background: rgba(22, 163, 74, 0.15);
  padding: 2px 7px;
  border-radius: 6px;
  margin-left: 6px;
  vertical-align: middle;
}

/* ── 2-Second Notification Toast ─────────────────────────────── */
.app-toast {
  position: fixed;
  top: 36px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(23, 31, 51, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #FFFFFF;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Nearest Holiday Highlight ───────────────────────────────── */
.hol-row.nearest-highlight {
  background: rgba(184, 94, 41, 0.08);
  border-radius: 14px;
  padding: 12px 10px;
  border: 1px solid rgba(184, 94, 41, 0.2);
}

.nearest-badge {
  font-size: 9.5px;
  font-weight: 800;
  color: #B85E29;
  background: rgba(184, 94, 41, 0.15);
  padding: 2px 6px;
  border-radius: 5px;
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: inline-block;
  vertical-align: middle;
}
