/* public/css/mobile-app.css — NovaReelOS Mobile PWA shared styles.
   Dark theme: bg #000000, surface #161823, cyan #00F2EA, coral #FF4D6D */

/* ── Page Container ─────────────────────────────────────────────────────────── */

.mobile-page-container {
  min-height: 100vh;
  background: #000;
  color: #f0f0f0;
  font-family: 'Inter', 'DM Sans', system-ui, sans-serif;
  padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  -webkit-tap-highlight-color: transparent;
}

/* ── Header Bar ─────────────────────────────────────────────────────────────── */

.mobile-header-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 400;
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding-top: env(safe-area-inset-top, 0px);
}

.mobile-header-back {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #f0f0f0;
  text-decoration: none;
  padding: 8px;
  border-radius: 8px;
  min-height: 44px;
  min-width: 44px;
  justify-content: center;
}

.mobile-header-back:hover { background: rgba(255,255,255,0.08); }

.mobile-header-title {
  flex: 1;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  color: #f0f0f0;
  margin-right: 52px; /* balance the back button */
}

/* ── Mobile Full-Screen Sections ────────────────────────────────────────────── */

.mobile-section {
  padding: 16px;
  min-height: 100vh;
}

.mobile-section.fullscreen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ── Bottom Navigation (PWA) ────────────────────────────────────────────────── */

.mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 56px;
  background: #161823;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  color: #888;
  padding: 8px 12px;
  border-radius: 12px;
  min-width: 52px;
  flex: 1;
  transition: color 0.2s;
  min-height: 44px;
  justify-content: center;
}

.mobile-nav-item:hover { color: #f0f0f0; }

.mobile-nav-item.active {
  color: var(--coral, #FF4D6D);
}

.mobile-nav-item.active .mobile-nav-icon {
  filter: drop-shadow(0 0 6px rgba(255,77,109,0.5));
}

.mobile-nav-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* Upload FAB — centered, elevated */
.mobile-nav-center {
  position: relative;
  top: -10px;
}

.mobile-nav-center .mobile-nav-icon {
  width: 44px;
  height: 44px;
  background: #FF4D6D;
  border-radius: 50%;
  padding: 10px;
  color: #fff;
  box-shadow: 0 4px 16px rgba(255,77,109,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}

.mobile-nav-center:hover .mobile-nav-icon {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(255,77,109,0.5);
}

.mobile-nav-label {
  font-size: 0.65rem;
  font-weight: 500;
}

/* ── Notification Cards ─────────────────────────────────────────────────────── */

.notification-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: #1A1A1A;
  border-radius: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  color: inherit;
  position: relative;
  min-height: 72px;
}

.notification-card:hover { background: #222; }

.notification-card.unread {
  border-left: 3px solid #FF4D6D;
}

.notification-card .notif-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #333;
}

.notification-card .notif-avatar-initials {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #333;
  border: 1.5px solid rgba(0,242,234,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: #00F2EA;
  flex-shrink: 0;
}

.notification-card .notif-body { flex: 1; min-width: 0; }

.notification-card .notif-action {
  font-size: 0.9rem;
  color: #f0f0f0;
  line-height: 1.4;
}

.notification-card .notif-action strong {
  color: #fff;
  font-weight: 600;
}

.notification-card .notif-time {
  font-size: 0.75rem;
  color: #888;
  margin-top: 4px;
}

.notification-card .notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #FF4D6D;
  flex-shrink: 0;
  margin-top: 6px;
}

/* ── Chat Bubbles ───────────────────────────────────────────────────────────── */

.chat-bubble-wrap {
  display: flex;
  margin-bottom: 8px;
  max-width: 100%;
}

.chat-bubble-wrap.outgoing {
  justify-content: flex-end;
}

.chat-bubble-wrap.incoming {
  justify-content: flex-start;
}

.chat-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
}

.chat-bubble.outgoing {
  background: #FF4D6D;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-bubble.incoming {
  background: #1A1A1A;
  color: #f0f0f0;
  border-bottom-left-radius: 4px;
}

.chat-bubble-time {
  font-size: 0.65rem;
  color: #888;
  margin-top: 2px;
  text-align: right;
}

.chat-bubble-wrap.incoming .chat-bubble-time { text-align: left; }

/* ── Conversation List ──────────────────────────────────────────────────────── */

.conversation-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}

.conversation-item:hover { background: rgba(255,255,255,0.04); }

.conversation-item .conv-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.conversation-item .conv-info { flex: 1; min-width: 0; }

.conversation-item .conv-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
}

.conversation-item .conv-preview {
  font-size: 0.85rem;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-item .conv-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.conversation-item .conv-time {
  font-size: 0.75rem;
  color: #888;
}

.conversation-item .conv-unread-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #FF4D6D;
}

/* ── Swipe Actions ──────────────────────────────────────────────────────────── */

.swipe-action-layer {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  display: flex;
  align-items: stretch;
  overflow: hidden;
}

.swipe-action-delete,
.swipe-action-archive {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
}

.swipe-action-delete { background: #e63946; }
.swipe-action-archive { background: #f4a261; }

/* ── Chat Composer ──────────────────────────────────────────────────────────── */

.chat-composer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 300;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 12px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  background: #161823;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.chat-composer-input {
  flex: 1;
  background: #1A1A1A;
  border: none;
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 0.9rem;
  color: #f0f0f0;
  resize: none;
  max-height: 120px;
  outline: none;
  font-family: inherit;
}

.chat-composer-input::placeholder { color: #666; }

.chat-composer-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s;
  min-height: 44px;
}

.chat-composer-btn:active { transform: scale(0.95); }

.chat-composer-btn.send {
  background: #FF4D6D;
  color: #fff;
}

.chat-composer-btn.attach {
  background: #333;
  color: #f0f0f0;
}

/* ── Pull to Refresh ────────────────────────────────────────────────────────── */

.ptr-container {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.ptr-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 48px;
  gap: 8px;
  color: #888;
  font-size: 0.8rem;
}

.ptr-spinner-icon {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #FF4D6D;
  border-radius: 50%;
  animation: ptr-spin 0.8s linear infinite;
}

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

/* ── LIVE Room ───────────────────────────────────────────────────────────────── */

.live-room-video {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 56px;
  background: #000;
  object-fit: cover;
}

.live-chat-overlay {
  position: fixed;
  bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  left: 0;
  right: 0;
  height: 40vh;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(16px);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  padding: 12px;
}

.live-chat-overlay.visible {
  transform: translateY(0);
}

.live-room-controls {
  position: fixed;
  bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
}

.live-control-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  min-height: 44px;
  transition: transform 0.15s;
}

.live-control-btn:active { transform: scale(0.95); }

.live-control-btn.flip { background: rgba(255,255,255,0.2); color: #fff; }
.live-control-btn.mute  { background: rgba(255,255,255,0.2); color: #fff; }
.live-control-btn.end   { background: #e63946; color: #fff; width: 56px; }
.live-control-btn.start { background: #FF4D6D; color: #fff; width: 56px; }

/* ── Editor ─────────────────────────────────────────────────────────────────── */

.editor-timeline {
  position: relative;
  height: 60px;
  background: #111;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
}

.editor-timeline-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(255,77,109,0.3);
  pointer-events: none;
}

.editor-timeline-playhead {
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  background: #FF4D6D;
  pointer-events: none;
}

.editor-trim-handle {
  position: absolute;
  top: 0;
  height: 100%;
  width: 20px;
  background: rgba(0,242,234,0.6);
  cursor: ew-resize;
  border-radius: 4px;
}

.editor-trim-handle:hover { background: rgba(0,242,234,0.9); }

.editor-trim-handle.in-point { border-right: 2px solid #00F2EA; }
.editor-trim-handle.out-point { border-left: 2px solid #00F2EA; }

.editor-section-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.editor-section-tab {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #888;
  background: #1A1A1A;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  min-height: 44px;
  transition: all 0.15s;
}

.editor-section-tab.active {
  background: #FF4D6D;
  color: #fff;
}

/* ── Upload Progress ─────────────────────────────────────────────────────────── */

.upload-progress-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.upload-progress-bar-wrap {
  width: 80%;
  max-width: 320px;
  height: 4px;
  background: #333;
  border-radius: 2px;
  overflow: hidden;
}

.upload-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #00F2EA, #FF4D6D);
  transition: width 0.2s;
  border-radius: 2px;
}

.upload-progress-pct {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}

.upload-progress-label {
  font-size: 0.85rem;
  color: #888;
}

.upload-cancel-btn {
  background: transparent;
  border: 1px solid #555;
  color: #888;
  padding: 8px 24px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  min-height: 44px;
}

/* ── Quick Actions Grid ──────────────────────────────────────────────────────── */

.qa-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 16px;
}

.qa-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px;
  background: #161823;
  border-radius: 16px;
  text-decoration: none;
  color: #f0f0f0;
  cursor: pointer;
  min-height: 88px;
  transition: background 0.15s;
}

.qa-item:hover { background: #1E1E2E; }

.qa-item-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255,77,109,0.15);
  color: #FF4D6D;
}

.qa-item-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #ccc;
}

/* ── LIVE Lobby Cards ────────────────────────────────────────────────────────── */

.live-room-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: #161823;
  border-radius: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  color: inherit;
}

.live-room-card:hover { background: #1E1E2E; }

.live-room-card-thumb {
  width: 100px;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
  background: #111;
  flex-shrink: 0;
}

.live-room-card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }

.live-room-card-creator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-room-card-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: #333;
}

.live-room-card-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
}

.live-room-card-title {
  font-size: 0.85rem;
  color: #ccc;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.live-room-card-stats {
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
  color: #888;
  margin-top: auto;
}

.live-room-card-join {
  background: #FF4D6D;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  align-self: flex-start;
}

/* ── Permission Banner ───────────────────────────────────────────────────────── */

.permission-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #1A1A1A;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  margin: 16px;
}

.permission-banner-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0,242,234,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00F2EA;
  flex-shrink: 0;
}

.permission-banner-text { flex: 1; }

.permission-banner-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
}

.permission-banner-sub {
  font-size: 0.8rem;
  color: #888;
  margin-top: 2px;
}

.permission-banner-btn {
  background: #FF4D6D;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 36px;
  white-space: nowrap;
}

/* ── Misc Utilities ──────────────────────────────────────────────────────────── */

.mobile-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  color: #888;
  text-align: center;
}

.mobile-empty-state svg { opacity: 0.4; }
.mobile-empty-state p { font-size: 0.9rem; line-height: 1.5; }

.page-with-header {
  padding-top: calc(44px + env(safe-area-inset-top, 0px));
}

@media (min-width: 768px) {
  .mobile-page-container { max-width: 480px; margin: 0 auto; }
  .mobile-nav { max-width: 480px; left: 50%; transform: translateX(-50%); }
}