/* ==========================================================================
   C-Net Create — Bulletproof Mobile & Laptop/Desktop Responsive Architecture
   Zero-leak, perfect containment, Crafto 4:5 ratio, no overflow.
   ========================================================================== */

:root {
  --primary-green: #25d366;
  --primary-green-hover: #20ba5a;
  --accent-blue: #0288d1;
  --accent-blue-hover: #0277bd;
  --gold-primary: #d4af37;
  --gold-gradient: linear-gradient(90deg, #997430 0%, #ba9343 50%, #876223 100%);
  --gold-footer-grad: linear-gradient(90deg, #876223 0%, #a88134 50%, #876223 100%);
  --gold-text-highlight: #ffdd44;
  --bg-desktop: #0f172a;
  --bg-mobile: #ffffff;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --border-light: #e2e8f0;
  --app-max-width: 440px;
}

/* Global Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-desktop);
  color: var(--text-dark);
}

/* Outer Desktop Frame: Centering the Mobile Application on Laptops/Desktops */
.desktop-viewport-wrapper {
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: radial-gradient(circle at 50% 20%, #1e293b 0%, #0f172a 100%);
  padding: 0;
  overflow-x: hidden;
}

@media (min-width: 600px) {
  .desktop-viewport-wrapper {
    padding: 24px 16px;
  }
}

/* The Core App Shell: Contained, strict width, zero element leakage */
.app-container {
  width: 100%;
  max-width: var(--app-max-width);
  background-color: #ffffff;
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  overflow: hidden; /* Prevents any child from spilling into laptop screen */
}

@media (min-width: 600px) {
  .app-container {
    min-height: 880px;
    border-radius: 28px;
    border: 8px solid #334155;
    margin-bottom: 24px;
  }
}

/* Device Top Status Bar (Only on Desktop Preview) */
.device-notch-bar {
  display: none;
  background: #ffffff;
  padding: 8px 18px 4px 18px;
  font-size: 11px;
  font-weight: 600;
  color: #1e293b;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
}
@media (min-width: 600px) {
  .device-notch-bar {
    display: flex;
  }
}
.notch-status-icons {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Header: Category Pills */
.category-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #ffffff;
  padding: 10px 14px 6px 14px;
  border-bottom: 1px solid #f1f5f9;
  width: 100%;
  overflow: hidden;
}

.category-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 6px;
  max-height: 155px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  padding-left: 2px;
  padding-right: 2px;
}
.category-scroll::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 50px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
  user-select: none;
}

.cat-pill:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.cat-pill.active {
  background: #1e1b4b;
  color: #ffffff;
  border-color: #1e1b4b;
  font-weight: 600;
}

.pill-more {
  background: #f8fafc;
  font-weight: 600;
}
.text-orange { color: #ea580c; }
.text-blue { color: #2563eb; }
.text-red { color: #dc2626; }
.text-amber { color: #d97706; }

/* Sub-header Toolbar */
.poster-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px 6px 16px;
  width: 100%;
}

.poster-meta {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-change-design {
  background: #ffffff;
  border: 1px solid #94a3b8;
  border-radius: 50px;
  padding: 5px 14px;
  font-size: 11.5px;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.btn-change-design:active {
  transform: scale(0.97);
}

/* Main Content Area */
.app-content {
  flex: 1;
  padding: 4px 14px 80px 14px; /* bottom padding for bottom nav */
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

/* 4:5 Poster Container */
.poster-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  background: #000000;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.22);
}

.poster-frame {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: #0b0c10;
  position: relative;
  overflow: hidden;
  user-select: none;
}

/* Top Master Brand Bar */
.poster-header-banner {
  background: var(--gold-gradient);
  display: flex;
  align-items: center;
  padding: 6px 10px;
  gap: 8px;
  border-bottom: 1.5px solid var(--gold-primary);
  z-index: 10;
  width: 100%;
  flex-shrink: 0;
}

.mci-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  color: #1e3a8a;
  border: 1.5px solid var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 9.5px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  flex-shrink: 0;
}

.brand-text-wrap {
  font-size: 9.5px;
  line-height: 1.25;
  color: #ffffff;
  font-weight: 500;
  overflow: hidden;
}
.brand-text-wrap strong {
  font-weight: 700;
  display: block;
}

/* Central Quote / Art Layer */
.poster-art-layer {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 75% 35%, #18191f 0%, #08080a 100%);
  padding: 14px 18px;
  overflow: hidden;
}

.floral-flourish {
  position: absolute;
  left: 0;
  top: 10%;
  bottom: 10%;
  width: 90px;
  background: radial-gradient(ellipse at left, rgba(212, 175, 55, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.poster-quote-container {
  position: relative;
  z-index: 4;
  text-align: center;
  max-width: 92%;
  margin: auto;
}

.quote-devanagari {
  font-family: 'Tiro Devanagari Hindi', 'Poppins', serif;
  font-size: 19px;
  line-height: 1.55;
  font-weight: 600;
  color: #f8fafc;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
  letter-spacing: 0.2px;
}

.accent-highlight {
  color: var(--gold-text-highlight);
  font-weight: 700;
  font-family: 'Rozha One', 'Tiro Devanagari Hindi', serif;
  font-size: 23px;
  text-shadow: 0 0 12px rgba(255, 221, 68, 0.4);
}

.golden-flourish-heart {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  color: #ffd700;
  font-size: 11px;
}
.golden-flourish-heart .wing {
  height: 1px;
  width: 24px;
  background: linear-gradient(90deg, transparent, #ffd700);
}
.golden-flourish-heart .wing.right {
  background: linear-gradient(90deg, #ffd700, transparent);
}

/* Bottom User Profile Band */
.poster-footer-band {
  background: var(--gold-footer-grad);
  display: flex;
  align-items: center;
  padding: 8px 10px;
  gap: 10px;
  border-top: 1.5px solid var(--gold-primary);
  z-index: 10;
  width: 100%;
  flex-shrink: 0;
}

.user-photo-box {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  overflow: hidden;
  flex-shrink: 0;
  background: #334155;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-details-box {
  flex: 1;
  color: #ffffff;
  line-height: 1.25;
  overflow: hidden;
}

.user-name {
  font-family: 'Tiro Devanagari Hindi', 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-business {
  font-size: 10px;
  font-weight: 600;
  color: #fef08a;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-address {
  font-size: 8px;
  color: #f1f5f9;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-contact-row {
  display: flex;
  gap: 8px;
  font-size: 8px;
  color: #ffffff;
  margin-top: 3px;
  font-weight: 600;
  white-space: nowrap;
}

/* Floating Edit Button on Poster */
.btn-floating-edit {
  position: absolute;
  right: 10px;
  bottom: 64px;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 50px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.3);
  z-index: 15;
}

/* Action Button Row below Poster */
.action-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
  width: 100%;
}

.action-btn {
  border-radius: 8px;
  padding: 10px 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-share {
  background-color: var(--primary-green);
  color: #ffffff;
  border: none;
}
.btn-share:hover { background-color: var(--primary-green-hover); }

.btn-download {
  background-color: #ffffff;
  color: var(--accent-blue);
  border: 1.5px solid var(--accent-blue);
}
.btn-download:hover { background-color: #f0f9ff; }

.btn-change-photo {
  background-color: #ffffff;
  color: #334155;
  border: 1.5px solid #cbd5e1;
  font-size: 11px;
}
.btn-change-photo:hover { background-color: #f8fafc; }

/* Fixed Bottom Navigation: Strictly Contained inside .app-container */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 64px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 50;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #64748b;
  font-size: 11px;
  font-weight: 500;
  flex: 1;
}
.nav-item i {
  font-size: 18px;
  margin-bottom: 2px;
}
.nav-item.active {
  color: #0f172a;
  font-weight: 600;
}

.nav-ai-pill {
  flex: 1.4;
}
.ai-pill-content {
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  color: #ffffff;
  border-radius: 50px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 11px;
  box-shadow: 0 3px 8px rgba(168, 85, 247, 0.35);
}

.nav-avatar-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 2px;
  border: 1px solid #cbd5e1;
}
.nav-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.active {
  display: flex;
}
.modal-content {
  background: #ffffff;
  width: 100%;
  max-width: var(--app-max-width);
  border-radius: 20px 20px 0 0;
  padding: 18px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 -5px 25px rgba(0,0,0,0.25);
}
