/* Global styles for AutoHub application */
/* This file is referenced in index.html and provides base styling */

/* Reset and base styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ensure proper scrolling behavior */
html {
  scroll-behavior: smooth;
  /* Enable momentum scrolling on iOS */
  -webkit-overflow-scrolling: touch;
}

/* Ensure body can scroll properly on mobile */
body {
  /* Enable touch scrolling */
  -webkit-overflow-scrolling: touch;
  /* Allow all touch actions */
  touch-action: manipulation;
  /* Ensure proper overflow behavior */
  overflow-x: hidden;
  overflow-y: auto;
}

/* Loading states */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Hide scrollbar utility */
.scrollbar-hide {
  -ms-overflow-style: none;  /* Internet Explorer 10+ */
  scrollbar-width: none;  /* Firefox */
}
.scrollbar-hide::-webkit-scrollbar {
  display: none;  /* Safari and Chrome */
}

/* Ensure main containers allow proper scrolling */
#root {
  /* Enable touch scrolling */
  -webkit-overflow-scrolling: touch;
  /* Allow all touch actions */
  touch-action: manipulation;
  /* Ensure proper height */
  min-height: 100vh;
  /* Ensure proper overflow behavior */
  overflow-x: hidden;
  overflow-y: auto;
}

/* Normalize select element appearance across browsers */
/* Fix Safari 3D effect to match Chrome's flat appearance */
select {
  /* Remove default browser styling */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  
  /* Remove Safari's 3D effect and border styling */
  background-image: none;
  border-radius: inherit;
  
  /* Ensure consistent background and border */
  background-color: inherit;
  border: inherit;
  
  /* Add custom dropdown arrow */
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
  
  /* Ensure padding accounts for the arrow */
  padding-right: 32px;
  
  /* Remove focus outline and use consistent focus styling */
  outline: none;
}

/* Ensure focus states work consistently */
select:focus {
  /* Use the same focus styling as other form elements */
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
  border-color: #3b82f6;
}

/* For dark theme selects (most common in the app) */
select[class*="bg-gray"] {
  color: white;
}

/* Ensure the arrow color matches the text color */
select[class*="text-white"] {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
}

/* For disabled selects */
select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Print styles */
@media print {
  body {
    background: white !important;
    color: black !important;
  }
  
  /* Ensure selects print properly */
  select {
    background-image: none !important;
    -webkit-print-color-adjust: exact;
  }
}