/* Reel AI Studio - Native Mobile App Feel Stylesheet */
:root {
  --bg-primary: #0b0f19;
  --bg-card: #131b2e;
  --bg-card-hover: #1a243d;
  --accent-purple: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #ec4899 100%);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-subtle: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

input, textarea {
  user-select: text;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  -webkit-font-smoothing: antialiased;
}

/* App Shell Layout */
#app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  max-width: 480px; /* Constrain on desktop so it always feels like mobile */
  margin: 0 auto;
  position: relative;
  background-color: var(--bg-primary);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Side Drawer Overlay & Panel */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.drawer-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 82%;
  max-width: 320px;
  background: #111827;
  z-index: 51;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.6);
  border-right: 1px solid var(--border-subtle);
}

.drawer-panel.active {
  transform: translateX(0);
}

/* Bottom Nav Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 64px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 40;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  height: 100%;
}

.nav-item.active {
  color: #c084fc;
}

.nav-item.active svg {
  transform: translateY(-2px);
  filter: drop-shadow(0 2px 8px rgba(168, 85, 247, 0.6));
}

/* Tactile Buttons */
.btn-primary {
  background: var(--accent-gradient);
  color: white;
  font-weight: 600;
  border-radius: 14px;
  padding: 14px 20px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary:active {
  transform: scale(0.97);
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: white;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.btn-secondary:active {
  transform: scale(0.97);
  background: rgba(255, 255, 255, 0.1);
}

/* Custom Connection Toast */
.network-toast {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  width: 90%;
  max-width: 440px;
  padding: 12px 16px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 500;
  z-index: 100;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.network-toast.offline {
  background: #dc2626;
  color: white;
  transform: translateX(-50%) translateY(0);
}

.network-toast.online {
  background: #16a34a;
  color: white;
  transform: translateX(-50%) translateY(0);
}

/* Video Player Modal in 9:16 vertical */
.vertical-video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 9/16;
  max-height: 70vh;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}
