@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-deep: #030712;
  --bg-surface: #0b0f19;
  --bg-card: rgba(17, 24, 39, 0.65);
  --bg-card-hover: rgba(31, 41, 55, 0.8);
  --bg-glass: rgba(255, 255, 255, 0.03);
  
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.35);

  --accent-cyan: #06b6d4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.35);
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.35);
  --accent-purple: #a855f7;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;

  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-hover: rgba(255, 255, 255, 0.2);
  --border-active: rgba(99, 102, 241, 0.5);

  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;

  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  --shadow-neon: 0 0 30px rgba(99, 102, 241, 0.25);
  --backdrop-blur: blur(20px) saturate(190%);
}

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

body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Ambient Glowing Background Orbs */
body::before {
  content: '';
  position: fixed;
  top: -10%;
  left: 10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -10%;
  right: 10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.15) 0%, transparent 70%);
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

input, textarea, select {
  font-family: inherit;
  outline: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(3, 7, 18, 0.6);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* App Container */
.app-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Premium Glass Panel */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glass);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
  border-color: var(--border-glass-hover);
}

/* Header Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
  background: rgba(17, 24, 39, 0.75);
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 0 20px var(--primary-glow);
  position: relative;
}

.logo-icon-wrapper::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: calc(var(--radius-md) + 2px);
  background: linear-gradient(135deg, var(--primary-light), var(--accent-cyan));
  opacity: 0.4;
  z-index: -1;
  filter: blur(4px);
}

.logo-title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 30%, #9ca3af 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-badge {
  font-size: 10px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.5);
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 13px;
  border: 1px solid var(--border-glass);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

/* Multi Device Cards Bar */
.device-selector-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.device-card {
  padding: 20px;
  border-radius: var(--radius-md);
  background: rgba(17, 24, 39, 0.5);
  border: 1px solid var(--border-glass);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.device-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: transparent;
  transition: background 0.3s ease;
}

.device-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.device-card.active {
  background: linear-gradient(145deg, rgba(31, 41, 55, 0.9), rgba(17, 24, 39, 0.95));
  border-color: var(--primary);
  box-shadow: 0 0 30px var(--primary-glow);
}

.device-card.active::before {
  background: linear-gradient(180deg, var(--primary-light), var(--accent-cyan));
}

.device-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.device-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.device-icon-box {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.device-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 16px;
  color: var(--text-main);
}

.device-model {
  font-size: 12px;
  color: var(--text-muted);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.online {
  background: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
}

.status-dot.offline {
  background: var(--text-dim);
}

.device-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.metric-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.progress-bar-bg {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 4px;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

/* Mode Switcher Tabs */
.tab-bar {
  display: flex;
  gap: 8px;
  padding: 6px;
  background: rgba(11, 15, 25, 0.8);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  width: fit-content;
}

.tab-btn {
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  background: var(--primary);
  color: white;
  font-weight: 600;
  box-shadow: 0 4px 16px var(--primary-glow);
}

/* Dashboard Workspace Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
}

@media (max-width: 1080px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.main-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Smartphone Live Viewfinder Frame */
.phone-frame-container {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

.phone-mockup-frame {
  background: #090d16;
  border-radius: 40px;
  border: 10px solid #1f293d;
  box-shadow: 0 30px 80px -15px rgba(0,0,0,0.8), inset 0 0 0 2px rgba(255,255,255,0.08);
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  flex-shrink: 0;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.phone-mockup-frame.portrait {
  width: 300px;
  height: 600px;
  flex-direction: column;
}

.phone-mockup-frame.landscape {
  width: 580px;
  height: 310px;
  flex-direction: row;
}

/* Dynamic Island / Punch Hole */
.phone-notch {
  background: #1f293d;
  z-index: 10;
  position: relative;
}

.phone-mockup-frame.portrait .phone-notch {
  width: 90px;
  height: 18px;
  margin: 0 auto;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

.phone-mockup-frame.landscape .phone-notch {
  width: 18px;
  height: 90px;
  margin: auto 0;
  border-bottom-right-radius: 12px;
  border-top-right-radius: 12px;
}

/* Live Viewfinder Canvas Screen */
.screen-canvas-area {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  user-select: none;
  background-size: cover;
  background-position: center;
}

.screen-canvas-area.active-feed {
  background: radial-gradient(circle at 50% 30%, #1e1b4b 0%, #0f172a 100%);
}

.screen-canvas-area.paused-feed {
  background: #040711;
}

/* Touch Ripple Effect */
.touch-ripple {
  position: absolute;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--accent-cyan);
  background: rgba(6, 182, 212, 0.4);
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: rippleExpand 0.4s ease-out forwards;
}

@keyframes rippleExpand {
  0% { transform: translate(-50%, -50%) scale(0.3); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

/* Virtual Android Touch Nav Bar */
.phone-nav-bar {
  background: #090d16;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 10;
}

.phone-mockup-frame.portrait .phone-nav-bar {
  height: 48px;
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-direction: row;
}

.phone-mockup-frame.landscape .phone-nav-bar {
  width: 48px;
  height: 100%;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  flex-direction: column;
}

.nav-touch-btn {
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
}

.nav-touch-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

/* File Drop Zone */
.dropzone {
  border: 2px dashed rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-md);
  padding: 40px;
  text-align: center;
  background: rgba(99, 102, 241, 0.03);
  transition: all 0.3s ease;
  cursor: pointer;
}

.dropzone:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
  transform: scale(1.005);
}

.dropzone-icon {
  font-size: 44px;
  margin-bottom: 12px;
}

.dropzone-title {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
}

.dropzone-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

/* Category Filter Chips */
.filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.chip {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 13px;
  border: 1px solid var(--border-glass);
}

.chip:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.15);
}

.chip.active {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.4);
  font-weight: 600;
}

/* File Items */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(17, 24, 39, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.file-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.15);
}

.file-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.file-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-main);
}

.file-subtext {
  font-size: 12px;
  color: var(--text-dim);
}

/* Widgets */
.widget-card {
  padding: 22px;
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.widget-title {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.clipboard-box {
  background: rgba(3, 7, 18, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px;
}

.clipboard-textarea {
  width: 100%;
  height: 80px;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 13px;
  resize: none;
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
}

.action-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.2);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  width: 90%;
  max-width: 440px;
  padding: 32px;
  background: #0b0f19;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
  text-align: center;
}

.pin-display {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 20px 0;
}

.pin-digit {
  width: 48px;
  height: 58px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-code-placeholder {
  width: 170px;
  height: 170px;
  margin: 16px auto;
  background: white;
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   📱 MOBILE RESPONSIVE DESIGN SYSTEM (PHONES & TABLETS)
   ============================================================ */

/* Tablet & Mobile Layout Adjustment */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .sidebar-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}

/* Mobile Screens (Phones < 768px) */
@media (max-width: 768px) {
  .app-container {
    padding: 14px 12px 32px 12px;
  }

  /* Compact Mobile Glass Navbar */
  .navbar {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 16px 18px;
  }

  .logo-group {
    justify-content: space-between;
  }

  .logo-title {
    font-size: 19px;
  }

  .nav-controls {
    display: flex;
    width: 100%;
    gap: 8px;
  }

  .nav-controls > * {
    flex: 1;
    text-align: center;
    justify-content: center;
    padding: 12px 14px;
    font-size: 13px;
    min-height: 44px;
  }

  /* Horizontal Scrollable Device Cards */
  .device-selector-bar {
    grid-template-columns: none;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }

  .device-card {
    min-width: 280px;
    scroll-snap-align: start;
    flex-shrink: 0;
  }

  /* Phone Mockup Frame Responsive Scaling */
  .phone-frame-container {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .phone-mockup-frame.portrait {
    width: 100%;
    max-width: 320px;
    height: 600px;
  }

  .phone-mockup-frame.landscape {
    width: 100%;
    max-width: 480px;
    height: 300px;
  }

  .sidebar-panel {
    grid-template-columns: 1fr;
  }

  /* Touch-optimized Buttons & Chips */
  .btn-primary, .btn-secondary, .tab-btn, .chip, .nav-touch-btn {
    min-height: 44px;
    touch-action: manipulation;
  }

  .filter-chips {
    overflow-x: auto;
    padding-bottom: 6px;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .chip {
    flex-shrink: 0;
  }
}

/* Small Mobile Screens (Phones < 480px) */
@media (max-width: 480px) {
  .logo-title {
    font-size: 17px;
  }

  .glass-panel {
    padding: 16px;
    border-radius: var(--radius-md);
  }

  .nav-controls {
    flex-direction: column;
  }

  .phone-mockup-frame.portrait {
    max-width: 290px;
    height: 540px;
  }

  .action-grid {
    grid-template-columns: 1fr;
  }
}

