/* OSRS Tracker - Clean Social Feed Theme */

/* Import clean, modern fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Roboto+Mono:wght@400;500;600&display=swap');

/* CSS Variables - Clean Social Theme */
:root {
  /* Backgrounds */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #e9ecef;
  --bg-elevated: #ffffff;
  --bg-hover: #f1f3f5;

  /* Accent Colors - Subtle */
  --accent-primary: #1a73e8;
  --accent-hover: #1557b0;
  --accent-light: #e8f0fe;

  /* Text Colors */
  --text-primary: #1a1a1b;
  --text-secondary: #7c7c7c;
  --text-tertiary: #a8a8a8;
  --text-link: #0079d3;

  /* Border & Divider */
  --border-color: #e0e0e0;
  --divider-color: #edeff1;

  /* Status Colors */
  --success: #46a758;
  --success-bg: #ebf9ed;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --error: #dc2626;
  --error-bg: #fee2e2;
  --info: #0ea5e9;
  --info-bg: #e0f2fe;

  /* Social Interaction */
  --upvote: #ff4500;
  --upvote-filled: #cc3700;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #1a1a1b;
    --bg-secondary: #0d0d0e;
    --bg-tertiary: #272729;
    --bg-elevated: #1a1a1b;
    --bg-hover: #272729;

    --accent-primary: #0079d3;
    --accent-hover: #3393dd;
    --accent-light: #1a1a1b;

    --text-primary: #d7dadc;
    --text-secondary: #818384;
    --text-tertiary: #6a6a6b;
    --text-link: #4fbcff;

    --border-color: #343536;
    --divider-color: #343536;

    --success-bg: #1a3320;
    --warning-bg: #3d2e00;
    --error-bg: #3d1313;
    --info-bg: #0d2f3f;
  }
}

/* Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', 'Roboto', sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Prevent zoom on touch devices */
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

body {
  background: var(--bg-secondary);
  min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

h1 {
  font-size: 1.75rem;
  font-weight: 700;
}

h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  text-decoration: underline;
}

/* Monospace for stats/numbers */
.stat-number, .mono {
  font-family: 'Roboto Mono', monospace;
  font-variant-numeric: tabular-nums;
}

/* Card System - Clean & Minimal */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.card:hover {
  border-color: var(--text-tertiary);
}

/* Feed Post Card */
.feed-post {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin-bottom: 10px;
  transition: box-shadow 0.2s;
  position: relative;
}

.feed-post:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Vote Sidebar */
.vote-sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  min-width: 40px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
}

.upvote-btn {
  cursor: pointer;
  color: var(--text-tertiary);
  transition: color 0.1s;
}

.upvote-btn:hover {
  color: var(--upvote);
}

.vote-count {
  font-size: 0.875rem;
  font-weight: 700;
  margin: 4px 0;
  color: var(--text-primary);
}

/* Button Styles - Clean */
.btn {
  font-family: inherit;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  background: var(--accent-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: transparent;
  color: var(--accent-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-hover);
}

.btn-danger {
  background: var(--error);
  color: white;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #3d8b49;
}

/* Badge System - Subtle */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid;
}

.badge-success {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-bg);
  border-color: var(--warning);
  color: var(--warning);
}

.badge-error {
  background: var(--error-bg);
  border-color: var(--error);
  color: var(--error);
}

.badge-info {
  background: var(--info-bg);
  border-color: var(--info);
  color: var(--info);
}

.badge-neutral {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
  color: var(--text-secondary);
}

/* Input Styles */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
select,
textarea {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 16px; /* Minimum 16px prevents iOS zoom on focus */
  transition: all 0.2s;
  -webkit-appearance: none; /* Remove iOS default styling */
  appearance: none;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 1px var(--accent-primary);
}

input::placeholder {
  color: var(--text-tertiary);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 12px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 6px;
  border: 3px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* Notification Badge */
.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--upvote);
  color: white;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* Video/Image Viewer */
video, img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

/* Feed Item Types */
.feed-item-levelup {
  border-left: 3px solid var(--success);
}

.feed-item-quest {
  border-left: 3px solid var(--warning);
}

.feed-item-loot {
  border-left: 3px solid var(--info);
}

.feed-item-death {
  border-left: 3px solid var(--error);
}

/* Divider */
.divider {
  height: 1px;
  background: var(--divider-color);
  margin: 16px 0;
}

/* Avatar/User */
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

/* Metadata text */
.meta-text {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

/* Hover card effect */
.hover-card {
  transition: transform 0.2s, box-shadow 0.2s;
}

.hover-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
  border-radius: 4px;
}

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

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 3rem;
  color: var(--text-tertiary);
  margin-bottom: 16px;
  opacity: 0.5;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 16px;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 8px 0;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
  html {
    font-size: 13px;
  }

  .vote-sidebar {
    display: none;
  }

  h1 {
    font-size: 1.5rem;
  }
}

/* Utility Classes */
.text-muted { color: var(--text-secondary); }
.text-subtle { color: var(--text-tertiary); }
.text-error { color: var(--error); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }

.bg-subtle { background: var(--bg-secondary); }
.bg-elevated { background: var(--bg-elevated); }

.border-bottom { border-bottom: 1px solid var(--divider-color); }
.border-top { border-top: 1px solid var(--divider-color); }

/* Remove animations for reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* Turbo Native iOS App Styles */
body.turbo-native-ios nav {
  display: none !important;
}

body.turbo-native-ios > footer,
body.turbo-native-ios main > footer {
  display: none !important;
}

body.turbo-native-ios main {
  padding-top: 8px;
  min-height: calc(100vh - 8px);
}

/* Add safe area padding for iOS notch/home indicator */
body.turbo-native-ios {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Collapsible Sections */
details.card summary {
  user-select: none;
}

details.card summary::-webkit-details-marker {
  display: none;
}

details.card[open] .collapse-icon {
  transform: rotate(180deg);
}

details.card summary:hover {
  background: var(--bg-hover);
  margin: -16px;
  padding: 16px;
}

/* ========================================
   Bingo Live Toast Notifications
   ======================================== */
#bingo-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.bingo-toast {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 10px 15px -3px rgba(0, 0, 0, 0.15),
    0 20px 25px -5px rgba(0, 0, 0, 0.1);
  pointer-events: auto;
  animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 380px;
  backdrop-filter: blur(10px);
}

.bingo-toast.completed {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  border-color: #15803d;
  color: white;
}

.bingo-toast.completed .toast-icon {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.bingo-toast .toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--accent-light);
  color: var(--accent-primary);
  flex-shrink: 0;
}

.bingo-toast .toast-icon .material-icons {
  font-size: 22px;
}

.bingo-toast .toast-content {
  flex: 1;
  min-width: 0;
}

.bingo-toast .toast-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 2px;
  color: var(--text-primary);
}

.bingo-toast.completed .toast-title {
  color: white;
}

.bingo-toast .toast-message {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bingo-toast.completed .toast-message {
  color: rgba(255, 255, 255, 0.85);
}

.bingo-toast .toast-progress {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-tertiary);
  background: var(--bg-secondary);
  padding: 4px 8px;
  border-radius: 6px;
  margin-top: 6px;
}

.bingo-toast.completed .toast-progress {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.bingo-toast .toast-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
}

.bingo-toast:hover .toast-close {
  opacity: 1;
}

.bingo-toast .toast-close:hover {
  background: var(--bg-hover);
}

.bingo-toast.completed .toast-close {
  color: rgba(255, 255, 255, 0.7);
}

.bingo-toast.completed .toast-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

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

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

.bingo-toast.toast-exit {
  animation: toastSlideOut 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Bingo Live Feed Styles */
#bingo-live-feed {
  max-height: 400px;
  overflow-y: auto;
}

.bingo-feed-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--divider-color);
  transition: background 0.2s;
}

.bingo-feed-item:last-child {
  border-bottom: none;
}

.bingo-feed-item:hover {
  background: var(--bg-hover);
}

.bingo-feed-item .feed-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bingo-feed-item .feed-item-icon .material-icons {
  font-size: 18px;
  color: var(--accent-primary);
}

.bingo-feed-item.completed .feed-item-icon {
  background: var(--success-bg);
}

.bingo-feed-item.completed .feed-item-icon .material-icons {
  color: var(--success);
}

.bingo-feed-item .feed-item-content {
  flex: 1;
  font-size: 0.85rem;
  line-height: 1.4;
}

.bingo-feed-item .feed-item-content strong {
  color: var(--text-primary);
}

.bingo-feed-item .feed-tile-name {
  color: var(--accent-primary);
  font-weight: 500;
}

.bingo-feed-item .feed-count {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.bingo-feed-item .feed-item-time {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.bingo-feed-item.highlight-new {
  animation: feedHighlight 2s ease-out;
}

@keyframes feedHighlight {
  0% { background: var(--accent-light); }
  100% { background: transparent; }
}

/* Mobile toast adjustments */
@media (max-width: 768px) {
  #bingo-toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .bingo-toast {
    max-width: none;
  }
}

/* ========================================
   TikTok/Reels Style Feed View
   ======================================== */

/* View toggle button */
.feed-view-toggle {
  display: flex;
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
}

.feed-view-toggle button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}

.feed-view-toggle button:hover {
  color: var(--text-primary);
}

.feed-view-toggle button.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.feed-view-toggle button .material-icons {
  font-size: 18px;
}

/* Reels mode - fullscreen takeover */
body.reels-mode {
  overflow: hidden;
}

body.reels-mode .navbar,
body.reels-mode .quick-actions,
body.reels-mode .feed-header,
body.reels-mode .bingo-timeline,
body.reels-mode #list-view {
  display: none !important;
}

body.reels-mode #reels-view {
  display: block !important;
}

#reels-view {
  display: none;
}

/* Reels container */
.reels-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  background: #000;
  z-index: 9999;
  -webkit-overflow-scrolling: touch;
}

.reels-container::-webkit-scrollbar {
  display: none;
}

/* Individual reel item */
.reel-item {
  position: relative;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #000;
  overflow: hidden;
}

/* =====================================================
   iOS NATIVE APP - adjust for bottom tab bar (49px)
   ===================================================== */
body.ios-native-app .reels-container {
  bottom: calc(49px + env(safe-area-inset-bottom, 0px));
}

body.ios-native-app .reel-item {
  height: calc(100vh - 49px - env(safe-area-inset-bottom, 0px));
  height: calc(100dvh - 49px - env(safe-area-inset-bottom, 0px));
}

body.ios-native-app .reel-content {
  padding-bottom: 16px;
}

body.ios-native-app .reel-actions {
  bottom: 100px;
}

body.ios-native-app .reel-progress {
  bottom: 0;
}

/* Media (video/image) */
.reel-media {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reel-video,
.reel-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* iOS: prevent native fullscreen and hide ALL default controls */
.reel-video {
  -webkit-appearance: none;
  background: #000;
  /* Prevent text selection which can trigger iOS menus */
  -webkit-user-select: none;
  user-select: none;
  /* Prevent touch callout */
  -webkit-touch-callout: none;
}

/* Hide ALL webkit media controls */
.reel-video::-webkit-media-controls {
  display: none !important;
  -webkit-appearance: none;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.reel-video::-webkit-media-controls-enclosure {
  display: none !important;
  opacity: 0;
}

.reel-video::-webkit-media-controls-panel {
  display: none !important;
  opacity: 0;
}

.reel-video::-webkit-media-controls-play-button {
  display: none !important;
  -webkit-appearance: none;
  opacity: 0;
}

.reel-video::-webkit-media-controls-start-playback-button {
  display: none !important;
  -webkit-appearance: none;
  opacity: 0;
}

.reel-video::-webkit-media-controls-fullscreen-button {
  display: none !important;
  opacity: 0;
}

.reel-video::-webkit-media-controls-current-time-display,
.reel-video::-webkit-media-controls-time-remaining-display,
.reel-video::-webkit-media-controls-timeline,
.reel-video::-webkit-media-controls-volume-slider,
.reel-video::-webkit-media-controls-mute-button,
.reel-video::-webkit-media-controls-toggle-closed-captions-button,
.reel-video::-webkit-media-controls-overlay-play-button {
  display: none !important;
  opacity: 0;
}

/* Additional iOS-specific fixes */
video.reel-video {
  object-fit: cover;
  pointer-events: auto;
}

.reel-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: rgba(255,255,255,0.5);
}

.reel-placeholder .material-icons {
  font-size: 80px;
  margin-bottom: 16px;
}

.reel-placeholder p {
  font-size: 1.125rem;
}

/* Video placeholder - shown before video is created on tap */
.reel-video-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  cursor: pointer;
}

.reel-video-placeholder .material-icons {
  font-size: 80px;
  color: white;
  opacity: 0.9;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

/* Tap zone for play/pause */
.reel-tap-zone {
  position: absolute;
  top: 0;
  left: 0;
  right: 80px;
  bottom: 100px;
  z-index: 10;
}

/* Play/Pause indicators */
.reel-play-indicator,
.reel-pause-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  width: 80px;
  height: 80px;
  background: rgba(0,0,0,0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 20;
}

.reel-play-indicator .material-icons,
.reel-pause-indicator .material-icons {
  font-size: 40px;
  color: white;
}

/* iOS tap to start overlay */
.reel-ios-start {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(0,0,0,0.7);
  z-index: 30;
  cursor: pointer;
}

.reel-ios-start .material-icons {
  font-size: 80px;
  color: white;
}

.reel-ios-start span:last-child {
  font-size: 1.125rem;
  color: white;
  font-weight: 500;
}

.reel-play-indicator.show,
.reel-pause-indicator.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Gradient overlay for text */
.reel-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
  pointer-events: none;
  z-index: 5;
}

/* Content overlay */
.reel-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 80px;
  padding: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0));
  z-index: 15;
  color: white;
}

/* User info */
.reel-user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.reel-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--info));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: white;
  border: 2px solid white;
}

.reel-user-info {
  display: flex;
  flex-direction: column;
}

.reel-username {
  font-weight: 700;
  font-size: 1rem;
}

.reel-group {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.7);
}

/* Message */
.reel-message {
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 8px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* Timestamp */
.reel-time {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
}

.reel-time .material-icons {
  font-size: 14px;
}

/* Side actions (TikTok style) */
.reel-actions {
  position: absolute;
  right: 12px;
  bottom: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  z-index: 20;
}

.reel-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.reel-action-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.reel-action-btn:hover {
  transform: scale(1.1);
  background: rgba(255,255,255,0.25);
}

.reel-action-btn:active {
  transform: scale(0.95);
}

.reel-action-btn .material-icons {
  font-size: 24px;
  color: white;
}

.reel-action-btn.event-type-btn {
  width: 52px;
  height: 52px;
}

.reel-action-btn.event-type-btn .material-icons {
  font-size: 26px;
}

.reel-action-label {
  font-size: 0.7rem;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Progress bar */
.reel-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255,255,255,0.2);
  z-index: 25;
}

.reel-progress-bar {
  height: 100%;
  background: white;
  width: 0%;
  transition: width 0.1s linear;
}

/* Navigation dots */
.reels-nav-dots {
  position: fixed;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
}

.nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  transition: all 0.3s;
}

.nav-dot.active {
  background: white;
  transform: scale(1.3);
}

/* Close button */
.reels-close-btn {
  position: fixed;
  top: 16px;
  top: calc(16px + env(safe-area-inset-top, 0));
  left: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10000;
  transition: transform 0.2s, background 0.2s;
}

.reels-close-btn:hover {
  transform: scale(1.1);
  background: rgba(0,0,0,0.7);
}

.reels-close-btn .material-icons {
  font-size: 24px;
  color: white;
}

/* Desktop adjustments - show reels in center */
@media (min-width: 768px) {
  .reels-container {
    max-width: 420px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 0;
    box-shadow: 0 0 100px rgba(0,0,0,0.8);
  }

  .reels-nav-dots {
    right: calc(50% - 230px);
  }

  .reels-close-btn {
    left: calc(50% - 190px);
  }
}

/* ========================================
   Responsive Navigation
   ======================================== */

.main-nav {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Logo */
.nav-logo {
  text-decoration: none;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav-logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
}

@media (min-width: 480px) {
  .nav-logo-text {
    font-size: 1.5rem;
  }
}

/* Desktop Navigation Links */
.nav-links {
  display: none;
  align-items: center;
  gap: 8px;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  text-decoration: none;
}

.nav-link.active {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-link .material-icons {
  font-size: 1.25rem;
}

/* Right Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s;
}

.nav-icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-icon-btn .material-icons {
  font-size: 1.25rem;
}

.nav-avatar-link {
  text-decoration: none;
}

.nav-logout-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px 12px;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.2s;
}

.nav-logout-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.desktop-only {
  display: none;
}

@media (min-width: 768px) {
  .desktop-only {
    display: flex;
  }
}

/* Hamburger Button */
.nav-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s;
}

.nav-hamburger:hover {
  background: var(--bg-hover);
}

@media (min-width: 768px) {
  .nav-hamburger {
    display: none;
  }
}

.hamburger-line {
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger-line:nth-child(1) {
  margin-bottom: 5px;
}

.hamburger-line:nth-child(3) {
  margin-top: 5px;
}

/* Hamburger Animation */
.nav-hamburger.active .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-hamburger.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: translateX(-10px);
}

.nav-hamburger.active .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Drawer */
.mobile-drawer {
  position: fixed;
  top: 56px;
  right: 0;
  bottom: 0;
  width: 280px;
  max-width: calc(100vw - 60px);
  background: var(--bg-elevated);
  border-left: 1px solid var(--border-color);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 1000;
  overflow-y: auto;
}

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

@media (min-width: 768px) {
  .mobile-drawer {
    display: none;
  }
}

.mobile-drawer-content {
  display: flex;
  flex-direction: column;
  min-height: calc(100% - 56px);
}

.mobile-nav-links {
  flex: 1;
  padding: 16px 0;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s;
}

.mobile-nav-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  text-decoration: none;
}

.mobile-nav-link.active {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-left: 3px solid var(--accent-primary);
}

.mobile-nav-link .material-icons {
  font-size: 1.5rem;
}

.mobile-badge {
  margin-left: auto;
  background: var(--upvote);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.mobile-drawer-footer {
  border-top: 1px solid var(--border-color);
  padding: 16px;
}

.mobile-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.mobile-logout-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.mobile-logout-btn .material-icons {
  font-size: 1.25rem;
}

/* Mobile Overlay */
.mobile-overlay {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 999;
}

.mobile-overlay.open {
  opacity: 1;
  visibility: visible;
}

@media (min-width: 768px) {
  .mobile-overlay {
    display: none;
  }
}

/* Prevent body scroll when menu open */
body.menu-open {
  overflow: hidden;
}

@media (min-width: 768px) {
  body.menu-open {
    overflow: auto;
  }
}
