/* Custom styles for Ayurveda Clinic */

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.section {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-btn {
  transition: all 0.2s ease;
}

.nav-btn:hover {
  transform: translateY(-2px);
}

/* Print styles for prescriptions */
@media print {
  nav, button, .no-print {
    display: none !important;
  }
  
  body {
    background: white;
  }
  
  .fixed {
    position: relative !important;
  }
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

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

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Loading animation */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.fa-spin {
  animation: spin 1s linear infinite;
}

/* ==================== MOBILE RESPONSIVENESS ==================== */

/* Mobile-first responsive design */
@media (max-width: 768px) {
  /* Prevent horizontal overflow */
  body {
    overflow-x: hidden;
    width: 100vw;
  }
  
  /* Container adjustments */
  .container,
  .max-w-7xl,
  .max-w-6xl,
  .max-w-4xl {
    max-width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Navigation responsiveness */
  nav {
    flex-wrap: wrap;
    padding: 0.75rem 1rem !important;
  }
  
  .nav-btn {
    padding: 0.5rem !important;
    font-size: 0.75rem !important;
    min-width: auto !important;
  }
  
  .nav-btn span {
    display: none; /* Hide text, show only icons */
  }
  
  .nav-btn i {
    margin-right: 0 !important;
  }
  
  /* Header adjustments */
  h1 {
    font-size: 1.25rem !important;
  }
  
  h2 {
    font-size: 1.125rem !important;
  }
  
  h3 {
    font-size: 1rem !important;
  }
  
  /* Table responsiveness */
  .overflow-x-auto {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100vw;
  }
  
  table {
    font-size: 0.75rem !important;
    min-width: 800px; /* Force horizontal scroll for wide tables */
  }
  
  table th,
  table td {
    padding: 0.5rem !important;
    white-space: nowrap;
  }
  
  /* Button adjustments */
  button,
  .btn {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.875rem !important;
  }
  
  /* Action buttons in tables */
  .action-buttons button {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.75rem !important;
  }
  
  /* Form adjustments */
  input,
  select,
  textarea {
    font-size: 1rem !important; /* Prevent zoom on iOS */
    padding: 0.625rem !important;
  }
  
  /* Modal adjustments */
  .modal {
    padding: 0.5rem !important;
  }
  
  .modal > div {
    max-width: 95vw !important;
    max-height: 90vh !important;
    margin: 1rem !important;
  }
  
  /* Card adjustments */
  .bg-white,
  .card {
    padding: 1rem !important;
    margin-bottom: 1rem !important;
  }
  
  /* Grid adjustments */
  .grid {
    grid-template-columns: 1fr !important;
  }
  
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4,
  .md\:grid-cols-2,
  .md\:grid-cols-3,
  .lg\:grid-cols-4 {
    grid-template-columns: 1fr !important;
  }
  
  /* Flex adjustments */
  .flex {
    flex-wrap: wrap;
  }
  
  .flex-row {
    flex-direction: column !important;
  }
  
  /* Search and filter adjustments */
  .search-filter-container {
    flex-direction: column !important;
  }
  
  .search-filter-container > * {
    width: 100% !important;
    margin-bottom: 0.5rem;
  }
  
  /* Stats cards */
  .stats-grid {
    grid-template-columns: 1fr !important;
  }
  
  /* Dashboard cards */
  .dashboard-grid {
    grid-template-columns: 1fr !important;
  }
  
  /* Hide less important columns on mobile */
  .hide-mobile {
    display: none !important;
  }
  
  /* Profile section */
  .profile-section {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
  
  /* Logo and title */
  .logo-title {
    font-size: 0.875rem !important;
  }
  
  /* Spacing adjustments */
  .p-8 {
    padding: 1rem !important;
  }
  
  .p-6 {
    padding: 0.75rem !important;
  }
  
  .px-8 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  .py-8 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
  }
  
  /* Gap adjustments */
  .gap-6 {
    gap: 1rem !important;
  }
  
  .gap-4 {
    gap: 0.75rem !important;
  }
  
  /* Export buttons */
  .export-buttons {
    flex-direction: column !important;
    width: 100% !important;
  }
  
  .export-buttons button {
    width: 100% !important;
    margin-bottom: 0.5rem !important;
  }
}

/* Extra small devices (phones, 375px and down) */
@media (max-width: 375px) {
  .container {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }
  
  table {
    font-size: 0.7rem !important;
  }
  
  .nav-btn {
    padding: 0.375rem !important;
    font-size: 0.7rem !important;
  }
  
  h1 {
    font-size: 1.125rem !important;
  }
}

/* PWA Install prompt */
.install-prompt {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 16px;
  z-index: 100;
  max-width: 300px;
}

/* Offline indicator */
.offline-indicator {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: #ef4444;
  color: white;
  padding: 8px 16px;
  border-radius: 4px;
  z-index: 100;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    transform: translate(-50%, -100%);
  }
  to {
    transform: translate(-50%, 0);
  }
}

/* Country dropdown styles */
#country-dropdown {
  max-height: 240px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

#country-dropdown .country-option {
  transition: background-color 0.15s ease;
}

#country-dropdown .country-option:hover {
  background-color: #f0fdf4;
}

/* Phone field styling */
.phone-field {
  animation: slideIn 0.2s ease-out;
}

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

/* Country code display */
#phone-country-code-display,
.phone-display-code {
  min-width: 65px;
  text-align: center;
  background-color: #f3f4f6;
  border-color: #d1d5db;
}
