/* Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --status-online: #10b981;
  --status-danger: #ef4444;
  --status-warning: #f59e0b;
  --status-info: #3b82f6;
}

body[data-theme="dark"] {
  --bg-main: #0f172a;
  --bg-card: #1e293b;
  --text-main: #e2e8f0;
  --text-heading: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #3b82f6;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

body[data-theme="light"] {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #334155;
  --text-heading: #1e293b;
  --text-muted: #64748b;
  --accent: #3b82f6;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1050;
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: none;
  border-radius: 8px;
  display: none; /* FIX: Hide hamburger menu by default on larger screens */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.mobile-menu-toggle span {
  width: 20px;
  height: 2px;
  background: var(--text-main);
  transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Overlay */
.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Login Page Styles */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: url("background.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  padding: 20px;
}

.login-card {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2), 0 8px 32px rgba(59, 130, 246, 0.2);
}

.drone-icon-container {
  text-align: center;
  margin-bottom: 32px;
}

.drone-icon {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: contain;
  filter: drop-shadow(0 4px 15px rgba(59, 130, 246, 0.2));
}

.welcome-title {
  font-size: 25px;
  font-weight: 700;
  text-align: center;
  color: #e2e8f0;
  margin-bottom: 8px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.welcome-subtitle {
  text-align: center;
  color: #cbd5e1;
  margin-bottom: 32px;
  font-size: 16px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.google-btn {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  background: rgba(30, 41, 59, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #e2e8f0;
  border-radius: 8px;
  font-weight: 500;
  margin-bottom: 24px;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.google-btn:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(59, 130, 246, 0.5);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}

.google-btn i {
  margin-right: 8px;
  color: #ea4335;
}

.github-btn {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  background: #24292e;
  color: #f9f9f9;
  border-radius: 8px;
  font-weight: 500;
  margin-bottom: 24px;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.github-btn:hover {
  background: #1b1f23;
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}

.github-btn i {
  margin-right: 8px;
  color: #ffffff;
}

.auth-icon {
  width: 20px;
  height: 20px;
  margin-right: 8px;
}

.divider {
  text-align: center;
  margin: 24px 0;
  position: relative;
  color: #64748b;
  font-size: 14px;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(148, 163, 184, 0.5);
  z-index: 1;
}

.divider span {
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 0 16px;
  position: relative;
  z-index: 2;
  color: #94a3b8;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #e2e8f0;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.input-group-text {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(59, 130, 246, 0.3);
  color: #94a3b8;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.form-control {
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 16px;
  background: rgba(30, 41, 59, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #e2e8f0;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.form-control:focus {
  border-color: #3b82f6;
  background: rgba(30, 41, 59, 0.8);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2), 0 4px 15px rgba(59, 130, 246, 0.1);
  outline: none;
}

.form-control::placeholder {
  color: rgba(148, 163, 184, 0.7);
}

.signin-btn {
  width: 100%;
  background: rgba(59, 130, 246, 0.8);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  color: white;
  border: 1px solid rgba(59, 130, 246, 0.4);
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 600;
  margin-top: 8px;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.signin-btn:hover {
  background: rgba(59, 130, 246, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
  transform: translateY(-1px);
}

.login-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  font-size: 14px;
}

.forgot-link {
  color: #94a3b8;
  text-decoration: none;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.forgot-link:hover {
  color: #60a5fa;
}

.signup-text {
  color: #94a3b8;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.signup-link {
  color: #60a5fa;
  text-decoration: none;
  font-weight: 500;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.signup-link:hover {
  text-decoration: underline;
  color: #3b82f6;
}

/* Dashboard Container */
.dashboard-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 220px;
  min-width: 220px;
  background: linear-gradient(180deg, #1a1d3a 0%, #2a2f5a 100%);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 2px 0 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 2rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-block;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #ffffff;
  flex-shrink: 0;
}

#drone-logo{
  height: 50px;
  width: 50px;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
}

.brand-subtitle {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  margin: 0;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
}

.sidebar-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav li {
  margin: 0.25rem 1rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  padding: 0.875rem 1rem;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  font-weight: 500;
}

.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  transform: translateX(4px);
}

.sidebar-nav a.active {
  background: linear-gradient(135deg, #4fc3f7, #00e0ff);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(79, 195, 247, 0.3);
}

.sidebar-nav i {
  margin-right: 0.75rem;
  width: 16px;
  text-align: center;
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-main);
  min-height: 100vh;
}

/* Header */
.main-header {
  padding: 28px 32px;
  border-bottom: 1px solid var(--text-muted);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.header-title h1 {
  color: var(--text-heading);
  font-weight: 700;
  font-size: 30px;
  margin-bottom: 4px;
}

.header-title p {
  color: var(--text-muted);
  font-size: 16px;
  margin: 0;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-indicator {
  background: var(--status-online);
  color: white;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.theme-toggle {
  background: var(--bg-card);
  border: none;
  color: var(--text-muted);
  padding: 10px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.theme-toggle:hover {
  background: var(--bg-main);
  color: var(--text-heading);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding: 32px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 28px 18px;
  display: flex;
  flex-direction: row;
  align-items: center;
  min-height: 140px;
  transition: box-shadow 0.2s ease;
}

.stat-card:hover {
  box-shadow: 0 8px 40px rgba(16, 24, 40, 0.28);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-right: 18px;
  flex-shrink: 0;
}

.stat-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-label {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 0;
  text-align: left;
  font-weight: 500;
}

.stat-value {
  font-size: 32px;
  color: var(--text-heading);
  font-weight: 700;
  margin: 10px 0 5px 0;
  text-align: left;
}

.stat-meta {
  font-size: 13px;
  color: var(--text-muted);
  text-align: left;
}

/* Color accent for stat icons */
.stat-card.blue .stat-icon {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
}

.stat-card.red .stat-icon {
  background: rgba(239, 68, 68, 0.13);
  color: #ef4444;
}

.stat-card.teal .stat-icon {
  background: rgba(20, 184, 166, 0.11);
  color: #14b8a6;
}

.stat-card.green .stat-icon {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

/* Content Grid */
.content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 32px;
  padding: 0 32px 40px 32px;
}

/* Left content */
.content-left {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Right content */
.content-right {
  display: flex;
  flex-direction: column;
}

/* Card styles */
.content-card {
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  color: var(--text-heading);
}

.card-header {
  padding: 20px 26px;
  border-bottom: 1px solid var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-heading);
}

.card-subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

.live-indicator {
  background: var(--status-online);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  margin-right: 8px;
}

.card-content {
  padding: 24px 26px;
}

/* Live feed */
.live-feed-box {
  background: #000;
  border-radius: 8px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3ac585;
  flex-direction: column;
  font-weight: 600;
  font-size: 15px;
}

.live-feed-box small {
  color: #69cd81;
  font-weight: 400;
  font-size: 13px;
  margin-top: 4px;
}

.feed-buttons {
  margin-top: 14px;
  display: flex;
  gap: 12px;
}

.feed-buttons button {
  background: transparent;
  border: 2px solid #3ac585;
  color: #3ac585;
  border-radius: 6px;
  padding: 8px 20px;
  font-weight: 600;
  font-size: 14px;
  cursor: not-allowed;
  opacity: 0.8;
}

/* Alerts */
.alert-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.alert-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.alert-text {
  flex: 1;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-heading);
}

.alert-badge {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 2px 8px;
}

.alert-badge.resolved {
  color: var(--status-online);
}

.alert-badge.critical {
  color: var(--status-danger);
}

.alert-time {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Footer */
.dashboard-footer {
  padding: 16px 32px;
  border-top: 1px solid var(--text-muted);
  display: flex;
  justify-content: flex-end;
}

.refresh-btn {
  background: var(--bg-card);
  border: 1px solid var(--text-muted);
  color: var(--text-muted);
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.refresh-btn:hover {
  background: var(--bg-main);
  color: var(--text-heading);
}

/* Drone Fleet Status */
.fleet-status-section {
  padding: 0 32px 40px 32px;
}

#droneFleet {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
  min-height: 150px;
}

.drone-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  padding: 14px 20px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  transition: background 0.3s ease, transform 0.2s ease;
}

.drone-card:hover {
  background: var(--bg-main);
  transform: translateY(-2px);
}

.drone-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.drone-name {
  font-weight: 600;
  color: var(--text-heading);
  font-size: 15px;
}

.drone-status {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.drone-status.online {
  color: var(--status-online);
}

.drone-status.offline {
  color: var(--status-danger);
}

.drone-status.warning {
  color: var(--status-warning);
}

.drone-actions button {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 4px 10px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.drone-actions button:hover {
  background: var(--accent);
  color: #fff;
}

.loading-text {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  padding: 20px 0;
}

/* Light mode override for fleet cards */
body[data-theme="light"] .drone-card {
  background: #ffffff;
}

body[data-theme="light"] .drone-card:hover {
  background: #f1f5f9;
}

/* Upload Section */
.upload-section {
  padding: 0 32px 40px 32px;
}

.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.upload-area,
.prediction-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.drop-zone {
  border: 2px dashed var(--accent);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
  background: rgba(59, 130, 246, 0.05);
  transition: background 0.2s ease, border 0.2s ease;
  cursor: pointer;
}

.drop-zone:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: var(--text-heading);
}

.drop-zone p {
  font-size: 16px;
  font-weight: 600;
}

.preview-card {
  margin-top: 20px;
  width: 100%;
  text-align: center;
}

.preview-img,
.preview-video {
  max-width: 100%;
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: none;
}

.prediction-box {
  text-align: center;
  padding: 30px;
  border-radius: 12px;
  background: var(--bg-card);
  box-shadow: var(--shadow);
}

.prediction-box h3 {
  margin-bottom: 16px;
  font-weight: 700;
  color: var(--text-heading);
}

.prediction-box p {
  font-size: 20px;
  font-weight: 600;
  color: var(--status-online);
}

/* Prediction Results Section */
.prediction-results {
  margin: 40px 32px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px;
  margin-top: 20px;
}

.result-card {
  background: linear-gradient(145deg, var(--bg-card), var(--bg-main));
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.result-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(59, 130, 246, 0.4);
}

.result-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.result-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
}

.result-value.critical {
  color: var(--status-danger);
}

.result-value.warning {
  color: var(--status-warning);
}

.result-value.safe {
  color: var(--status-online);
}

/* Upload box styling */
.upload-box {
  display: block;
  border: 2px dashed var(--border-color, #6c757d);
  border-radius: 12px;
  padding: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--card-bg, #2c2c2c);
  color: var(--text-color, #fff);
}

.upload-box:hover {
  background: rgba(0, 123, 255, 0.05);
  border-color: var(--accent-color, #0d6efd);
  color: var(--accent-color, #0d6efd);
}

.upload-box i {
  color: var(--accent-color, #0d6efd);
}

#userGreeting {
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
}

/* Style for the user name input inside modal */
#nameModal .form-control {
  background: rgba(30, 41, 59, 0.9);
  color: #ffffff;
  border: 1px solid rgba(59, 130, 246, 0.6);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  transition: all 0.3s ease;
}

#nameModal .form-control:focus {
  background: rgba(30, 41, 59, 1);
  border-color: #3b82f6;
  color: #ffffff;
  box-shadow: 0 0 8px #3b82f6, 0 0 15px rgba(59, 130, 246, 0.4);
  outline: none;
}

#nameModal .form-control::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

/* Stylish Name Modal */
#nameModal .modal-content {
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.3);
  animation: slideDown 0.4s ease;
}

@keyframes slideDown {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

#saveNameBtn {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  border: none;
  color: white;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.5);
  transition: all 0.3s ease;
}

#saveNameBtn:hover {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.7);
  transform: translateY(-2px);
}

/* ===================== RESPONSIVE DESIGN ===================== */

/* Large screens (1200px and up) */
@media (min-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .content-grid {
    grid-template-columns: 2fr 1fr;
  }
  
  .results-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

/* Medium screens (768px to 1199px) */
@media (max-width: 1199px) and (min-width: 768px) {
  .mobile-menu-toggle {
    display: none !important;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 20px;
  }
  
  .content-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 0 20px 40px 20px;
  }
  
  .main-header {
    padding: 20px 24px;
  }
  
  .header-content {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
  
  .header-title h1 {
    font-size: 24px;
  }
  
  .upload-section, .fleet-status-section {
    padding: 0 20px 40px 20px;
  }
  
  .results-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
  }
}

/* Small screens (767px and below) */
@media (max-width: 767px) {
  .dashboard-container {
    display: block;
    position: relative;
  }
  
  .sidebar {
    position: fixed;
    top: 0;
    left: 0; /* FIX: Set left to 0 for transform animation */
    width: 220px;
    height: 100vh;
    z-index: 1041;
    transform: translateX(-100%); /* FIX: Hide sidebar off-screen */
    transition: transform 0.3s ease;
  }
  
  .sidebar.active {
    transform: translateX(0); /* FIX: Bring sidebar on-screen */
  }
  
  .main-content {
    width: 100%;
    padding-top: 70px;
  }
  
  .mobile-menu-toggle {
    display: flex !important;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
  }
  
  .stat-card {
    padding: 20px 16px;
    min-height: auto;
  }
  
  .stat-value {
    font-size: 24px;
  }
  
  .content-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 16px 40px 16px;
  }
  
  .main-header {
    padding: 16px;
  }
  
  .header-content {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  
  .header-title h1 {
    font-size: 20px;
  }
  
  .header-title p {
    font-size: 14px;
  }
  
  .header-status {
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .upload-section, .fleet-status-section {
    padding: 0 16px 40px 16px;
  }
  
  .results-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .result-card {
    padding: 20px;
  }
  
  .card-content {
    padding: 20px;
  }
  
  .card-header {
    padding: 16px 20px;
  }
}

/* Extra small screens (480px and below) */
@media (max-width: 480px) {
  .mobile-menu-toggle {
    top: 15px;
    left: 15px;
    width: 35px;
    height: 35px;
  }
  
  .main-content {
    padding-top: 65px;
  }
  
  .main-header {
    padding: 12px;
  }
  
  .header-title h1 {
    font-size: 18px;
  }
  
  .stats-grid {
    padding: 12px;
    gap: 12px;
  }
  
  .stat-card {
    padding: 16px 12px;
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }
  
  .stat-icon {
    margin-right: 0;
    margin-bottom: 8px;
  }
  
  .content-grid {
    padding: 0 12px 40px 12px;
    gap: 16px;
  }
  
  .upload-section, .fleet-status-section {
    padding: 0 12px 40px 12px;
  }
  
  .upload-box {
    padding: 20px;
  }
  
  .result-card {
    padding: 16px;
  }
  
  .result-value {
    font-size: 18px;
  }
  
  .card-content {
    padding: 16px;
  }
  
  .card-header {
    padding: 12px 16px;
  }
  
  .btn-lg {
    padding: 10px 20px;
    font-size: 16px;
  }
}
