@import '../responsive.css';
/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #E05E1A;
  --secondary: #1A2942;
  --white: #FFFFFF;
  --gray-50: #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1E293B;
  --gray-900: #0F172A;
  --success: #22C55E;
  --warning: #EAB308;
  --danger: #EF4444;
  --blue: #3B82F6;
  --green: #10B981;
  --purple: #8B5CF6;
  --cyan: #06B6D4;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  color: var(--gray-900);
  background-color: var(--gray-50);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ------------------------------
   NAVBAR: mobile menu behaviors
   ------------------------------ */
/* Hidden by default; toggled via .active by JS */
.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 0;
  padding: 0;
  background-color: var(--white);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  border-top: 1px solid var(--gray-200);
}

.mobile-menu.active {
  display: flex;
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Mobile hamburger button visible on small screens only */
.mobile-toggle { display: flex; align-items: center; font-size: 1.5rem; color: var(--secondary); }
@media (min-width: 1210px) {
  .mobile-toggle { display: none; }
}

/* Mobile menu link styling for consistency */
.mobile-menu a { padding: 1rem 1.5rem; color: var(--gray-800); font-weight: 500; border-bottom: 1px solid var(--gray-100); }
.mobile-menu a:hover { background-color: var(--gray-50); color: var(--primary); }

/* Header */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0;
  font-weight: 700;
  font-size: 1rem;
  color: var(--secondary);
  text-decoration: none;
}

@media (min-width: 480px) {
  .logo {
    font-size: 1.2rem;
    gap: 0;
  }
}

@media (min-width: 768px) {
  .logo {
    font-size: 1.875rem;
    gap: 0;
  }
  
  .logo span {
    margin-left: -0.4rem;
  }
}

.logo i {
  color: var(--secondary);
  font-size: 1.5rem;
}

.logo-icon {
  height: 1.5rem;
  width: auto;
  object-fit: contain;
}

.logo-full {
  height: 1.2rem;
  width: auto;
  object-fit: contain;
  display: block;
}

.logo span {
  color: var(--primary);
  margin-left: -0.3rem;
}

@media (min-width: 480px) {
  .logo i {
    font-size: 2rem;
  }
  
  .logo-icon {
    height: 2rem;
  }
  
  .logo-full {
    height: 1.4rem;
  }
}

@media (min-width: 768px) {
  .logo i {
    font-size: 3rem;
  }
  
  .logo-icon {
    height: 3rem;
  }
  
  .logo-full {
    height: 2.2rem;
  }
}

.user-profile {
  display: flex;
  align-items: center;
  background: var(--primary);
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  gap: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-profile:hover {
  background: #d14f15;
}

.profile-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  object-fit: cover;
}

.profile-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.profile-name {
  color: var(--white);
  font-weight: 600;
  font-size: 0.875rem;
}

.profile-info i {
  color: var(--white);
  font-size: 0.75rem;
}

/* Main Container */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  padding-top: 7rem;
  padding-bottom: 6rem;
  flex: 1;
}

@media (min-width: 768px) {
  .main-container {
    padding-top: 8.5rem;
  }
}

@media (min-width: 1024px) {
  .main-container {
    padding-top: 10rem;
  }
}

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  gap: 1rem;
}

.welcome-section h1 {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.welcome-section p {
  color: var(--gray-600);
  font-size: 1rem;
}

.header-actions {
  display: flex;
  gap: 0.75rem;
}

/* Buttons */
.btn-primary {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: #d14f15;
}

.btn-secondary {
  background: var(--white);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 0.75rem;
  padding: 1.5rem;
  display: flex;
  gap: 1rem;
  transition: all 0.2s ease;
}

.stat-card:hover {
  border-color: var(--gray-300);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.stat-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--white);
}

.stat-icon.rides {
  background: var(--primary);
}

.stat-icon.price {
  background: var(--secondary);
}

.stat-icon.distance {
  background: var(--cyan);
}

.stat-icon.rating {
  background: var(--warning);
}

.stat-content {
  flex: 1;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: 0.5rem;
}

.stat-change {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.stat-change.positive {
  color: var(--success);
}

.stat-change.negative {
  color: var(--danger);
}

.stat-change.neutral {
  color: var(--gray-500);
}

/* Filters Section */
.filters-section {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.search-filters {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 2;
  min-width: 300px;
  max-width: 800px;
}

.search-box i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
}

.search-box input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  background: var(--white);
  transition: border-color 0.2s ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
}

.filter-controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.filter-select {
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  background: var(--white);
  color: var(--gray-700);
  min-width: 120px;
}

.btn-filter {
  padding: 0.5rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.5rem;
  background: var(--white);
  color: var(--gray-700);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-filter:hover {
  background: var(--gray-50);
}

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

/* Rides Section */
.rides-section {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 0.75rem;
  overflow: hidden;
}

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

.section-header h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
}

.view-options {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.results-count {
  color: var(--gray-600);
  font-size: 0.875rem;
}

.view-all-btn {
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease;
}

.view-all-btn:hover {
  color: #d14f15;
}

/* Rides Grid */
.rides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 0;
}

.ride-card {
  border-right: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
  padding: 1.5rem;
  transition: background-color 0.2s ease;
  position: relative;
}

.ride-card:hover {
  background: var(--gray-50);
}

.ride-card:nth-child(2n) {
  border-right: none;
}

.ride-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.status-badge {
  background: var(--success);
  color: var(--white);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.ride-time {
  color: var(--gray-500);
  font-size: 0.875rem;
  white-space: nowrap;
}

/* Route Display */
.ride-route {
  position: relative;
  margin-bottom: 1.5rem;
}

.route-point {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.route-point:last-child {
  margin-bottom: 0;
}

.route-point i {
  margin-top: 0.125rem;
  font-size: 0.75rem;
}

.route-point.pickup i {
  color: var(--success);
}

.route-point.dropoff i {
  color: var(--danger);
}

.location-info {
  flex: 1;
}

.location-name {
  font-weight: 600;
  color: var(--gray-900);
  font-size: 0.875rem;
  display: block;
  margin-bottom: 0.125rem;
}

.location-detail {
  color: var(--gray-500);
  font-size: 0.75rem;
}

.route-line {
  position: absolute;
  left: 0.25rem;
  top: 1.25rem;
  width: 2px;
  height: 1rem;
  background: var(--gray-300);
  border-radius: 1px;
}

/* Ride Details */
.ride-details {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.driver-info {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex: 1;
}

.driver-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  object-fit: cover;
}

.driver-details {
  flex: 1;
}

.driver-name {
  font-weight: 600;
  color: var(--gray-900);
  font-size: 0.875rem;
  display: block;
  margin-bottom: 0.25rem;
}

.driver-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.university {
  color: var(--gray-500);
  font-size: 0.75rem;
}

.rating {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--warning);
  font-size: 0.75rem;
  font-weight: 600;
}

.ride-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray-600);
  font-size: 0.75rem;
}

.info-item i {
  color: var(--gray-400);
  width: 0.875rem;
}

.ride-price {
  text-align: right;
}

.price-amount {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  display: block;
}

.price-label {
  color: var(--gray-500);
  font-size: 0.75rem;
}

/* Ride Actions */
.ride-actions {
  display: flex;
  gap: 0.75rem;
}

.btn-primary-sm,
.btn-secondary-sm {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

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

.btn-primary-sm:hover {
  background: #d14f15;
}

.btn-secondary-sm {
  background: var(--white);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}

.btn-secondary-sm:hover {
  background: var(--gray-50);
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--white);
  border-radius: 1rem;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease;
  border-top: 5px solid var(--primary);
}

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

.modal-header h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
}

.modal-close {
  font-size: 1.5rem;
  color: var(--gray-400);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.25rem;
  transition: all 0.2s ease;
  line-height: 1;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 10;
}

.modal-close:hover {
  color: var(--gray-600);
  background: var(--gray-100);
}

.modal-body {
  padding: 2rem;
}

.modal-footer {
  padding: 1.5rem 2rem;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.modal-footer button {
  padding: 0.875rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  min-width: 120px;
}

.modal-footer .btn-outline {
  background: var(--white);
  color: var(--gray-600);
  border: 2px solid var(--gray-300) !important;
}

.modal-footer .btn-outline:hover {
  background: var(--gray-50);
  border-color: var(--gray-400) !important;
  color: var(--gray-700);
}

.modal-footer .btn-primary {
  background: var(--primary);
  color: var(--white);
}

.modal-footer .btn-primary:hover:not(:disabled) {
  background: #c04d15;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(224, 94, 26, 0.3);
}

.modal-footer .btn-primary:disabled {
  background: var(--gray-400);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Animation */
@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .modal {
    width: 95%;
    margin: 1rem;
  }
  
  .modal-body {
    padding: 1.5rem;
  }
  
  .modal-footer {
    padding: 1rem 1.5rem;
    flex-direction: column-reverse;
  }
  
  .modal-footer button {
    width: 100%;
  }
}

/* Responsive Design */
@media (max-width: 1024px) {
  .main-container {
    padding: 1.5rem;
  }
  
  .rides-grid {
    grid-template-columns: 1fr;
  }
  
  .ride-card {
    border-right: none;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .header-content {
    padding: 0 1rem;
  }
  
  .main-container {
    padding: 1rem;
    padding-top: 6.5rem;
  }
  
  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  
  .header-actions {
    justify-content: flex-start;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .search-filters {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-box {
    min-width: auto;
  }
  
  .filter-controls {
    justify-content: flex-start;
  }
  
  .ride-details {
    flex-direction: column;
    gap: 1rem;
  }
  
  .ride-price {
    text-align: left;
  }
  
  .ride-actions {
    justify-content: stretch;
  }
  
  .btn-primary-sm,
  .btn-secondary-sm {
    flex: 1;
  }
}

@media (max-width: 480px) {
  .header-content {
    padding: 0 0.75rem;
  }
  
  .main-container {
    padding: 0.75rem;
    padding-top: 5.5rem;
  }
  
  .user-profile {
    padding: 0.375rem 0.75rem;
  }
  
  .profile-name {
    display: none;
  }
  
  .welcome-section h1 {
    font-size: 1.5rem;
  }
  
  .header-actions {
    flex-direction: column;
  }
  
  .stat-card {
    padding: 1rem;
  }
  
  .filters-section {
    padding: 1rem;
  }
  
  .section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  
  .view-options {
    justify-content: space-between;
  }
}

/* Loading, Empty, and Error States */
.loading-state,
.empty-state,
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  min-height: 400px;
}

.loading-state {
  color: var(--gray-600);
}

.loading-spinner {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

.loading-spinner i {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.empty-state i,
.error-state i {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  color: var(--gray-400);
}

.error-state i {
  color: var(--danger);
}

.empty-state h3,
.error-state h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--gray-900);
}

.empty-state p,
.error-state p {
  color: var(--gray-600);
  margin-bottom: 1.5rem;
  max-width: 400px;
}

.error-state .btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.error-state .btn-primary:hover {
  background: #C1490F;
  transform: translateY(-1px);
}