/* AXIIOM Logistics Mobile App Styles */

/* CSS Variables for theming */
:root {
  --primary: #F59E0B;
  --primary-dark: #D97706;
  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;
  
  /* Dark theme (default) */
  --bg-dark: #0F172A;
  --bg-card: #1E293B;
  --bg-light: #334155;
  --bg-input: #1a2332;
  --text: #F8FAFC;
  --text-muted: #94A3B8;
  --border: #334155;
  
  --shadow: rgba(0, 0, 0, 0.3);
  --glow: rgba(245, 158, 11, 0.4);
  
  /* Gradients */
  --gradient-bg: linear-gradient(180deg, #0F172A 0%, #1E293B 100%);
  --gradient-btn: linear-gradient(90deg, #F59E0B, #10B981);
}

/* Light theme */
[data-theme="light"] {
  --bg-dark: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-light: #E2E8F0;
  --bg-input: #f1f5f9;
  --text: #1E293B;
  --text-muted: #64748B;
  --border: #E2E8F0;
  
  --shadow: rgba(0, 0, 0, 0.1);
  --glow: rgba(245, 158, 11, 0.2);
  
  --gradient-bg: linear-gradient(180deg, #F8FAFC 0%, #E2E8F0 100%);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

/* SVG Icons base */
.icon {
  width: 24px;
  height: 24px;
}

.icon-sm {
  width: 18px;
  height: 18px;
}

.icon-lg {
  width: 64px;
  height: 64px;
}

.icon-nav {
  width: 24px;
  height: 24px;
}

.use {
  fill: currentColor;
}

/* Page transitions */
.page {
  min-height: 100vh;
  transition: opacity 0.3s ease;
}

.hidden {
  display: none !important;
}

/* Theme toggle button */
.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  color: var(--text);
  transition: background 0.2s, transform 0.2s;
}

.theme-toggle:hover {
  background: var(--bg-light);
  transform: scale(1.1);
}

.theme-toggle-small {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
}

/* Landing Page */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 40px;
  text-align: center;
  background: var(--gradient-bg);
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  background: var(--bg-card);
  border-radius: 24px;
  margin-bottom: 16px;
  color: var(--primary);
}

.logo .icon-lg {
  width: 56px;
  height: 56px;
}

.hero h1 {
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(90deg, var(--primary), var(--success));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  font-size: 18px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.desc {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 300px;
  line-height: 1.5;
  margin-bottom: 32px;
}

.features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 40px;
}

.feature {
  background: var(--bg-card);
  padding: 20px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 140px;
  color: var(--text);
  transition: background 0.2s;
}

.feature:hover {
  background: var(--bg-light);
}

.feature .icon {
  width: 32px;
  height: 32px;
  color: var(--primary);
}

.feature span:last-child {
  font-size: 14px;
  font-weight: 500;
}

.btn-primary {
  background: var(--gradient-btn);
  color: white;
  border: none;
  padding: 18px 48px;
  font-size: 18px;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 24px var(--glow);
}

.btn-primary:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 32px var(--glow);
}

.note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 24px;
}

/* Mobile App Frame */
#app {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: var(--bg-dark);
}

.phone-frame {
  width: 100%;
  max-width: 380px;
  height: 100vh;
  max-height: 800px;
  background: var(--bg-dark);
  border-radius: 40px;
  overflow: hidden;
  position: relative;
  border: 4px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: background 0.3s, border-color 0.3s;
}

[data-theme="light"] .phone-frame {
  border-color: #cbd5e1;
}

.phone-header {
  background: var(--bg-dark);
  padding: 12px 20px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.3s;
}

.status-bar {
  font-size: 14px;
  color: var(--text-muted);
}

/* Role Switcher Pill inside phone */
.role-switcher {
  display: flex;
  background: var(--bg-card);
  border-radius: 20px;
  margin: 4px 20px 8px;
  padding: 3px;
  gap: 3px;
}

.role-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: 17px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s;
}

.role-btn.active {
  background: var(--primary);
  color: white;
}

.role-btn:hover:not(.active) {
  background: var(--bg-light);
}

.role-btn .icon-sm {
  width: 16px;
  height: 16px;
}

.app-header {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  transition: background 0.3s, border-color 0.3s;
  background: var(--bg-dark);
}

.back-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
}

.back-btn:hover {
  opacity: 0.7;
}

.app-header h2 {
  font-size: 20px;
  font-weight: 600;
}

.profile-icon {
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
}

.profile-icon:hover {
  color: var(--primary);
}

.profile-icon .icon {
  width: 24px;
  height: 24px;
}

.app-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  transition: background 0.3s;
}

/* Bottom Navigation */
.bottom-nav {
  display: flex;
  justify-content: space-around;
  padding: 12px 20px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-dark);
  transition: background 0.3s, border-color 0.3s;
}

.nav-item {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 12px;
  transition: all 0.2s;
  position: relative;
}

.nav-item svg {
  width: 24px;
  height: 24px;
}

.nav-item.active {
  color: var(--primary);
  background: rgba(245, 158, 11, 0.1);
}

.nav-item:hover {
  background: var(--bg-card);
}

/* App Pages */
.page-content h3 {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.dashboard-card {
  background: var(--bg-card);
  padding: 20px;
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.dashboard-card:hover {
  transform: translateY(-2px);
  background: var(--bg-light);
}

.dashboard-card .icon {
  width: 32px;
  height: 32px;
  color: var(--primary);
  margin-bottom: 8px;
}

.dashboard-card h4 {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}

.dashboard-card p {
  font-size: 12px;
  color: var(--text-muted);
}

.dashboard-card.wide {
  grid-column: span 2;
}

.dashboard-card.accent {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(16, 185, 129, 0.3));
}

/* Exit Button */
.btn-exit {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text-muted);
  padding: 12px 32px;
  border-radius: 50px;
  margin-top: 20px;
  cursor: pointer;
  font-size: 14px;
  transition: border-color 0.2s, color 0.2s;
}

.btn-exit:hover {
  border-color: var(--text);
  color: var(--text);
}

/* Profile screen */
.profile-card {
  background: var(--bg-card);
  padding: 24px;
  border-radius: 16px;
  text-align: center;
  margin-bottom: 20px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  margin: 0 auto 16px;
}

.profile-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.profile-group {
  color: var(--primary);
  font-weight: 600;
  margin: 0;
}

.profile-info {
  background: var(--bg-card);
  border-radius: 16px;
  overflow: hidden;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  color: var(--text-muted);
  font-size: 14px;
}

.info-value {
  font-weight: 500;
  text-align: right;
  max-width: 60%;
}

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: var(--bg-card);
  color: var(--primary);
}

.icon-btn .icon {
  width: 22px;
  height: 22px;
  display: block;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
}

.status-badge.active {
  background: rgba(16, 185, 129, 0.2);
  color: #10B981;
}

.status-badge.pending {
  background: rgba(245, 158, 11, 0.2);
  color: #F59E0B;
}

.status-badge.completed {
  background: rgba(148, 163, 184, 0.2);
  color: #94A3B8;
}

.status-badge.express {
  background: rgba(239, 68, 68, 0.2);
  color: #EF4444;
}

.status-badge.standard {
  background: rgba(59, 130, 246, 0.2);
  color: #3B82F6;
}

/* Priority Badges */
.priority-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
}

.priority-badge.high {
  background: rgba(239, 68, 68, 0.2);
  color: #EF4444;
}

.priority-badge.medium {
  background: rgba(245, 158, 11, 0.2);
  color: #F59E0B;
}

.priority-badge.low {
  background: rgba(148, 163, 184, 0.2);
  color: #94A3B8;
}

/* Order Cards */
.order-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  position: relative;
}

.order-card:hover {
  transform: translateY(-2px);
  background: var(--bg-light);
}

.order-card.active-border {
  border-left: 3px solid #10B981;
}

.order-card.pending-border {
  border-left: 3px solid #F59E0B;
}

.order-card.completed-border {
  border-left: 3px solid #94A3B8;
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.order-id {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}

.order-client {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.order-items {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.order-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

.order-meta .shelf {
  color: var(--primary);
  font-weight: 600;
}

/* Progress bar */
.progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  margin: 8px 0;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s;
}

.progress-fill.active {
  background: #10B981;
}

.progress-fill.pending {
  background: #F59E0B;
}

.progress-fill.completed {
  background: #94A3B8;
}

/* Order Detail Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: var(--bg-card);
  border-radius: 20px;
  max-width: 340px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 24px;
}

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

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
}

.modal-section {
  margin-bottom: 16px;
}

.modal-section h4 {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

/* Delivery Cards */
.delivery-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.delivery-card:hover {
  transform: translateY(-2px);
  background: var(--bg-light);
}

.delivery-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.delivery-id {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}

.delivery-client {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.delivery-address {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.delivery-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

/* Scanner Page */
.scanner-frame {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 40px 20px;
  text-align: center;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.scanner-viewport {
  width: 200px;
  height: 200px;
  margin: 0 auto;
  border: 2px dashed var(--primary);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.scanner-viewport .scan-line {
  position: absolute;
  width: 100%;
  height: 2px;
  background: var(--primary);
  animation: scan 2s ease-in-out infinite;
  box-shadow: 0 0 12px var(--primary);
}

@keyframes scan {
  0%, 100% { top: 10%; }
  50% { top: 90%; }
}

.scanner-icon {
  color: var(--text-muted);
  opacity: 0.3;
}

.scanner-hint {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 20px;
}

.scan-result {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.scan-result .sku {
  font-weight: 600;
  font-size: 14px;
}

.scan-result .status {
  font-size: 12px;
  color: var(--success);
}

/* Route / Map */
.route-map {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 60px 20px;
  text-align: center;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.route-map-placeholder {
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.route-map-placeholder .icon {
  width: 48px;
  height: 48px;
  opacity: 0.4;
}

.route-map-placeholder span {
  font-size: 14px;
}

.route-stop {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  position: relative;
}

.route-stop:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 13px;
  top: 32px;
  bottom: -8px;
  width: 2px;
  background: var(--border);
}

.stop-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.stop-dot.start {
  background: var(--primary);
  color: white;
}

.stop-dot.mid {
  background: var(--bg-light);
  color: var(--text-muted);
}

.stop-dot.end {
  background: var(--success);
  color: white;
}

.stop-info {
  flex: 1;
}

.stop-info h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.stop-info p {
  font-size: 12px;
  color: var(--text-muted);
}

.stop-distance {
  font-size: 11px;
  color: var(--primary);
  font-weight: 500;
}

/* List views */
.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: 16px;
}

.list-info {
  flex: 1;
}

.list-info h4 {
  margin: 0 0 4px;
  font-size: 15px;
}

.list-info p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.badge {
  flex-shrink: 0;
  font-size: 11px;
  padding: 4px 8px;
  background: var(--primary);
  color: white;
  border-radius: 8px;
}

/* Stat value inside dashboard grid */
.stat-value-lg {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
}

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

/* Responsive */
@media (min-width: 768px) {
  .features {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .feature {
    width: auto;
  }
}

@media (max-width: 380px) {
  .hero h1 {
    font-size: 36px;
  }
  
  .phone-frame {
    border-radius: 0;
    border: none;
  }
}
