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

:root {
  --bg-color: #0b111e;
  --card-bg: rgba(22, 30, 49, 0.7);
  --card-border: rgba(255, 255, 255, 0.08);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  
  --accent-gold: #f59e0b;
  --accent-gold-glow: rgba(245, 158, 11, 0.2);
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.2);
  --accent-blue: #3b82f6;
  --accent-blue-glow: rgba(59, 130, 246, 0.2);
  --accent-rose: #ef4444;
  
  --border-radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-color);
  background-image: 
    radial-gradient(at 0% 0%, rgba(245, 158, 11, 0.05) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(59, 130, 246, 0.05) 0px, transparent 50%);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

header {
  padding: 24px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.logo span {
  color: var(--accent-gold);
}

.logo-icon {
  background: var(--accent-gold-glow);
  padding: 8px;
  border-radius: 10px;
  color: var(--accent-gold);
  font-size: 20px;
}

.container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  flex-grow: 1;
}

/* Glassmorphism Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 28px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  backdrop-filter: blur(12px);
  margin-bottom: 24px;
  transition: var(--transition);
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.card-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

input, select, textarea {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 15px;
  color: var(--text-primary);
  transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px var(--accent-gold-glow);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 24px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-gold);
  color: #000;
}

.btn-primary:hover {
  background: #fcd34d;
  box-shadow: 0 0 20px 0 var(--accent-gold-glow);
  transform: translateY(-1px);
}

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: var(--accent-rose);
  color: white;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

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

.badge-assigned {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

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

.badge-finished {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid var(--card-border);
}

.badge-cancelled {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-rose);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* QR Code Section */
.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: rgba(255, 255, 255, 0.02);
  border: 2px dashed var(--card-border);
  border-radius: 20px;
  text-align: center;
}

.qr-image-wrapper {
  background: white;
  padding: 16px;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-image-wrapper img {
  display: block;
  max-width: 250px;
  width: 100%;
}

.connection-pulse {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--accent-rose);
  position: relative;
}

.connection-pulse.connected {
  background-color: var(--accent-emerald);
}

.connection-pulse::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: inherit;
  opacity: 0.8;
  animation: pulse-ring 1.5s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* Trip Tracking Layout (Premium Mobile-First view) */
.trip-container {
  max-width: 500px;
  margin: 0 auto;
  padding: 16px;
}

.driver-profile {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.driver-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: #000;
  box-shadow: 0 4px 15px rgba(245,158,11,0.3);
}

.driver-info {
  flex-grow: 1;
}

.driver-name {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.vehicle-plate {
  display: inline-block;
  background: #fcd34d;
  color: #000;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 13px;
  border: 1px solid #d97706;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Simulated Live Map */
.map-placeholder {
  height: 250px;
  background: #111827;
  border-radius: var(--border-radius);
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
  border: 1px solid var(--card-border);
}

.map-grid {
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  background-image: 
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  transform: rotate(15deg);
  animation: map-scroll 60s linear infinite;
}

@keyframes map-scroll {
  0% { transform: rotate(15deg) translate(0, 0); }
  100% { transform: rotate(15deg) translate(-200px, -200px); }
}

.map-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  transition: all 1s ease-in-out;
}

.map-marker-car {
  font-size: 24px;
  filter: drop-shadow(0 0 10px var(--accent-gold));
  z-index: 10;
}

.map-marker-destination {
  font-size: 24px;
  color: var(--accent-rose);
  filter: drop-shadow(0 0 10px rgba(239,68,68,0.5));
}

.pulse-circle {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--accent-gold);
  transform: translate(-50%, -50%);
  animation: pulse-ring 2s infinite;
}

/* Stars Rating */
.stars-container {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 24px 0;
}

.star {
  font-size: 36px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.15);
  transition: var(--transition);
}

.star.active, .star:hover {
  color: var(--accent-gold);
  transform: scale(1.2);
  text-shadow: 0 0 15px var(--accent-gold-glow);
}

/* Grid Layouts for Admin */
.admin-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media(min-width: 900px) {
  .admin-grid {
    grid-template-columns: 1fr 2fr;
  }
}

/* Table Design */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  padding: 14px 16px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  border-bottom: 2px solid var(--card-border);
}

td {
  padding: 16px;
  border-bottom: 1px solid var(--card-border);
  font-size: 15px;
}

tr:hover td {
  background: rgba(255,255,255,0.02);
}

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

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

.modal-content {
  background: #111827;
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  max-width: 450px;
  width: 90%;
  padding: 32px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  transform: scale(0.9);
  transition: var(--transition);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}
