/* ==========================================================================
   SNAPCHAT WEB CLIENT - DESIGN SYSTEM & STYLESHEET
   ========================================================================== */

:root {
  /* Snapchat Color Tokens */
  --snap-yellow: #FFFC00;
  --snap-yellow-hover: #e6e300;
  --snap-black: #000000;
  --bg-dark: #070a0f;
  --bg-panel: #111723;
  --bg-panel-glass: rgba(17, 23, 35, 0.85);
  --bg-card: rgba(255, 255, 255, 0.05);
  --border-glass: rgba(255, 255, 255, 0.12);
  --border-glow: rgba(255, 252, 0, 0.4);

  /* Text Colors */
  --text-white: #ffffff;
  --text-muted: #94a3b8;
  --text-dark: #0f172a;

  /* Status Accents */
  --accent-cyan: #00f2fe;
  --accent-pink: #ff007f;
  --accent-green: #22c55e;
  --accent-red: #ef4444;
  --streak-fire: #ff6b00;

  /* Typography */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Radius & Shadows */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --shadow-glass: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 252, 0, 0.05);
  --shadow-yellow: 0 8px 25px rgba(255, 252, 0, 0.3);
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  user-select: none;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-white);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--snap-yellow);
}

/* View Screen Switcher */
.view-screen {
  display: none;
  width: 100vw;
  height: 100vh;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.view-screen.active-view {
  display: flex;
  opacity: 1;
}

/* ==========================================================================
   VIEW 1: LOGIN / SIGN UP STYLES
   ========================================================================== */

#loginView {
  align-items: center;
  justify-content: center;
  position: relative;
  background: radial-gradient(circle at 50% 30%, #1e2638 0%, var(--bg-dark) 70%);
}

.login-bg-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 252, 0, 0.15) 0%, rgba(0,0,0,0) 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: blur(40px);
}

.login-container {
  width: 100%;
  max-width: 440px;
  padding: 24px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.snap-logo-wrapper {
  width: 84px;
  height: 84px;
  background: var(--snap-yellow);
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px auto;
  box-shadow: var(--shadow-yellow);
  animation: pulseLogo 3s infinite ease-in-out;
}

@keyframes pulseLogo {
  0%, 100% { transform: scale(1); box-shadow: 0 8px 25px rgba(255, 252, 0, 0.3); }
  50% { transform: scale(1.04); box-shadow: 0 12px 35px rgba(255, 252, 0, 0.5); }
}

.snap-ghost-logo {
  width: 58px;
  height: 58px;
  overflow: visible;
}

.login-header h1 {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.tagline {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.auth-card {
  width: 100%;
  background: var(--bg-panel-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-glass);
}

.auth-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px;
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--text-white);
  border: 1px solid var(--border-glass);
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  font-size: 16px;
  pointer-events: none;
}

.input-wrapper input {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 12px 14px 12px 42px;
  color: var(--text-white);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-wrapper input:focus {
  border-color: var(--snap-yellow);
  box-shadow: 0 0 10px rgba(255, 252, 0, 0.2);
}

.toggle-password {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  opacity: 0.55;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-password:hover {
  opacity: 0.95;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.08);
}

.toggle-password:active {
  transform: scale(0.92);
}

.eye-svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 24px;
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-muted);
}

.forgot-pass-link {
  color: var(--snap-yellow);
  text-decoration: none;
  font-weight: 500;
}
.forgot-pass-link:hover { text-decoration: underline; }

.btn-primary-yellow {
  width: 100%;
  background: var(--snap-yellow);
  color: var(--snap-black);
  border: none;
  border-radius: var(--radius-md);
  padding: 14px;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-yellow);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-primary-yellow:hover {
  background: var(--snap-yellow-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(255, 252, 0, 0.45);
}

.btn-arrow { font-size: 18px; }

.divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 12px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-glass);
}
.divider span { padding: 0 12px; }

.btn-social {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 12px;
  color: var(--text-white);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.btn-social:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-avatar-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.login-footer {
  margin-top: 32px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}
.login-footer a {
  color: var(--text-muted);
  text-decoration: none;
}
.login-footer a:hover { color: var(--text-white); }


/* ==========================================================================
   VIEW 2: HOME DASHBOARD STYLES
   ========================================================================== */

#homeView {
  flex-direction: column;
}

/* Header Navbar */
.app-header {
  height: 64px;
  background: var(--bg-panel-glass);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 10;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-trigger-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.user-bitmoji-head {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--snap-yellow);
  object-fit: cover;
  box-shadow: 0 0 10px rgba(255, 252, 0, 0.3);
}

.online-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  background: var(--accent-green);
  border: 2px solid var(--bg-dark);
  border-radius: 50%;
}

.search-bar {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  gap: 10px;
  width: 260px;
}

.search-icon { stroke: var(--text-muted); }

.search-bar input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-white);
  font-size: 13px;
  width: 100%;
}

/* Center Nav Pills */
.nav-pills {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-glass);
}

.nav-pill-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  transition: all 0.2s ease;
}

.nav-pill-btn.active {
  background: var(--snap-yellow);
  color: var(--snap-black);
  box-shadow: 0 4px 15px rgba(255, 252, 0, 0.3);
}

.badge-count {
  background: var(--accent-red);
  color: white;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
}

.icon-btn-circle {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  border-radius: 50%;
  color: var(--text-white);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.icon-btn-circle:hover { background: rgba(255, 255, 255, 0.18); }

.header-right {
  display: flex;
  gap: 12px;
}

/* Main Layout Grid */
.dashboard-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 340px 1fr 340px;
  height: calc(100vh - 64px);
  overflow: hidden;
}

/* Sidebar Panels */
.panel-sidebar {
  background: var(--bg-panel);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 20px;
}
.right-panel {
  border-right: none;
  border-left: 1px solid var(--border-glass);
}

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

.panel-header h2 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
}

.new-chat-btn, .add-story-btn {
  background: var(--snap-yellow);
  color: var(--snap-black);
  border: none;
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.chat-filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.chip.active {
  background: rgba(255, 255, 255, 0.2);
  color: var(--text-white);
  border-color: var(--text-white);
}

/* Friends List Item */
.friends-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.friend-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.friend-item:hover, .friend-item.active-chat {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-glass);
}

.friend-avatar-ring {
  position: relative;
  width: 46px;
  height: 46px;
}

.friend-avatar-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.friend-item.has-unseen-story .friend-avatar-ring img {
  border: 2.5px solid var(--snap-yellow);
}

.friend-info {
  flex: 1;
}

.friend-name-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.friend-name {
  font-weight: 600;
  font-size: 15px;
}

.streak-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--streak-fire);
}

.last-msg-text {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.snap-status-icon {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}
.snap-status-icon.red { background: var(--accent-red); }
.snap-status-icon.purple { background: var(--accent-pink); }
.snap-status-icon.blue { background: var(--accent-cyan); }


/* CENTER PANEL: CAMERA VIEWPORT */
.camera-viewport {
  position: relative;
  background: #000;
  display: flex;
  flex-direction: column;
}

.camera-canvas-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#webcamFeed, #simulatedCanvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

#simulatedCanvas {
  position: absolute;
  top: 0;
  left: 0;
  display: none;
}

.camera-grid-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  display: none;
  background-image: 
    linear-gradient(to right, rgba(255,255,255,0.1) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.1) 1px, transparent 1px);
  background-size: 33.33% 33.33%;
}
.camera-grid-overlay.active { display: block; }

/* Camera Filter Transformations */
.filter-cyberpunk { filter: contrast(130%) hue-rotate(180deg) saturate(160%); }
.filter-vintage { filter: sepia(70%) contrast(110%) brightness(90%); }
.filter-neon { filter: saturate(200%) brightness(120%) drop-shadow(0 0 15px var(--accent-cyan)); }
.filter-sunset { filter: sepia(30%) hue-rotate(320deg) saturate(180%); }
.filter-mono { filter: grayscale(100%) contrast(140%); }

/* HUD Toolbar Top */
.camera-hud-top {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 5;
}

.hud-btn {
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-glass);
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
}
.hud-btn:hover { background: rgba(0, 0, 0, 0.7); }

.hud-timer-badge {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-family: monospace;
  font-size: 14px;
  color: var(--snap-yellow);
  border: 1px solid var(--border-glass);
}

/* Filter Selector Carousel */
.filter-selector-bar {
  position: absolute;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 5;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(16px);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-glass);
}

.filter-bubble {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid transparent;
  color: white;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.filter-bubble.active {
  background: var(--text-white);
  color: var(--snap-black);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
}

.filter-preview-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.cyan-magenta { background: linear-gradient(45deg, var(--accent-cyan), var(--accent-pink)); }
.sepia { background: #d97706; }
.neon-glow { background: #a855f7; }
.warm-sunset { background: #f97316; }
.mono-black { background: #475569; }

/* Camera Bottom Shutter Controls */
.camera-hud-bottom {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 5;
}

.shutter-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 4px solid var(--text-white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s ease;
}

.shutter-btn {
  width: 64px;
  height: 64px;
  background: var(--text-white);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.shutter-ring:hover { transform: scale(1.08); }
.shutter-btn:active { transform: scale(0.9); background: var(--snap-yellow); }

.camera-subtext {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}


/* CHAT DRAWER OVERLAY */
.chat-drawer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-panel);
  z-index: 20;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-drawer.open {
  transform: translateX(0);
}

.chat-drawer-header {
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.back-btn {
  background: none;
  border: none;
  color: var(--text-white);
  font-size: 20px;
  cursor: pointer;
}

.chat-avatar-wrapper {
  position: relative;
  width: 40px;
  height: 40px;
}
.chat-avatar-wrapper img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.chat-header-text h3 {
  font-size: 16px;
  font-weight: 700;
}
.chat-status-text {
  font-size: 12px;
  color: var(--text-muted);
}

.chat-actions {
  display: flex;
  gap: 8px;
}
.action-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  color: white;
  cursor: pointer;
}

.chat-messages-container {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg-bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
  position: relative;
}

.msg-bubble.sent {
  align-self: flex-end;
  background: var(--snap-yellow);
  color: var(--snap-black);
  font-weight: 500;
  border-bottom-right-radius: 4px;
}

.msg-bubble.received {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-white);
  border-bottom-left-radius: 4px;
}

.msg-time {
  font-size: 10px;
  opacity: 0.7;
  margin-top: 4px;
  text-align: right;
}

.chat-input-bar {
  padding: 14px 20px;
  background: rgba(0, 0, 0, 0.4);
  border-top: 1px solid var(--border-glass);
  display: flex;
  gap: 10px;
  align-items: center;
}

.input-action-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
}

.chat-input-bar input {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  padding: 10px 18px;
  color: white;
  outline: none;
}

.btn-send-message {
  background: var(--snap-yellow);
  color: var(--snap-black);
  border: none;
  border-radius: var(--radius-full);
  padding: 10px 18px;
  font-weight: 700;
  cursor: pointer;
}


/* RIGHT PANEL: STORIES & DISCOVER */
.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin: 20px 0 12px 0;
}

.my-story-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 252, 0, 0.05);
  border: 1px solid var(--border-glow);
  padding: 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.my-story-avatar {
  position: relative;
  width: 48px;
  height: 48px;
}
.my-story-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.plus-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  background: var(--snap-yellow);
  color: black;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border: 2px solid var(--bg-panel);
}

.story-info h4 { font-size: 15px; font-weight: 700; }
.story-info p { font-size: 12px; color: var(--text-muted); }

.stories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.story-card-thumb {
  position: relative;
  height: 140px;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
}

.story-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.story-card-thumb:hover img { transform: scale(1.05); }

.story-card-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 60%);
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.story-user-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}
.story-user-badge img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--snap-yellow);
}

.spotlight-carousel {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.spotlight-card {
  min-width: 100px;
  height: 140px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.spotlight-card img {
  width: 100%; height: 100%; object-fit: cover;
}

.map-widget-card {
  position: relative;
  height: 130px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-glass);
  cursor: pointer;
}

#mapWidgetCanvas {
  width: 100%;
  height: 100%;
  background: #111a28;
}

.map-widget-overlay {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}


/* ==========================================================================
   MODALS STYLING
   ========================================================================== */

.snap-modal {
  border: none;
  background: transparent;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  margin: 0;
  padding: 0;
}

.snap-modal[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.snap-modal::backdrop {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
}

.snap-modal-content {
  width: 90%;
  max-width: 480px;
  background: var(--bg-panel);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-close-btn, .story-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
}

.preview-tools {
  display: flex;
  gap: 8px;
}

.tool-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 14px;
}

.captured-media-viewport {
  position: relative;
  width: 100%;
  height: 400px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: black;
}

#capturedPhotoImg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.editable-text-overlay {
  position: absolute;
  bottom: 40px;
  left: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  text-align: center;
  padding: 10px;
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  outline: none;
}

.preview-footer {
  display: flex;
  justify-content: space-between;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
}

/* STORY VIEWER MODAL */
.story-playback-container {
  width: 380px;
  height: 650px;
  background: black;
  border-radius: var(--radius-lg);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.story-progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  width: 100%;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--snap-yellow);
  transition: width 0.1s linear;
}

.story-header-info {
  position: absolute;
  top: 16px; left: 16px; right: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 5;
}

.story-header-info img {
  width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--snap-yellow);
}

.story-media-view {
  flex: 1;
  position: relative;
}

.story-media-view img {
  width: 100%; height: 100%; object-fit: cover;
}

.story-caption-bar {
  position: absolute;
  bottom: 20px; left: 20px; right: 20px;
  background: rgba(0, 0, 0, 0.6);
  padding: 12px;
  border-radius: var(--radius-md);
  text-align: center;
  font-weight: 600;
}

.story-reply-bar {
  padding: 12px;
  background: black;
  display: flex;
  gap: 8px;
}
.story-reply-bar input {
  flex: 1;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: var(--radius-full);
  padding: 8px 16px;
  color: white;
}

.story-reply-bar button {
  background: var(--snap-yellow);
  border: none;
  border-radius: var(--radius-full);
  padding: 8px 16px;
  font-weight: 700;
  cursor: pointer;
}

/* BITMOJI PROFILE MODAL */
.profile-card {
  width: 380px;
  background: var(--bg-panel);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
  padding: 24px;
  text-align: center;
  position: relative;
}

.profile-card .modal-close-btn {
  position: absolute; top: 16px; right: 16px;
}

.bitmoji-large-ring {
  width: 90px;
  height: 90px;
  margin: 0 auto 12px auto;
  border-radius: 50%;
  border: 3px solid var(--snap-yellow);
  padding: 3px;
  box-shadow: 0 0 20px rgba(255, 252, 0, 0.3);
}

.profile-bitmoji-img {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
}

.profile-header h2 { font-family: var(--font-heading); font-size: 22px; }
.username-handle { color: var(--text-muted); font-size: 13px; margin-bottom: 8px; }
.snap-score-badge {
  display: inline-block;
  background: rgba(255, 252, 0, 0.1);
  color: var(--snap-yellow);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
}

.snapcode-wrapper { margin: 20px 0; }
.snapcode-box {
  width: 120px; height: 120px; margin: 0 auto; border-radius: 20px; overflow: hidden;
}
.snapcode-sub { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.stat-box {
  background: rgba(255, 255, 255, 0.04);
  padding: 10px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.stat-icon { font-size: 18px; margin-bottom: 2px; }
.stat-val { font-weight: 700; font-size: 13px; }
.stat-label { font-size: 10px; color: var(--text-muted); }

.profile-menu { display: flex; flex-direction: column; gap: 8px; }
.menu-item-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: white;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.logout-btn { color: var(--accent-red); border-color: rgba(239, 68, 68, 0.3); }

/* TOAST NOTIFICATION */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast-msg {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--snap-yellow);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  animation: slideInToast 0.3s ease;
}

@keyframes slideInToast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* RESPONSIVE LAYOUT */
@media (max-width: 992px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .panel-sidebar { display: none; }
  .panel-sidebar.mobile-active { display: flex; }
  .camera-viewport.mobile-hidden { display: none; }
}
