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

:root {
  /* Nexus Premium Light Theme Variables */
  --bg-dark: #f1f5f9; /* Actually light background now */
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: rgba(255, 255, 255, 1);
  --bg-glass: rgba(255, 255, 255, 0.7);
  
  --primary: #2563eb;
  --primary-glow: rgba(37, 99, 235, 0.3);
  --accent: #7c3aed;
  --accent-glow: rgba(124, 58, 237, 0.3);
  
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  
  --border-glass: rgba(0, 0, 0, 0.08);
  --border-light: rgba(0, 0, 0, 0.12);
  
  --sidebar-w: 260px;
  --header-h: 70px;
  
  --shadow-glass: 0 4px 20px 0 rgba(0, 0, 0, 0.05);
}

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

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  overflow-x: hidden;
  /* Premium light background pattern */
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(37, 99, 235, 0.05), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(124, 58, 237, 0.05), transparent 25%);
  background-attachment: fixed;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; font-family: inherit; outline: none; }
input, select { font-family: inherit; outline: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.3); }

/* Layout Structure */
.nexus-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar (Glassmorphism Light) */
.sidebar {
  width: var(--sidebar-w);
  background: #ffffff;
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s ease;
  box-shadow: 2px 0 10px rgba(0,0,0,0.02);
}

.brand {
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  border-bottom: 1px solid var(--border-glass);
  background: linear-gradient(90deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-icon {
  margin-right: 0.75rem;
  color: var(--primary);
  filter: drop-shadow(0 0 4px var(--primary-glow));
}

.nav-menu {
  padding: 1.5rem 1rem;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  color: var(--text-muted);
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(90deg, rgba(37,99,235,0.05), transparent);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: -1;
}

.nav-item:hover {
  color: var(--text-main);
  background: rgba(0,0,0,0.02);
  transform: translateX(5px);
}

.nav-item:hover::before { opacity: 1; }

.nav-item.active {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.2);
  box-shadow: inset 0 0 10px rgba(37, 99, 235, 0.05);
}

.nav-item.active i {
  filter: drop-shadow(0 0 3px var(--primary-glow));
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Header */
.top-header {
  height: var(--header-h);
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 90;
}

.header-search {
  position: relative;
  width: 300px;
}

.header-search i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.header-search input {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  color: var(--text-main);
  transition: all 0.3s;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.header-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.action-btn {
  background: #fff;
  color: var(--text-muted);
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s;
  position: relative;
  box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.action-btn:hover {
  background: var(--bg-dark);
  color: var(--primary);
  border-color: var(--primary);
}

.badge {
  position: absolute;
  top: -2px; right: -2px;
  background: var(--danger);
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid #fff;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 20px;
  transition: background 0.3s;
}

.user-profile:hover { background: rgba(0,0,0,0.03); }

.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 600; font-size: 0.9rem;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* Page Content */
.page-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Light Glassmorphism Cards */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
  transition: transform 0.3s, box-shadow 0.3s;
}

.glass-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.kpi-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.kpi-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}

.kpi-icon.blue { background: rgba(37, 99, 235, 0.1); color: var(--primary); }
.kpi-icon.purple { background: rgba(124, 58, 237, 0.1); color: var(--accent); }
.kpi-icon.green { background: rgba(5, 150, 105, 0.1); color: var(--success); }
.kpi-icon.orange { background: rgba(217, 119, 6, 0.1); color: var(--warning); }

.kpi-value {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -1px;
}

.kpi-label {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Dashboard Split View */
.dash-split {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  flex: 1;
  min-height: 500px;
}

/* Map Container */
.map-container {
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: #e2e8f0;
  border: 1px solid var(--border-light);
}

#nexus-map, #trip-map {
  width: 100%;
  height: 100%;
  z-index: 10;
}

/* Buttons */
.btn {
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 4px 10px var(--primary-glow);
  border: none;
}

.btn-primary:hover {
  box-shadow: 0 6px 15px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-outline {
  background: #fff;
  border: 1px solid var(--border-light);
  color: var(--text-main);
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.btn-outline:hover {
  background: var(--bg-dark);
  border-color: var(--primary);
  color: var(--primary);
}

/* Lists */
.order-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.order-item {
  background: #fff;
  border: 1px solid var(--border-light);
  padding: 1rem;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all 0.2s;
  cursor: grab;
  box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.order-item:hover {
  border-color: var(--primary);
  background: #f8fafc;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.05);
}

.order-item:active { cursor: grabbing; }

.status-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-pending { background: rgba(217, 119, 6, 0.1); color: var(--warning); border: 1px solid rgba(217, 119, 6, 0.2); }
.status-transit { background: rgba(37, 99, 235, 0.1); color: var(--primary); border: 1px solid rgba(37, 99, 235, 0.2); }
.status-delivered { background: rgba(5, 150, 105, 0.1); color: var(--success); border: 1px solid rgba(5, 150, 105, 0.2); }

/* Typography utils */
.text-lg { font-size: 1.1rem; font-weight: 600; }
.text-sm { font-size: 0.85rem; color: var(--text-muted); }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }

/* Modal Base */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: #fff;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  transform: translateY(20px);
  transition: transform 0.3s;
  overflow: hidden;
}

.modal-overlay.active .modal-box {
  transform: translateY(0);
}

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

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  background: #f8fafc;
}
