﻿/* ================================================================
   PharmCollect – OTC Medicine Delivery App
   Style Sheet
   ================================================================ */

/* ---- Design Tokens ---- */
:root {
  --blue-50:   #EFF6FF;
  --blue-100:  #DBEAFE;
  --blue-200:  #BFDBFE;
  --blue-400:  #60A5FA;
  --blue-500:  #3B82F6;
  --blue-600:  #2563EB;
  --blue-700:  #1D4ED8;
  --teal-400:  #2DD4BF;
  --teal-500:  #14B8A6;
  --indigo-500:#6366F1;
  --gray-50:   #F9FAFB;
  --gray-100:  #F3F4F6;
  --gray-200:  #E5E7EB;
  --gray-400:  #9CA3AF;
  --gray-500:  #6B7280;
  --gray-600:  #4B5563;
  --gray-700:  #374151;
  --gray-900:  #111827;
  --white:     #FFFFFF;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12), 0 4px 10px rgba(0,0,0,0.08);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--gray-50);
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
}
button { cursor: pointer; border: none; background: none; font-family: inherit; }
img { display: block; }

/* ================================================================
   FULL-SCREEN LAYOUT (no phone frame)
   ================================================================ */
.phone-frame {
  width: 100%;
  height: 100vh;
}

.phone-screen {
  width: 100%;
  height: 100vh;
  background: var(--gray-50);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ================================================================
   STATUS BAR
   ================================================================ */
.status-bar {
  display: none;
}

/* ================================================================
   SCROLL CONTENT
   ================================================================ */
.scroll-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  scroll-behavior: smooth;
}
.scroll-content::-webkit-scrollbar { display: none; }

/* ================================================================
   HEADER
   ================================================================ */
.app-header {
  background: linear-gradient(180deg, var(--blue-600) 0%, var(--blue-700) 100%);
  padding: 12px 20px 20px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.location-block { flex: 1; }

.deliver-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: rgba(255,255,255,0.75);
  font-weight: 500;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.location-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.3px;
}

.avatar-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  border: 2px solid rgba(255,255,255,0.4);
  transition: transform var(--transition);
}
.avatar-btn:active { transform: scale(0.92); }
.avatar-img { width: 100%; height: 100%; object-fit: cover; }
.avatar-badge {
  position: absolute;
  top: -3px; right: -3px;
  width: 18px; height: 18px;
  background: #EF4444;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  color: white;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--blue-700);
}

/* Search Bar */
.search-bar {
  display: flex;
  align-items: center;
  background: var(--white);
  border-radius: 14px;
  padding: 10px 14px;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.search-icon { flex-shrink: 0; }
.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--gray-700);
  font-family: inherit;
  background: transparent;
}
.search-input::placeholder { color: var(--gray-400); }
.filter-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--blue-50);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.filter-btn:active { background: var(--blue-100); }

/* ================================================================
   PROMO BANNER
   ================================================================ */
.promo-section { padding: 16px 0 0; }

.banner-carousel {
  position: relative;
  margin: 0 20px;
}

.banner-viewport {
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.banner-track {
  display: flex;
  transition: transform 0.45s cubic-bezier(0.4,0,0.2,1);
}

.banner-slide {
  min-width: 100%;
  border-radius: var(--radius-md);
  padding: 20px 20px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.banner-green  { background: linear-gradient(135deg, #1D4ED8, #3B82F6); }
.banner-teal   { background: linear-gradient(135deg, #0369A1, #0EA5E9); }
.banner-indigo { background: linear-gradient(135deg, #4338CA, #6366F1); }

.banner-slide::before {
  content: '';
  position: absolute;
  top: -30px; right: 60px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}

.banner-slide.banner-slide-img {
  padding: 0;
  height: 220px;
  justify-content: center;
  background-color: var(--gray-100);
}

.banner-slide.banner-slide-img::before {
  content: '';
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  border-radius: 0;
  background: var(--slide-bg) center / cover no-repeat;
  filter: blur(18px) brightness(0.92);
  transform: scale(1.15);
}

.banner-img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (min-width: 640px) {
  .banner-slide.banner-slide-img {
    height: 280px;
  }
}

.banner-content { position: relative; z-index: 1; }
.banner-tag {
  display: inline-block;
  background: rgba(255,255,255,0.25);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.banner-title {
  font-size: 18px;
  font-weight: 800;
  color: white;
  line-height: 1.2;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}
.banner-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  margin-bottom: 12px;
}
.banner-cta {
  background: white;
  color: var(--gray-900);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 20px;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.banner-cta:active { transform: scale(0.96); }

.banner-illustration {
  font-size: 56px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

.banner-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}
.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gray-300, #D1D5DB);
  cursor: pointer;
  transition: all var(--transition);
}
.dot.active {
  width: 20px;
  border-radius: 3px;
  background: var(--blue-500);
}

/* ================================================================
   SECTION HEADER
   ================================================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  margin-bottom: 12px;
}
.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.3px;
}
.see-all-btn {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue-600);
  transition: opacity var(--transition);
}
.see-all-btn:active { opacity: 0.6; }

/* ================================================================
   CATEGORIES
   ================================================================ */
.categories-section { padding: 20px 0 0; }

.categories-scroll {
  display: flex;
  gap: 10px;
  padding: 4px 20px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.categories-scroll::-webkit-scrollbar { display: none; }

.category-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  min-width: 72px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  border: 2px solid transparent;
  flex-shrink: 0;
}
.category-pill:active { transform: scale(0.95); }
.category-pill.active {
  background: var(--blue-50);
  border-color: var(--blue-500);
}
.cat-icon { font-size: 22px; }
.cat-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--gray-600);
  white-space: nowrap;
}
.category-pill.active .cat-label { color: var(--blue-700); }

/* ================================================================
   PHARMACY CARDS
   ================================================================ */
.pharmacies-section { padding: 20px 0 0; }

.pharmacy-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 20px;
}

/* ================================================================
   PRESCRIPTION UPLOAD
   ================================================================ */
.rx-section {
  padding: 16px 20px 4px;
}

/* --- Main Upload Card (idle) --- */
.rx-card {
  background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
  border-radius: var(--radius-md);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(37,99,235,0.30);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}
.rx-card::before {
  content: '';
  position: absolute;
  top: -30px; right: -20px;
  width: 110px; height: 110px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
}
.rx-card::after {
  content: '';
  position: absolute;
  bottom: -40px; left: 30px;
  width: 90px; height: 90px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
}
.rx-card:active { transform: scale(0.98); }

.rx-idle {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.rx-icon-wrap {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  backdrop-filter: blur(4px);
}

.rx-text { flex: 1; min-width: 0; }
.rx-title {
  font-size: 14px;
  font-weight: 700;
  color: white;
  margin-bottom: 3px;
  letter-spacing: -0.2px;
}
.rx-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  font-weight: 500;
}

.rx-upload-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: white;
  color: var(--blue-700);
  font-size: 13px;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 24px;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: transform var(--transition);
  font-family: inherit;
}
.rx-upload-btn:active { transform: scale(0.94); }

.rx-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  z-index: 2;
}

/* --- Drag Over Overlay --- */
.rx-drag-overlay {
  position: absolute;
  inset: 0;
  background: rgba(29,78,216,0.92);
  border-radius: var(--radius-md);
  border: 2.5px dashed rgba(255,255,255,0.6);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: white;
  font-size: 14px;
  font-weight: 700;
  z-index: 10;
}
.rx-drag-overlay.active { display: flex; }

/* --- Preview Row --- */
.rx-preview {
  display: none;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-md);
  border: 1.5px solid var(--blue-100);
  margin-top: 10px;
  animation: fadeSlideIn 0.3s ease both;
}
.rx-preview.visible { display: flex; }

.rx-preview-thumb {
  width: 48px; height: 48px;
  border-radius: 10px;
  background: var(--blue-50);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.rx-img-thumb {
  width: 48px; height: 48px;
  object-fit: cover;
  border-radius: 10px;
}

.rx-preview-info { flex: 1; min-width: 0; }
.rx-filename {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-800, #1F2937);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.rx-filesize {
  font-size: 11px;
  color: var(--gray-400);
  font-weight: 500;
  margin-bottom: 6px;
}

.rx-progress-bar {
  height: 4px;
  background: var(--blue-100);
  border-radius: 10px;
  overflow: hidden;
}
.rx-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--blue-500), var(--blue-400));
  border-radius: 10px;
  transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
}

.rx-preview-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.rx-submit-btn {
  background: var(--blue-600);
  color: white;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 20px;
  font-family: inherit;
  transition: transform var(--transition), background var(--transition);
}
.rx-submit-btn:active { transform: scale(0.94); background: var(--blue-700); }

.rx-remove-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--gray-500);
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  font-family: inherit;
  transition: background var(--transition);
}
.rx-remove-btn:active { background: #FEE2E2; color: #EF4444; }

/* --- Success Row --- */
.rx-success {
  display: none;
  align-items: center;
  gap: 12px;
  background: #F0FDF4;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  border: 1.5px solid #BBF7D0;
  margin-top: 10px;
  animation: fadeSlideIn 0.35s ease both;
}
.rx-success.visible { display: flex; }

.rx-success-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #22C55E;
  color: white;
  font-size: 18px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(34,197,94,0.35);
}
.rx-success-title {
  font-size: 13px;
  font-weight: 700;
  color: #166534;
  margin-bottom: 2px;
}
.rx-success-sub {
  font-size: 11px;
  color: #15803D;
  font-weight: 500;
}
.rx-new-btn {
  margin-left: auto;
  background: #166534;
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 20px;
  font-family: inherit;
  flex-shrink: 0;
  transition: transform var(--transition);
}
.rx-new-btn:active { transform: scale(0.94); }

.pharmacy-card {
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition);
  cursor: pointer;
}
.pharmacy-card:active { transform: scale(0.98); box-shadow: var(--shadow-sm); }

.pharmacy-banner {
  height: 110px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.pharmacy-banner-overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.pharmacy-logo-wrap {
  position: relative;
  z-index: 2;
  width: 60px; height: 60px;
  background: white;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.20);
  overflow: hidden;
}

.pharmacy-logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 8px;
}

.open-badge {
  position: absolute;
  top: 10px; left: 12px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  z-index: 3;
}
.open-badge.open   { background: rgba(255,255,255,0.92); color: #166534; }
.open-badge.closed { background: rgba(255,255,255,0.92); color: #B91C1C; }

.fav-btn {
  position: absolute;
  top: 8px; right: 10px;
  font-size: 20px;
  color: rgba(255,255,255,0.85);
  transition: all var(--transition);
  line-height: 1;
  z-index: 3;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.fav-btn.active { color: #EF4444; }
.fav-btn:active { transform: scale(1.3); }

.pharmacy-info { padding: 12px 14px 14px; }

.pharmacy-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.pharmacy-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.2px;
}
.rating-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
  background: var(--gray-100);
  padding: 3px 8px;
  border-radius: 20px;
}

.pharmacy-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.meta-chip {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--gray-500);
  font-weight: 500;
}
.meta-chip.free-tag {
  color: var(--blue-600);
  font-weight: 600;
}

.pharmacy-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--blue-700);
  background: var(--blue-50);
  padding: 3px 8px;
  border-radius: 20px;
  border: 1px solid var(--blue-200);
}

/* ================================================================
   BOTTOM NAVIGATION
   ================================================================ */
.bottom-nav {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 10px 14px;
  background: var(--white);
  border-top: 1px solid var(--gray-100);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
  position: relative;
  z-index: 60;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--gray-400);
  transition: all var(--transition);
  position: relative;
}
.nav-item.active { color: var(--blue-600); }
.nav-item:active { transform: scale(0.92); }

.nav-icon-wrap {
  position: relative;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
}

.nav-badge {
  position: absolute;
  top: -6px; right: -8px;
  background: #EF4444;
  color: white;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 10px;
  padding: 0 3px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid white;
}

.nav-active-dot {
  position: absolute;
  bottom: -10px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  background: var(--blue-500);
  border-radius: 50%;
  opacity: 0;
  transition: opacity var(--transition);
}
.nav-item.active .nav-active-dot { opacity: 1; }

.nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* ================================================================
   PHARMACY CARD – HIDDEN FOR FILTER
   ================================================================ */
.pharmacy-card.hidden {
  display: none;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
  .phone-screen {
    height: 100dvh;
  }
}

/* ================================================================
   ANIMATIONS
   ================================================================ */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.pharmacy-card {
  animation: fadeSlideIn 0.4s ease both;
}
.pharmacy-card:nth-child(1) { animation-delay: 0.05s; }
.pharmacy-card:nth-child(2) { animation-delay: 0.10s; }
.pharmacy-card:nth-child(3) { animation-delay: 0.15s; }
.pharmacy-card:nth-child(4) { animation-delay: 0.20s; }
.pharmacy-card:nth-child(5) { animation-delay: 0.25s; }
