/* ==========================================================================
   DriveDrop - Mobile-First Stylesheet
   Tailored exclusively for smartphones & touch devices
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Reset & Variables
   -------------------------------------------------------------------------- */
:root {
  --bg-dark: #070a13;
  --bg-surface: rgba(18, 24, 38, 0.85);
  --bg-card: rgba(22, 30, 48, 0.7);
  --bg-card-hover: rgba(30, 41, 64, 0.85);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.15);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-primary: #6366f1;
  --accent-secondary: #a855f7;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);

  --status-success: #10b981;
  --status-error: #ef4444;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-pill: 9999px;

  --safe-bottom: env(safe-area-inset-bottom, 16px);
  --safe-top: env(safe-area-inset-top, 16px);
}

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

html, body {
  min-height: 100dvh;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  user-select: none;
}

/* --------------------------------------------------------------------------
   2. Background Lighting
   -------------------------------------------------------------------------- */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(100px);
  z-index: 0;
  opacity: 0.35;
}

.glow-top {
  width: 320px;
  height: 320px;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, #6366f1 0%, rgba(99, 102, 241, 0) 70%);
}

.glow-bottom {
  width: 360px;
  height: 360px;
  bottom: -60px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, #a855f7 0%, rgba(168, 85, 247, 0) 70%);
  opacity: 0.25;
}

/* --------------------------------------------------------------------------
   3. Mobile App Frame
   -------------------------------------------------------------------------- */
.mobile-app-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(90px + var(--safe-bottom));
}

/* --------------------------------------------------------------------------
   4. Mobile Header
   -------------------------------------------------------------------------- */
.mobile-header {
  padding: max(16px, var(--safe-top)) 20px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(7, 10, 19, 0.7);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.brand-icon svg {
  width: 18px;
  height: 18px;
  color: #ffffff;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #ffffff 30%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.target-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  padding: 5px 10px;
  border-radius: var(--radius-pill);
}

.cloud-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
}

/* --------------------------------------------------------------------------
   5. Main Content Views
   -------------------------------------------------------------------------- */
.mobile-main {
  flex: 1;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
}

.view-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeIn 0.25s ease-out;
}

/* --------------------------------------------------------------------------
   6. View 1: Empty / Idle State
   -------------------------------------------------------------------------- */
.hero-text {
  text-align: center;
  margin: 10px 0 6px;
}

.hero-text h1 {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.hero-text p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.touch-card {
  background: var(--bg-card);
  border: 2px dashed rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-xl);
  padding: 38px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.2s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.touch-card:active {
  transform: scale(0.97);
  background: var(--bg-card-hover);
  border-color: #818cf8;
}

.card-icon-circle {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 16px;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.25);
}

.card-icon-circle svg {
  width: 36px;
  height: 36px;
  color: #818cf8;
}

.plus-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.info-pills {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 6px;
}

.pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.pill svg {
  width: 14px;
  height: 14px;
  color: #818cf8;
}

/* --------------------------------------------------------------------------
   7. View 2: Queue & Selection State
   -------------------------------------------------------------------------- */
.queue-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.panel-heading {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.panel-subheading {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.text-action-btn {
  background: transparent;
  border: none;
  color: #ef4444;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}

.text-action-btn:active {
  opacity: 0.6;
}

/* 2-Column Mobile Media Grid */
.media-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.media-item-card {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  animation: scaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.media-item-card img,
.media-item-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Video badge */
.media-video-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  color: #ffffff;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.media-video-badge svg {
  width: 10px;
  height: 10px;
}

/* Delete / Remove Button */
.media-remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  z-index: 5;
}

.media-remove-btn:active {
  transform: scale(0.9);
  background: #ef4444;
}

/* Media Info Pill on Thumbnail */
.media-meta-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 8px 6px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #f1f5f9;
}

.media-size-text {
  font-weight: 600;
}

/* Add more row */
.add-more-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}

.add-more-row:active {
  background: rgba(255, 255, 255, 0.08);
  transform: scale(0.98);
}

.add-more-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

/* --------------------------------------------------------------------------
   8. View 3: Success State
   -------------------------------------------------------------------------- */
.success-card {
  background: var(--bg-card);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-xl);
  padding: 48px 24px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
  animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 20px;
}

.success-icon-wrap {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  border: 2px solid #10b981;
  color: #34d399;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.35);
}

.success-icon-wrap svg {
  width: 44px;
  height: 44px;
}

.success-card h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.success-card p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.5;
  margin-bottom: 8px;
}

/* --------------------------------------------------------------------------
   9. Sticky Bottom Action Bar
   -------------------------------------------------------------------------- */
.sticky-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(7, 10, 19, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  padding: 12px 18px calc(12px + var(--safe-bottom));
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.bottom-bar-inner {
  max-width: 480px;
  margin: 0 auto;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 24px;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
  transition: transform 0.15s ease, filter 0.15s ease;
  line-height: 1;
}

.btn-primary:active {
  transform: scale(0.97);
  filter: brightness(0.95);
}

.full-width {
  width: 100%;
}

.upload-trigger svg {
  width: 20px;
  height: 20px;
}

/* Bottom Bar Progress Container */
.upload-progress-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0 4px;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--accent-gradient);
  transition: width 0.25s ease-out;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(
    90deg, 
    rgba(255, 255, 255, 0) 0%, 
    rgba(255, 255, 255, 0.35) 50%, 
    rgba(255, 255, 255, 0) 100%
  );
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* --------------------------------------------------------------------------
   10. Mobile Toast Notifications
   -------------------------------------------------------------------------- */
.mobile-toast-container {
  position: fixed;
  top: max(16px, var(--safe-top));
  left: 16px;
  right: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.mobile-toast {
  pointer-events: auto;
  max-width: 440px;
  margin: 0 auto;
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: #1e293b;
  border: 1px solid var(--border-light);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-toast.toast-success {
  background: linear-gradient(135deg, #064e3b 0%, #0f172a 100%);
  border-color: rgba(16, 185, 129, 0.4);
}

.mobile-toast.toast-error {
  background: linear-gradient(135deg, #7f1d1d 0%, #0f172a 100%);
  border-color: rgba(239, 68, 68, 0.4);
}

.mobile-toast.toast-warning {
  background: linear-gradient(135deg, #78350f 0%, #0f172a 100%);
  border-color: rgba(245, 158, 11, 0.4);
}

/* --------------------------------------------------------------------------
   11. Helper Classes & Animations
   -------------------------------------------------------------------------- */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

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

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