/* frontend/src/styles/main.css */

body { 
  font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

code, pre, .font-mono {
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', 'Courier New', monospace;
  font-feature-settings: 'liga' 1, 'calt' 1;
}

.app-toast {
  font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2), 0 6px 10px rgba(0, 0, 0, 0.15);
}

button {
  font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 500;
  letter-spacing: -0.01em;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 600;
  letter-spacing: -0.025em;
}

input, textarea, select {
  font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 400;
  autocomplete: off;
  -webkit-autocomplete: off;
  -moz-autocomplete: off;
  -ms-autocomplete: off;
  -o-autocomplete: off;
}

input[type="text"], input[type="email"], input[type="tel"], input[type="url"], input[type="search"] {
  autocomplete: off !important;
  -webkit-autocomplete: off !important;
  -moz-autocomplete: off !important;
  -ms-autocomplete: off !important;
  -o-autocomplete: off !important;
}

input::-webkit-contacts-auto-fill-button,
input::-webkit-credentials-auto-fill-button {
  visibility: hidden;
  display: none !important;
  pointer-events: none;
  height: 0;
  width: 0;
  margin: 0;
}

.modal-backdrop, .loading-overlay { 
  position: fixed; 
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%; 
  background-color: rgba(0, 0, 0, 0.6); 
  display: flex; 
  justify-content: center; 
  align-items: center; 
  z-index: 9999; 
}

/* RESPONSIVE NAVIGATION STYLES */
.nav-link { 
  padding: 0.5rem 1rem; 
  color: rgb(209 213 219); 
  border-radius: 0.375rem; 
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-link.active { 
  background-color: rgb(55 65 81); 
  color: rgb(34 211 238); 
  font-weight: 600; 
}

.nav-link:not(.active):hover { 
  background-color: rgb(55 65 81); 
  color: rgb(255 255 255); 
}

/* Mobile navigation specific styles */
#mobile-nav .nav-link {
  padding: 0.75rem 1rem;
  margin: 0.125rem 0;
  border-radius: 0.5rem;
  display: block;
  white-space: normal;
}

#mobile-nav .nav-link.active {
  background-color: rgb(55 65 81);
  color: rgb(34 211 238);
  font-weight: 600;
}

#mobile-nav .nav-link:not(.active):hover {
  background-color: rgb(75 85 99);
  color: rgb(255 255 255);
}

/* Ensure proper container sizing */
.container {
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* Mobile-first responsive breakpoints */
@media (max-width: 1024px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Hide desktop nav, show mobile nav button */
  #main-nav {
    display: none !important;
  }
}

@media (min-width: 1024px) {
  /* Hide mobile nav button, show desktop nav */
  #mobile-menu-btn {
    display: none !important;
  }
  
  #mobile-nav {
    display: none !important;
  }
  
  #main-nav {
    display: flex !important;
  }
}

/* Tablet and small desktop adjustments */
@media (max-width: 1280px) and (min-width: 1024px) {
  .nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
  }
  
  h1 {
    font-size: 1.25rem !important;
  }
}

/* Very small screens */
@media (max-width: 640px) {
  .nav-link {
    font-size: 0.875rem;
  }
  
  h1 {
    font-size: 1.125rem !important;
  }
  
  /* Reduce padding on very small screens */
  nav {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
  }
}

/* Prevent header content overflow */
header nav {
  overflow: hidden;
}

header .container {
  min-width: 0; /* Allow flex items to shrink */
}

/* Dropdown z-index fix - ensure dropdowns appear above everything */
#menu-dropdown {
  z-index: 9999 !important;
  position: absolute !important;
  right: 0 !important;
  top: 100% !important;
  margin-top: 0.5rem !important;
}

/* Ensure dropdown container has proper positioning context */
#menu-container {
  position: relative;
  z-index: 9998;
}

/* Override any container overflow issues */
header, nav, .container {
  overflow: visible !important;
}

/* Stop dropdown flickering on hover */
#menu-container:hover #menu-dropdown {
  /* Remove any hover-based visibility changes */
}

/* Additional z-index safety for mobile screens */
@media (max-width: 1024px) {
  #menu-dropdown {
    right: 0 !important;
    left: auto !important;
    transform: none !important;
  }
}

/* Mobile menu animation */
#mobile-nav {
  transition: all 0.3s ease-in-out;
}

#mobile-nav.hidden {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}

#mobile-nav:not(.hidden) {
  max-height: 400px;
  opacity: 1;
}

.tool-card { 
  @apply bg-gray-800 p-6 rounded-lg shadow-lg; 
}

#map-canvas { 
  height: calc(100vh - 270px); 
}

#vcf-results { 
  display: grid; 
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); 
  gap: 0.75rem; 
}

.contact-card { 
  @apply bg-gray-800 p-3 rounded-lg cursor-pointer border border-gray-700 hover:bg-gray-700 hover:border-cyan-500 text-center; 
}

.contact-card h4 { 
  @apply text-gray-300 font-semibold truncate cursor-pointer; 
}

.contact-card:hover h4 { 
  color: #22d3ee !important; 
}

.loader { 
  border: 4px solid #374151; 
  border-top: 4px solid #06b6d4; 
  border-radius: 50%; 
  width: 40px; 
  height: 40px; 
  animation: spin 1s linear infinite; 
}

@keyframes spin { 
  0% { transform: rotate(0deg); } 
  100% { transform: rotate(360deg); } 
}

.loader-small { 
  border: 2px solid #374151; 
  border-top: 2px solid #06b6d4; 
  border-radius: 50%; 
  width: 16px; 
  height: 16px; 
  animation: spin 1s linear infinite; 
}

.progress-bar { 
  @apply w-full bg-gray-600 rounded-full h-2.5; 
}

.progress-bar-fill { 
  @apply bg-cyan-500 h-2.5 rounded-full transition-all duration-500 ease-linear;
  background: linear-gradient(90deg, #06b6d4, #0891b2);
}

.note-tab { 
  @apply px-4 py-2 text-gray-300 bg-gray-600 transition-colors; 
  font-weight: 500; 
}

.note-tab.active { 
  background-color: #374151 !important; 
  color: #22d3ee !important; 
  font-weight: 600 !important; 
}

.note-tab:not(.active):hover { 
  @apply bg-gray-500; 
}

.note-tab:focus {
  outline: none !important;
  box-shadow: none !important;
}

#close-notes-btn:focus {
  outline: none !important;
  box-shadow: none !important;
}

#notes-fab:focus {
  outline: none !important;
  box-shadow: none !important;
}

.ql-editor { 
  font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; 
  height: 100%; 
}

.ql-container.ql-snow { 
  border: none; 
} 

.ql-snow .ql-stroke { 
  stroke: white; 
}

.ql-snow .ql-fill, .ql-snow .ql-stroke.ql-fill { 
  fill: white; 
}

.ql-snow .ql-picker-label { 
  color: white; 
}

.ql-snow .ql-formats button:hover .ql-stroke, .ql-snow .ql-formats button.ql-active .ql-stroke { 
  stroke: #22d3ee; 
}

.ql-snow .ql-formats button:hover .ql-fill, .ql-snow .ql-formats button.ql-active .ql-fill { 
  fill: #22d3ee; 
}

::-webkit-scrollbar { 
  width: 8px; 
}

::-webkit-scrollbar-track { 
  background: #2d3748; 
  border-radius: 4px; 
}

::-webkit-scrollbar-thumb { 
  background: #06b6d4; 
  border-radius: 4px; 
}

::-webkit-scrollbar-thumb:hover { 
  background: #22d3ee; 
}

.name-input { 
  text-transform: uppercase; 
}

#main-nav.nav-invisible { 
  visibility: hidden; 
}

button:focus, input:focus, textarea:focus, select:focus {
  outline: 2px solid #06b6d4;
  outline-offset: 2px;
}

* {
  text-rendering: optimizeLegibility;
}

.search-input-standard {
  height: 44px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.5;
  autocomplete: off !important;
  -webkit-autocomplete: off !important;
}
