:root, [data-theme="light"] {
  --bg-main: #fdfdfe;
  --bg-card: #ffffff;
  --bg-card-hover: #f8faff;
  --bg-surface: #f1f5f9;
  --bg-input: #ffffff;
  --border-color: #e2e8f0;
  --border-subtle: #ede9fe;
  --border-focus: #8b5cf6;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --primary-purple: #8b5cf6;
  --primary-gradient: linear-gradient(135deg, #a855f7 0%, #8b5cf6 50%, #6366f1 100%);
  --primary-shadow: 0 4px 16px rgba(139, 92, 246, 0.35);
  --accent-orange: #f59e0b;
  --card-shadow: 0 10px 25px -5px rgba(124, 58, 237, 0.07), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
  --nav-bg: rgba(253, 253, 254, 0.9);
  --modal-bg: rgba(0, 0, 0, 0.9);
  --tag-bg: #f8fafc;
  --tag-border: #e2e8f0;
  --tag-hover: #ede9fe;
}

[data-theme="dark"] {
  --bg-main: #090b14;
  --bg-card: #111422;
  --bg-card-hover: #171c2e;
  --bg-surface: #191e30;
  --bg-input: #111422;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(139, 92, 246, 0.25);
  --border-focus: #a855f7;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --primary-purple: #a855f7;
  --primary-gradient: linear-gradient(135deg, #a855f7 0%, #8b5cf6 50%, #6366f1 100%);
  --primary-shadow: 0 4px 20px rgba(168, 85, 247, 0.4);
  --accent-orange: #fbbf24;
  --card-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
  --nav-bg: rgba(9, 11, 20, 0.9);
  --modal-bg: rgba(0, 0, 0, 0.92);
  --tag-bg: #151928;
  --tag-border: rgba(255, 255, 255, 0.1);
  --tag-hover: #1f253d;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.2s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Background watermark graphic */
.ambient-watermark {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle at 50% 20%, rgba(139, 92, 246, 0.04) 0%, transparent 60%);
  z-index: 0;
}

.app-layout {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header Navbar */
.navbar {
  border-bottom: 1px solid var(--border-color);
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 2px 10px rgba(139, 92, 246, 0.35);
}

.logo-icon svg {
  width: 18px;
  height: 18px;
}

.brand-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.brand-badge {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  background: var(--primary-light);
  color: var(--primary-purple);
  border: 1px solid rgba(139, 92, 246, 0.25);
  text-transform: uppercase;
  user-select: none;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.control-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.control-btn svg {
  width: 18px;
  height: 18px;
}

.control-btn:hover {
  border-color: var(--primary-purple);
  color: var(--primary-purple);
  transform: translateY(-1px);
}

/* Main Content */
.main-content {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  padding: 3rem 1.5rem 5rem;
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 2.5rem 0 2rem;
}

.hero-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

/* Signature Orange Underline Brush */
.orange-underline {
  position: relative;
  display: inline-block;
  color: var(--text-primary);
}

.orange-underline::after {
  content: '';
  position: absolute;
  left: -2px;
  right: -2px;
  bottom: 2px;
  height: 6px;
  background: var(--accent-orange);
  border-radius: 4px;
  z-index: -1;
  transform: rotate(-0.8deg);
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  max-width: 660px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

/* Search Card Container */
.search-container {
  max-width: 760px;
  margin: 0 auto;
}

.search-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 1.25rem;
  padding: 0.45rem 0.5rem 0.45rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  box-shadow: var(--card-shadow);
  transition: all 0.25s ease;
}

.search-form-card:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 12px 35px -5px rgba(139, 92, 246, 0.18), 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.search-prefix-icon {
  color: var(--primary-purple);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.search-prefix-icon svg {
  width: 20px;
  height: 20px;
}

.search-form-card input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.98rem;
  color: var(--text-primary);
  min-width: 0;
}

.search-form-card input::placeholder {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.paste-action-btn, .clear-action-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.paste-action-btn:hover, .clear-action-btn:hover {
  background: var(--tag-hover);
  color: var(--primary-purple);
  border-color: var(--primary-purple);
}

.paste-action-btn svg, .clear-action-btn svg {
  width: 17px;
  height: 17px;
}

.search-submit-btn {
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  padding: 0.75rem 1.6rem;
  border-radius: 11px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--primary-shadow);
  flex-shrink: 0;
  transition: all 0.25s ease;
}

.btn-search-icon {
  width: 16px;
  height: 16px;
}

.search-submit-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.search-submit-btn:active {
  transform: translateY(1px);
}

.search-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Sparkle Note Under Search */
.search-note {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  color: var(--primary-purple);
  font-size: 0.85rem;
  font-weight: 500;
}

.search-note svg {
  width: 16px;
  height: 16px;
}

/* Quick Test Tags */
.quick-tags {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tags-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.tag-pill {
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.32rem 0.75rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tag-pill:hover {
  background: var(--tag-hover);
  color: var(--primary-purple);
  border-color: var(--primary-purple);
  transform: translateY(-1px);
}

/* Feedback Banner */
.status-banner {
  max-width: 760px;
  margin: 1.5rem auto 0;
  padding: 0.9rem 1.2rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  animation: fadeIn 0.3s ease;
}

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

.status-content {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.status-banner.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #ef4444;
}

.status-banner.warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #d97706;
}

.close-banner-btn {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 1.25rem;
  cursor: pointer;
}

/* Skeleton Loading */
.loading-state {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-card-hover) 50%, var(--bg-surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 12px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-profile {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 1rem;
  border: 1px solid var(--border-color);
}

.skeleton-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skeleton-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.skeleton-line {
  height: 16px;
}

.title-line { width: 45%; height: 22px; }
.sub-line { width: 70%; }

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
}

.skeleton-card {
  aspect-ratio: 9 / 16;
  border-radius: 12px;
}

/* Results Section */
.results-section {
  margin-top: 3rem;
  animation: fadeIn 0.4s ease;
}

/* Profile Card */
.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1.25rem;
  padding: 1.75rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  box-shadow: var(--card-shadow);
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
}

.profile-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-gradient);
}

.profile-avatar-wrapper {
  flex-shrink: 0;
}

.avatar-ring {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  padding: 3px;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--primary-shadow);
}

.profile-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-surface);
  border: 2px solid var(--bg-card);
}

.profile-details {
  flex: 1;
  min-width: 0;
}

.profile-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.profile-username {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 9999px;
}

.badge-private {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge-stories {
  background: rgba(139, 92, 246, 0.12);
  color: var(--primary-purple);
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.profile-fullname {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.profile-bio {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
  max-width: 600px;
}

.profile-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.action-btn-primary {
  margin-left: auto;
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1.4rem;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--primary-shadow);
  transition: all 0.25s ease;
}

.action-btn-primary svg {
  width: 15px;
  height: 15px;
}

.action-btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

/* Stories Grid Header */
.grid-header {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.grid-title h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}

.expiry-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

/* Stories Grid Cards */
.stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 1.25rem;
}

.story-card {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--card-shadow);
}

.story-card:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--primary-purple);
  box-shadow: 0 14px 30px rgba(139, 92, 246, 0.2);
}

.story-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.story-card:hover .story-thumbnail {
  transform: scale(1.06);
}

.story-type-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  color: #fff;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  z-index: 2;
}

.story-type-badge svg {
  width: 12px;
  height: 12px;
}

.story-time-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.95);
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  z-index: 2;
}

.story-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.85) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 3;
}

.story-card:hover .story-overlay {
  opacity: 1;
}

.overlay-actions {
  display: flex;
  gap: 0.5rem;
}

.card-action-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 0.5rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all 0.2s;
}

.card-action-btn:hover {
  background: #fff;
  color: #000;
}

.card-action-btn.primary {
  background: var(--primary-gradient);
  border: none;
}

.card-action-btn.primary:hover {
  filter: brightness(1.15);
  color: #fff;
}

/* ========================================================
   FOOTER
   ======================================================== */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
  padding: 3.5rem 1.5rem 2.75rem;
  text-align: center;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.footer-content {
  max-width: 650px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.footer-credit {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.heart-pulse {
  display: inline-block;
  color: #ef4444;
  font-size: 1.15rem;
  animation: heartBeat 1.4s ease-in-out infinite;
  transform-origin: center;
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.28); }
  30% { transform: scale(1); }
  45% { transform: scale(1.2); }
}

.footer-author-link {
  color: var(--primary-purple);
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
  font-weight: 800;
  position: relative;
  transition: opacity 0.2s ease, transform 0.2s ease;
  display: inline-flex;
  align-items: center;
}

.footer-author-link:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.footer-author-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary-gradient);
  border-radius: 2px;
  transform: scaleX(0.92);
  transition: transform 0.2s ease;
}

.footer-author-link:hover::after {
  transform: scaleX(1.05);
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 500;
}

.footer-meta .bullet {
  color: var(--border-color);
  font-size: 0.65rem;
}

.footer-disclaimer {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 0;
  line-height: 1.5;
}

/* ========================================================
   FULLSCREEN INSTAGRAM STORY VIEWER MODAL
   ======================================================== */
.story-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--modal-bg);
  backdrop-filter: blur(20px);
}

.modal-container {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 1.5rem;
}

.story-frame {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 9 / 16;
  max-height: 88vh;
  background: #000;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  user-select: none;
}

.progress-bar-container {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 4px;
  z-index: 20;
}

.progress-segment {
  flex: 1;
  height: 2.5px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0%;
  background: #ffffff;
  border-radius: 2px;
  transition: width 0.05s linear;
}

.progress-segment.completed .progress-fill {
  width: 100% !important;
}

.story-header {
  position: absolute;
  top: 24px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 20;
}

.story-author {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.modal-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #fff;
}

.story-meta {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.modal-username {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.modal-time {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.story-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.modal-action-btn {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-action-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.06);
}

.modal-action-btn svg {
  width: 15px;
  height: 15px;
}

.story-media-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.story-media {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.media-spinner {
  position: absolute;
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  z-index: 10;
}

.tap-zone {
  position: absolute;
  top: 60px;
  bottom: 0;
  z-index: 15;
  cursor: pointer;
}

.tap-left { left: 0; width: 35%; }
.tap-right { right: 0; width: 65%; }

.desktop-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 30;
}

.desktop-nav-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%) scale(1.1);
}

.prev-btn { left: -65px; }
.next-btn { right: -65px; }

.desktop-nav-btn svg { width: 24px; height: 24px; }

.keyboard-hints {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.keyboard-hints kbd {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--text-secondary);
}

.hidden { display: none !important; }

/* Responsive Media Queries */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .main-content {
    padding: 1.5rem 1rem 3rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  .search-form-card {
    flex-wrap: wrap;
    padding: 0.75rem;
  }

  .search-prefix-icon {
    display: none;
  }

  .search-submit-btn {
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
  }

  .profile-card {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem 1rem;
    gap: 1.25rem;
  }

  .profile-title-row {
    justify-content: center;
  }

  .profile-stats {
    justify-content: center;
  }

  .action-btn-primary {
    margin: 0.5rem auto 0;
    width: 100%;
    justify-content: center;
  }

  .stories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .desktop-nav-btn {
    display: none;
  }

  .story-frame {
    max-width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .modal-container {
    padding: 0;
  }

  .keyboard-hints {
    display: none;
  }
}

/* -------------------------------------------------------------
   TOOL MODE SWITCHER TABS
------------------------------------------------------------- */
.tool-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card);
  padding: 0.35rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
  margin-bottom: 1.5rem;
}

.tool-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.25rem;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.tool-tab svg {
  width: 17px;
  height: 17px;
}

.tool-tab:hover {
  color: var(--text-primary);
  background: rgba(139, 92, 246, 0.08);
}

.tool-tab.active {
  background: var(--primary-gradient);
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(139, 92, 246, 0.35);
}

.tool-tab.active svg {
  stroke: #ffffff;
}

.pill-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

[data-theme="light"] .tool-tab:not(.active) .pill-badge {
  background: rgba(139, 92, 246, 0.12);
  color: var(--primary-purple);
}

/* -------------------------------------------------------------
   HD PROFILE PICTURE SHOWCASE (PROFILE MODE)
------------------------------------------------------------- */
.profile-pic-section {
  width: 100%;
  max-width: 680px;
  margin: 1.5rem auto 3.5rem;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.hd-profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 2.25rem 2rem;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hd-profile-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-gradient);
}

.hd-profile-header {
  margin-bottom: 1.5rem;
  width: 100%;
}

.hd-badge-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.badge-hd-live {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(239, 68, 68, 0.15));
  color: var(--accent-orange);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-hd-live .badge-icon {
  width: 13px;
  height: 13px;
  color: var(--accent-orange);
}

.badge-status-online {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.badge-status-private {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.hd-profile-username {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}

.hd-profile-fullname {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Avatar Display with Glow & Zoom */
.hd-avatar-display-box {
  position: relative;
  width: 260px;
  height: 260px;
  margin: 0.5rem auto 1.75rem;
  border-radius: 50%;
  padding: 6px;
  background: linear-gradient(135deg, #f59e0b, #ec4899, #8b5cf6);
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.25);
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.hd-avatar-display-box:hover {
  transform: scale(1.03);
  box-shadow: 0 14px 40px rgba(139, 92, 246, 0.4);
}

.hd-profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--bg-card);
  display: block;
}

.hd-avatar-zoom-overlay {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.hd-avatar-zoom-overlay svg {
  width: 28px;
  height: 28px;
}

.hd-avatar-display-box:hover .hd-avatar-zoom-overlay {
  opacity: 1;
}

/* Meta Stats */
.hd-profile-meta-row {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
  width: 100%;
}

.hd-meta-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.6rem 1.25rem;
  background: var(--bg-surface);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  min-width: 110px;
}

.hd-meta-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.hd-meta-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.hd-meta-val.highlight {
  color: var(--primary-purple);
}

.hd-profile-bio {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 500px;
  margin: 0 auto 1.75rem;
  white-space: pre-line;
}

/* Action Group */
.hd-actions-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 400px;
}

.btn-download-hd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background: var(--primary-gradient);
  color: #ffffff;
  padding: 0.95rem 1.75rem;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--primary-shadow);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-download-hd svg {
  width: 20px;
  height: 20px;
}

.btn-download-hd:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.45);
  color: #ffffff;
}

.btn-secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--text-secondary);
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary-link svg {
  width: 16px;
  height: 16px;
}

.btn-secondary-link:hover {
  background: var(--bg-surface);
  color: var(--primary-purple);
  border-color: var(--border-subtle);
}

/* Avatar Zoom Hint in Story Mode Profile Card */
.profile-avatar-wrapper {
  position: relative;
  cursor: pointer;
}

.avatar-hover-zoom {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.avatar-hover-zoom svg {
  width: 22px;
  height: 22px;
}

.profile-avatar-wrapper:hover .avatar-hover-zoom {
  opacity: 1;
}

.avatar-hd-badge {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary-gradient);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(139, 92, 246, 0.4);
  letter-spacing: 0.5px;
}

.action-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.65rem 1.15rem;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn-secondary svg {
  width: 16px;
  height: 16px;
}

.action-btn-secondary:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: var(--border-subtle);
  color: var(--primary-purple);
}

/* -------------------------------------------------------------
   FULLSCREEN HD IMAGE LIGHTBOX MODAL
------------------------------------------------------------- */
.image-lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.25s ease forwards;
}

.image-lightbox-modal.hidden {
  display: none;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(12px);
}

.lightbox-dialog {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-close-btn {
  position: absolute;
  top: -48px;
  right: 0;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lightbox-close-btn svg {
  width: 20px;
  height: 20px;
}

.lightbox-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.lightbox-image-container {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 600px;
  max-height: 600px;
  width: 85vw;
  height: 85vw;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.15);
  background: #000000;
}

.lightbox-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lightbox-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 600px;
  margin-top: 1rem;
  padding: 0.5rem 0.25rem;
}

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

.lightbox-username {
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 700;
}

.lightbox-res-badge {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-orange);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.lightbox-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary-gradient);
  color: #ffffff;
  padding: 0.65rem 1.35rem;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
  transition: all 0.2s ease;
}

.lightbox-download-btn svg {
  width: 17px;
  height: 17px;
}

.lightbox-download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
  color: #ffffff;
}

@media (max-width: 640px) {
  .hd-profile-card {
    padding: 1.5rem 1rem;
  }

  .hd-avatar-display-box {
    width: 200px;
    height: 200px;
  }

  .hd-profile-meta-row {
    flex-direction: row;
    gap: 0.5rem;
  }

  .hd-meta-item {
    min-width: 80px;
    padding: 0.5rem 0.75rem;
  }

  .lightbox-image-container {
    max-width: 90vw;
    max-height: 90vw;
    width: 90vw;
    height: 90vw;
  }

  .lightbox-footer {
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
  }
}

/* -------------------------------------------------------------
   4-TAB SELECTOR REFINEMENT
------------------------------------------------------------- */
.tool-tabs {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.tool-tabs::-webkit-scrollbar {
  display: none;
}

/* -------------------------------------------------------------
   POSTS GRID & CARDS (POSTS MODE)
------------------------------------------------------------- */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.35rem;
  margin-top: 1.5rem;
}

.post-card {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  box-shadow: var(--card-shadow);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 35px -5px rgba(139, 92, 246, 0.25);
  border-color: var(--primary-purple);
}

.post-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.post-card:hover .post-thumbnail {
  transform: scale(1.05);
}

.post-type-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.post-type-badge svg {
  width: 13px;
  height: 13px;
}

.post-time-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  color: #e2e8f0;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  z-index: 2;
}

.post-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.92) 0%, rgba(15, 23, 42, 0.4) 50%, rgba(15, 23, 42, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.1rem;
  z-index: 3;
}

.post-card:hover .post-overlay {
  opacity: 1;
}

.post-metrics-hover {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  margin: auto 0;
}

.post-metric-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.post-metric-pill svg {
  width: 18px;
  height: 18px;
}

.post-overlay-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
}

.post-overlay-actions .card-action-btn {
  flex: 1;
}

/* -------------------------------------------------------------
   REELS GRID & CARDS (REELS MODE)
------------------------------------------------------------- */
.reels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.35rem;
  margin-top: 1.5rem;
}

.reel-card {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: 18px;
  overflow: hidden;
  background: #0b0f19;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  box-shadow: var(--card-shadow);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

.reel-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px -5px rgba(139, 92, 246, 0.3);
  border-color: var(--primary-purple);
}

.reel-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.reel-card:hover .reel-thumbnail {
  transform: scale(1.05);
}

.reel-play-pill {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.reel-play-pill svg {
  width: 12px;
  height: 12px;
  fill: #ffffff;
}

.reel-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.3) 50%, rgba(15, 23, 42, 0.15) 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.1rem;
  z-index: 3;
}

.reel-card:hover .reel-overlay {
  opacity: 1;
}

.reel-hover-center-btn {
  align-self: center;
  margin: auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
  transform: scale(0.9);
  transition: transform 0.2s ease;
}

.reel-card:hover .reel-hover-center-btn {
  transform: scale(1);
}

.reel-hover-center-btn svg {
  width: 22px;
  height: 22px;
  margin-left: 2px;
}

.reel-caption-preview {
  color: #e2e8f0;
  font-size: 0.8rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.6rem;
}

/* -------------------------------------------------------------
   INTERACTIVE POST VIEWER MODAL
------------------------------------------------------------- */
.post-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.25s ease;
}

.post-modal.hidden {
  display: none !important;
}

.post-modal-container {
  position: relative;
  width: min(1050px, 94vw);
  max-height: 90vh;
  z-index: 1001;
  display: flex;
  flex-direction: column;
}

.modal-close-icon {
  position: absolute;
  top: -42px;
  right: 0;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close-icon:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.08);
}

.modal-close-icon svg {
  width: 18px;
  height: 18px;
}

.post-dialog {
  display: flex;
  background: var(--bg-card);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.5);
  max-height: 85vh;
}

.post-media-area {
  flex: 1.35;
  background: #090d16;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 450px;
  overflow: hidden;
}

.post-media-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-viewer-img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  display: block;
}

.post-viewer-vid {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  outline: none;
}

.carousel-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
}

.carousel-nav-btn:hover {
  background: var(--primary-purple);
  transform: translateY(-50%) scale(1.08);
}

.carousel-nav-btn.prev { left: 14px; }
.carousel-nav-btn.next { right: 14px; }

.carousel-dots-container {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 10;
  background: rgba(15, 23, 42, 0.6);
  padding: 4px 10px;
  border-radius: 9999px;
  backdrop-filter: blur(6px);
}

.carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.2s ease;
}

.carousel-dot.active {
  background: #ffffff;
  width: 18px;
  border-radius: 9999px;
}

.carousel-counter-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  z-index: 10;
}

.post-info-sidebar {
  flex: 1;
  min-width: 300px;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  padding: 1.75rem;
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  overflow-y: auto;
}

.post-sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.post-author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-purple);
}

.post-author-meta {
  display: flex;
  flex-direction: column;
}

.post-author-name {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text-primary);
}

.post-date-tag {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.post-caption-box {
  flex: 1;
  padding: 1.25rem 0;
  overflow-y: auto;
  max-height: 250px;
}

.post-caption-text {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

.post-metrics-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  margin-top: auto;
}

.post-metric {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.post-metric svg {
  width: 18px;
  height: 18px;
  color: var(--primary-purple);
}

.post-download-action {
  padding-top: 1.25rem;
}

/* -------------------------------------------------------------
   VERTICAL REEL VIDEO MODAL
------------------------------------------------------------- */
.reel-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.25s ease;
}

.reel-modal.hidden {
  display: none !important;
}

.reel-modal-container {
  position: relative;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reel-player-box {
  position: relative;
  width: min(410px, 92vw);
  height: min(720px, 92vh);
  aspect-ratio: 9 / 16;
  border-radius: 22px;
  overflow: hidden;
  background: #000000;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.reel-video-stream {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.reel-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: all 0.2s ease;
}

.reel-close-btn:hover {
  background: rgba(239, 68, 68, 0.8);
  transform: scale(1.08);
}

.reel-close-btn svg {
  width: 18px;
  height: 18px;
}

.reel-overlay-top {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 15;
}

.reel-author-tag {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  padding: 0.25rem 0.75rem 0.25rem 0.3rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.reel-author-pic {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.reel-author-handle {
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
}

.reel-actions-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.reel-control-pill {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reel-control-pill:hover {
  background: var(--primary-purple);
  transform: scale(1.06);
}

.reel-control-pill svg {
  width: 17px;
  height: 17px;
}

.reel-center-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 12;
}

.reel-center-play svg {
  width: 28px;
  height: 28px;
  margin-left: 3px;
}

.reel-overlay-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 3rem 1.25rem 1.25rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.45) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  z-index: 15;
}

.reel-caption-line {
  color: #ffffff;
  font-size: 0.85rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.reel-stats-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.reel-stat-pill {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.reel-download-button {
  background: var(--primary-gradient);
  color: #ffffff;
  border: none;
  padding: 0.7rem 1.2rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  box-shadow: 0 4px 18px rgba(139, 92, 246, 0.5);
  transition: all 0.25s ease;
}

.reel-download-button:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.reel-download-button svg {
  width: 17px;
  height: 17px;
}

/* Responsive adjustments for Post & Reel modals */
@media (max-width: 768px) {
  .post-dialog {
    flex-direction: column;
    max-height: 90vh;
  }

  .post-media-area {
    min-height: 280px;
    max-height: 48vh;
  }

  .post-info-sidebar {
    max-width: 100%;
    border-left: none;
    border-top: 1px solid var(--border-color);
    padding: 1.25rem;
    max-height: 42vh;
  }

  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
  }

  .reels-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
  }
}


