/* ==========================================================================
   Face-Secure Social Media & Reels Web App - Premium Stylesheet
   ========================================================================== */

/* Modern Fonts & Reset */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Color Palette */
  --bg-deep: #08070d;
  --bg-dark: #12101b;
  --bg-card: rgba(22, 20, 36, 0.65);
  --bg-card-hover: rgba(30, 27, 49, 0.8);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(147, 51, 234, 0.3);
  
  /* Accent Gradients */
  --accent-primary: #9333ea;
  --accent-secondary: #ec4899;
  --accent-gradient: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  --btn-gradient: linear-gradient(135deg, #8b5cf6 0%, #d946ef 100%);
  --glow-gradient: radial-gradient(circle, rgba(147, 51, 234, 0.15) 0%, rgba(0, 0, 0, 0) 70%);

  /* Text Colors */
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  /* UI Elements */
  --border-radius-lg: 24px;
  --border-radius-md: 16px;
  --border-radius-sm: 12px;
  --glass-blur: blur(16px);
  --transition-smooth: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-premium: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.25);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Plus Jakarta Sans', 'Outfit', sans-serif;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
}

/* Background Glowing Blurs */
.bg-glow {
  position: fixed;
  width: 50vw;
  height: 50vw;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  filter: blur(100px);
  opacity: 0.4;
}

.glow-1 {
  background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, transparent 70%);
  top: -10%;
  left: -10%;
}

.glow-2 {
  background: radial-gradient(circle, rgba(236, 72, 153, 0.2) 0%, transparent 70%);
  bottom: -10%;
  right: -10%;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-gradient);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(8, 7, 13, 0.7);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-color);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  text-decoration: none;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius-sm);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: white;
  box-shadow: var(--shadow-glow);
}

.logo-text {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.feed-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 30px;
  padding: 4px;
  border: 1px solid var(--border-color);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.5rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-btn.active {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* ==========================================================================
   Buttons & Generic Components
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--border-radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-primary {
  background: var(--btn-gradient);
  color: white;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(217, 70, 239, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.35);
}

.btn-icon {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
}

/* ==========================================================================
   Main View Containers
   ========================================================================== */

.main-content {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  position: relative;
  z-index: 10;
}

.view-section {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Posts Feed Layout (Grid & Cards)
   ========================================================================== */

.posts-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.post-card {
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-premium);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-6px);
  border-color: rgba(147, 51, 234, 0.3);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), var(--shadow-glow);
}

.post-header {
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.post-author-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.author-img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.95rem;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.author-name-wrap {
  display: flex;
  flex-direction: column;
}

.author-displayname {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.author-username {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.post-time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Media Holder and Protection */
.post-media-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4/5;
  background: #000;
  overflow: hidden;
}

.post-media-container img, 
.post-media-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none; /* Prevent direct dragging */
}

/* Translucent overlay to trap clicks/taps & right clicks */
.media-protection-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.001); /* Invisible but blocks interaction */
  z-index: 10;
  cursor: default;
}

.post-actions-panel {
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.action-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.action-item:hover {
  color: var(--text-primary);
}

.action-item.liked {
  color: var(--accent-secondary);
  animation: heartBeat 0.3s ease-out;
}

@keyframes heartBeat {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.post-caption-section {
  padding: 1rem;
  flex: 1;
}

.post-caption {
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.comment-preview-trigger {
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  margin-top: 0.5rem;
}

/* ==========================================================================
   Reels View (Full Screen Video Snap)
   ========================================================================== */

.reels-feed-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 480px;
  height: calc(100vh - 120px);
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  background: black;
  box-shadow: var(--shadow-premium);
}

.reels-scroller {
  width: 100%;
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none; /* Hide scrollbars Firefox */
}

.reels-scroller::-webkit-scrollbar {
  display: none; /* Hide scrollbars Chrome */
}

.reel-item {
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.reel-video-element {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none; /* Anti-save */
}

/* Floating Overlay with details */
.reel-details-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none; /* Let clicks pass to the protection overlay */
}

.reel-details-overlay * {
  pointer-events: auto; /* Re-enable for text and interactive actions */
}

.reel-uploader {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.reel-uploader-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  border: 2px solid white;
}

.reel-uploader-name {
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.reel-caption {
  font-size: 0.95rem;
  color: #f3f4f6;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* Floating Sidebar Actions for Reels */
.reel-sidebar-actions {
  position: absolute;
  right: 1rem;
  bottom: 6rem;
  z-index: 16;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.reel-sidebar-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(22, 20, 36, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.reel-sidebar-btn:hover {
  transform: scale(1.1);
  background: rgba(22, 20, 36, 0.85);
}

.reel-sidebar-btn.liked {
  color: var(--accent-secondary);
}

.reel-sidebar-btn i {
  font-size: 1.25rem;
}

.reel-sidebar-count {
  font-size: 0.75rem;
  font-weight: 700;
  color: #e5e7eb;
  margin-top: 2px;
}

/* ==========================================================================
   Comments System (Drawer View)
   ========================================================================== */

.comments-drawer {
  position: fixed;
  bottom: -100%;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 60vh;
  background: #110e1c;
  border-top-left-radius: var(--border-radius-lg);
  border-top-right-radius: var(--border-radius-lg);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
  z-index: 150;
  transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.comments-drawer.open {
  bottom: 0;
}

.comments-header {
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.comments-title {
  font-weight: 700;
  font-size: 1.1rem;
}

.close-drawer-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
}

.comments-list {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.comment-item {
  display: flex;
  gap: 0.75rem;
}

.comment-details {
  background: rgba(255, 255, 255, 0.04);
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius-md);
  flex: 1;
  border: 1px solid rgba(255,255,255,0.02);
}

.comment-author-name {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.comment-text {
  font-size: 0.9rem;
  color: #d1d5db;
}

.comments-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  gap: 0.5rem;
}

.comments-input-area {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
  background: #171424;
}

.comments-form {
  display: flex;
  gap: 0.75rem;
}

.comment-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 0.75rem 1.25rem;
  color: white;
  font-family: inherit;
  font-size: 0.9rem;
}

.comment-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

/* ==========================================================================
   Modals & Overlays
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 3, 8, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.active {
  display: flex;
}

.modal-wrapper {
  background: #141221;
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), var(--shadow-glow);
  overflow: hidden;
  animation: modalScaleUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.modal-close:hover {
  color: white;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  max-height: 70vh;
}

/* ==========================================================================
   Forms & Controls
   ========================================================================== */

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.form-input {
  width: 100%;
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  color: white;
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

.form-helper {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Custom Location Capture Element */
.location-capturer-box {
  background: rgba(147, 51, 234, 0.05);
  border: 1px dashed rgba(147, 51, 234, 0.25);
  border-radius: var(--border-radius-sm);
  padding: 1rem;
  text-align: center;
  margin-bottom: 1.25rem;
}

.location-capturer-box.success {
  background: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.3);
}

.location-btn {
  background: var(--accent-gradient);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 20px;
  cursor: pointer;
}

.location-status-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* ==========================================================================
   Camera Interface (Face Scan UI)
   ========================================================================== */

.camera-container {
  width: 100%;
  aspect-ratio: 4/3;
  background: #000;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  position: relative;
  margin-bottom: 1rem;
}

.camera-feed {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* Mirror view */
}

/* Scanning Overlay Design */
.face-scanner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.face-target-frame {
  width: 60%;
  height: 70%;
  border: 2px dashed rgba(139, 92, 246, 0.6);
  border-radius: 50%;
  box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.5); /* Dim exterior */
  position: relative;
}

.face-scanner-overlay.scanning .face-target-frame {
  border-color: #ec4899;
  border-style: solid;
  animation: borderPulse 1.5s infinite;
}

.face-scanner-overlay.matched .face-target-frame {
  border-color: #10b981;
  border-style: solid;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.8), 0 0 0 1000px rgba(0, 0, 0, 0.6);
}

@keyframes borderPulse {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.02); opacity: 1; }
  100% { transform: scale(1); opacity: 0.8; }
}

/* Horizontal scan line */
.scan-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, rgba(236, 72, 153, 0) 0%, rgba(236, 72, 153, 0.8) 50%, rgba(236, 72, 153, 0) 100%);
  box-shadow: 0 0 15px #ec4899;
  z-index: 12;
  display: none;
}

.face-scanner-overlay.scanning .scan-line {
  display: block;
  animation: scanProgress 2s linear infinite;
}

@keyframes scanProgress {
  0% { top: 10%; }
  50% { top: 90%; }
  100% { top: 10%; }
}

.scan-progress-bar-wrap {
  width: 80%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  position: absolute;
  bottom: 1.5rem;
  z-index: 15;
  overflow: hidden;
  display: none;
}

.scan-progress-bar {
  width: 0%;
  height: 100%;
  background: var(--accent-gradient);
  transition: width 0.1s linear;
}

/* Simulated mesh points */
.face-mesh-simulation {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 11;
  pointer-events: none;
}

/* ==========================================================================
   Upload Layout
   ========================================================================== */

.upload-card {
  max-width: 600px;
  margin: 0 auto;
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  padding: 2rem;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.upload-zone {
  width: 100%;
  height: 220px;
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius-md);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  margin-bottom: 1.5rem;
  text-align: center;
  padding: 1.5rem;
  position: relative;
}

.upload-zone:hover {
  border-color: var(--accent-primary);
  background: rgba(139, 92, 246, 0.02);
}

.upload-zone i {
  font-size: 3rem;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
}

.upload-preview-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  display: none;
  background: #000;
}

.upload-preview-container img, 
.upload-preview-container video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ==========================================================================
   Toasts & Alerts
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: rgba(20, 18, 33, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: white;
  border: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
  border-radius: 40px;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-premium);
  animation: toastSlideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.toast-error {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(28, 12, 12, 0.9);
}

.toast.toast-success {
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(10, 26, 18, 0.9);
}

@keyframes toastSlideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.app-footer {
  margin-top: auto;
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
}

/* ==========================================================================
   PWA Install Banner
   ========================================================================== */

.pwa-install-banner {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 2rem);
  max-width: 480px;
  background: rgba(20, 18, 33, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glow);
  border-radius: var(--border-radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10000;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), var(--shadow-glow);
  animation: bannerSlideDown 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bannerSlideDown {
  from { transform: translate(-50%, -120px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pwa-banner-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.pwa-banner-text {
  display: flex;
  flex-direction: column;
}

.pwa-banner-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: white;
}

.pwa-banner-subtitle {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.pwa-banner-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

/* Mobile Bottom Navigation Bar Styles */
.mobile-nav-bar {
  display: none; /* Hidden by default on desktop */
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 64px;
  background: rgba(10, 8, 18, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  justify-content: space-around;
  align-items: center;
  z-index: 999;
  padding: 0 0.5rem;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

.mobile-nav-item {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  transition: var(--transition-smooth);
  flex: 1;
  height: 100%;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 600;
}

.mobile-nav-item i {
  font-size: 1.25rem;
}

.mobile-nav-item.active {
  background: transparent;
  color: var(--accent-secondary);
}

.mobile-nav-item:active {
  transform: scale(0.92);
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 768px) {
  body {
    padding-bottom: 74px; /* Space for sticky bottom navigation */
  }

  .app-header {
    padding: 0.75rem 1rem;
  }
  
  .logo-text {
    font-size: 1.25rem;
  }
  
  .logo-icon {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
  
  /* Hide desktop-only controls in header on mobile */
  #feed-tab-selectors,
  #btn-nav-upload,
  #nav-auth-area {
    display: none !important;
  }
  
  .mobile-nav-bar {
    display: flex; /* Show sticky navigation at bottom */
  }
  
  .main-content {
    padding: 0.5rem 0;
  }
  
  /* Full screen vertical reels viewport on mobile */
  .reels-feed-container {
    height: calc(100dvh - 64px);
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    border: none;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
  }

  .reels-scroller {
    height: 100%;
  }
  
  .posts-container {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0;
  }

  .post-card {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .post-media-container {
    aspect-ratio: 1/1; /* Square standard on mobile for better feed scrolling */
  }

  .comments-drawer {
    max-width: 100%;
    height: 75vh;
  }

  /* Modals as bottom sheets for native mobile feel */
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal-wrapper {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    max-width: 100%;
    border-top: 1px solid var(--border-color);
    animation: modalSlideUpMobile 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.1);
  }

  @keyframes modalSlideUpMobile {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .modal-body {
    max-height: 80vh;
    padding: 1.25rem;
  }
}

