/* RecPhone Mobile Single-Page Zero-Scrollbar Design System */
:root {
  --bg-primary: #0b0f19;
  --bg-card: rgba(23, 32, 54, 0.7);
  --bg-card-hover: rgba(30, 41, 69, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  
  --accent-primary: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.4);
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  
  --danger-primary: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.4);
  --danger-gradient: linear-gradient(135deg, #ef4444 0%, #f43f5e 100%);
  
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --info-color: #3b82f6;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dark: #64748b;
  
  --header-height: 52px;
  --border-radius: 16px;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', system-ui, sans-serif;
}

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

html, body {
  width: 100%;
  height: 100dvh;
  overflow: hidden; /* Strict Zero Scrollbar */
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  touch-action: manipulation;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* App Main SPA Container */
.app-container.no-scroll {
  width: 100%;
  max-width: 440px;
  height: 100dvh;
  background: radial-gradient(circle at 50% 0%, #1e1b4b 0%, #0b0f19 70%);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.2rem;
}

.brand-icon {
  color: var(--accent-primary);
  font-size: 1.3rem;
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.badge-inactive {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dark);
}

.badge-active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success-color);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning-color);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

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

.icon-gear-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.icon-gear-btn:active {
  transform: scale(0.92);
  background: rgba(99, 102, 241, 0.3);
}

/* Studio Layout */
.studio-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 16px 20px 16px;
  overflow: hidden;
}

.timer-container {
  text-align: center;
  margin-top: 4px;
}

.timer-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.timer-text {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 2px;
  margin: 2px 0;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
}

.session-status {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.session-status.recording {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
  animation: pulseStatus 2s infinite;
}

@keyframes pulseStatus {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Sound Wave Canvas */
.visualizer-container {
  width: 100%;
  height: 44px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

#audioVisualizer {
  width: 100%;
  height: 100%;
}

/* Screen Preview Video Window */
.screen-preview-card {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.screen-preview-card.hidden {
  display: none;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
}

.diff-badge {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning-color);
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 0.68rem;
}

.preview-video-wrapper {
  width: 100%;
  height: 90px;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#screenPreviewVideo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Control Center Button */
.control-center {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 0;
}

.record-btn {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: var(--accent-gradient);
  border: none;
  outline: none;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 30px var(--accent-glow);
  transition: all 0.25s ease;
}

.record-btn i {
  font-size: 2rem;
  margin-bottom: 4px;
}

.record-btn-text {
  font-size: 0.8rem;
  font-weight: 600;
}

.record-btn:active {
  transform: scale(0.94);
}

.record-btn.recording {
  background: var(--danger-gradient);
  box-shadow: 0 0 35px var(--danger-glow);
  animation: recordPulse 1.5s infinite;
}

@keyframes recordPulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  70% { box-shadow: 0 0 0 20px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Action Pills Grid */
.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  width: 100%;
}

.action-pill {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #c7d2fe;
  font-size: 0.78rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.action-pill.active {
  background: var(--success-color);
  color: #fff;
  border-color: var(--success-color);
}

.action-pill.hidden {
  display: none;
}

.pill-secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.pill-accent {
  background: rgba(168, 85, 247, 0.2);
  border-color: rgba(168, 85, 247, 0.4);
  color: #e9d5ff;
}

/* Modals & Drawer Overlays */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

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

.modal-card.drawer-style {
  background: #131b2e;
  border-top: 1px solid var(--border-color);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 440px;
  height: 85dvh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.7);
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.modal-header h3 {
  font-size: 0.95rem;
  font-family: var(--font-heading);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.drawer-body {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drawer-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-card-title {
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.profile-inputs {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 8px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.input-group label {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.input-group input {
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  color: #fff;
  font-size: 0.75rem;
  outline: none;
}

.gdrive-status-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Upload Dropzone */
.upload-dropzone {
  background: var(--bg-card);
  border: 1px dashed var(--accent-primary);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.dropzone-icon {
  font-size: 1.8rem;
  color: var(--accent-primary);
}

.dropzone-text {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

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

.btn-block { width: 100%; }
.btn-sm { padding: 4px 10px; font-size: 0.72rem; }

/* Upload Logs List */
.logs-container {
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  padding: 12px;
}

.logs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.8rem;
  font-weight: 600;
}

.text-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  cursor: pointer;
}

.logs-list {
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.log-item {
  font-size: 0.72rem;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.3;
}

.item-info { color: var(--text-muted); }
.item-success { color: #86efac; border-left: 3px solid var(--success-color); }
.item-shot { color: #93c5fd; border-left: 3px solid var(--info-color); }
.item-warning { color: #fde047; border-left: 3px solid var(--warning-color); }

/* History List & Clean Two-Line Card Layout */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.twoline-card {
  background: rgba(23, 32, 54, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 12px;
  transition: all 0.2s ease;
}

.twoline-card:hover {
  background: rgba(30, 41, 69, 0.85);
  border-color: rgba(99, 102, 241, 0.3);
}

.twoline-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

/* Line 1: Session Title + Status Badge + Arrow */
.twoline-line1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.twoline-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Line 2: Time • Duration • Screenshots */
.twoline-line2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.twoline-dot {
  color: rgba(255, 255, 255, 0.2);
}

.accordion-arrow {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.accordion-details {
  border-top: 1px solid var(--border-color);
  padding-top: 10px;
  margin-top: 10px;
}

.accordion-details.hidden {
  display: none;
}

.audio-player {
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 8px;
  border-radius: 8px;
}

audio {
  width: 100%;
  height: 28px;
  filter: invert(0.9) hue-rotate(180deg);
}

.screenshots-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.screenshot-thumb {
  position: relative;
  min-width: 75px;
  height: 55px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  cursor: pointer;
}

.screenshot-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shot-timestamp {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: rgba(0,0,0,0.8);
  color: #fff;
  font-size: 0.58rem;
  padding: 1px 3px;
  border-radius: 3px;
}

/* Dim Mode Overlay */
.dim-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #000;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  opacity: 0.95;
}

.dim-overlay.hidden { display: none; }

.dim-content {
  color: #334155;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.dim-icon { font-size: 3rem; color: #1e293b; }
.dim-title { font-size: 0.95rem; color: #475569; }
.dim-status { font-size: 0.78rem; color: #334155; }

.exit-dim-btn {
  margin-top: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #64748b;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
}

.modal-card {
  background: #131b2e;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.modal-body {
  padding: 14px;
  overflow-y: auto;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-section-title {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 4px;
}

.transcript-box {
  background: rgba(0,0,0,0.3);
  padding: 10px;
  border-radius: 8px;
  white-space: pre-wrap;
  line-height: 1.4;
  font-family: monospace;
  font-size: 0.75rem;
  color: #cbd5e1;
}

.loading-spinner {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
}
