/* Base styles */
html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  background-color: #f8f9fa;
}

/* Customer Search App Styles */
.customer-search-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.search-card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease;
}

.search-card:hover {
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.search-card .card-header {
  border-radius: 12px 12px 0 0 !important;
  padding: 1.5rem;
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
}

.search-card .card-body {
  padding: 2rem;
}

.company-logo {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  transition: transform 0.3s ease;
}

.company-logo:hover {
  transform: scale(1.05);
}

.navbar-brand {
  transition: transform 0.3s ease;
}

.navbar-brand:hover {
  transform: scale(1.02);
}

/* Search Form Styles */
.search-form {
  margin-bottom: 2rem;
}

.input-group {
  display: flex;
  width: 100%;
}

.search-input {
  border-radius: 8px 0 0 8px;
  border: 2px solid #e9ecef;
  padding: 0.75rem 1rem;
  font-size: 1.1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  flex: 1;
  min-width: 0;
  display: block;
  visibility: visible;
  opacity: 1;
}

.search-input:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
  outline: none;
}

.search-button {
  border-radius: 0 8px 8px 0;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  transition: background-color 0.3s ease;
  flex-shrink: 0;
}

.search-button:hover:not(:disabled) {
  background-color: #0056b3;
}

.search-button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

/* Status Messages */
.status-container {
  margin-bottom: 1.5rem;
  min-height: 60px;
}

.alert {
  border-radius: 8px;
  border: none;
  padding: 1rem 1.25rem;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border-left: 4px solid #28a745;
}

.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
  border-left: 4px solid #dc3545;
}

.alert-info {
  background-color: #d1ecf1;
  color: #0c5460;
  border-left: 4px solid #17a2b8;
}

/* Results Table */
.results-container {
  margin-top: 1.5rem;
}

.table-responsive {
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.table {
  margin-bottom: 0;
  background-color: white;
}

.table thead th {
  border-bottom: 2px solid #dee2e6;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.5px;
  background-color: #343a40;
  color: white;
  padding: 1rem;
}

.table tbody tr {
  transition: background-color 0.2s ease;
}

.table tbody tr:hover {
  background-color: #f8f9fa;
}

.table tbody td {
  padding: 1rem;
  vertical-align: middle;
  border-color: #e9ecef;
}

/* No Results State */
.no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: #6c757d;
}

.no-results i {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.no-results p {
  font-size: 1.1rem;
  margin: 0;
}

/* Loading Spinner */
.spinner-border-sm {
  width: 1rem;
  height: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .customer-search-container {
    padding: 1rem 0.5rem;
  }
  
  .search-card .card-body {
    padding: 1.5rem 1rem;
  }
  
  .search-input {
    font-size: 1rem;
    padding: 0.625rem 0.75rem;
  }
  
  .search-button {
    padding: 0.625rem 1rem;
  }
  
  .table {
    font-size: 0.875rem;
  }
  
  .table thead th,
  .table tbody td {
    padding: 0.75rem 0.5rem;
  }
  
  .alert {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }
}

@media (max-width: 576px) {
  .customer-search-container {
    padding: 1rem 0.5rem;
  }
  
  .search-card .card-header {
    padding: 1rem;
  }
  
  .search-card .card-header h2 {
    font-size: 1.25rem;
  }
  
  .search-card .card-body {
    padding: 1rem;
  }
  
  .company-logo {
    height: 30px !important;
  }
  
  .input-group {
    flex-direction: column;
    display: flex !important;
  }
  
  .search-input {
    border-radius: 8px !important;
    margin-bottom: 0.75rem;
    width: 100% !important;
    font-size: 1rem !important;
    padding: 0.75rem !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 44px !important;
  }
  
  .search-button {
    border-radius: 8px !important;
    width: 100%;
    padding: 0.75rem !important;
    min-height: 44px !important;
  }
  
  .search-form {
    margin-bottom: 1.5rem;
  }
  
  .form-text {
    font-size: 0.875rem;
    margin-top: 0.5rem;
  }
  
  .table-responsive {
    font-size: 0.8rem;
  }
  
  .table thead th,
  .table tbody td {
    padding: 0.5rem 0.25rem;
  }
}

/* Additional mobile fixes */
@media (max-width: 768px) {
  .search-input {
    min-height: 44px; /* iOS recommendation for touch targets */
  }
  
  .search-button {
    min-height: 44px; /* iOS recommendation for touch targets */
  }
}

/* Ensure visibility on all mobile devices */
@media (max-width: 992px) {
  .search-input {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 1 !important;
  }
}

/* Extra mobile fixes for specific devices */
@media (max-width: 480px) {
  .search-input {
    font-size: 16px !important; /* Prevent zoom on iOS */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
  }
  
  .search-input::-webkit-search-decoration,
  .search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
  }
}

/* Force visibility for all mobile browsers */
.search-input {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Accessibility improvements */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus indicators for better accessibility */
.btn:focus-visible,
.form-control:focus-visible {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .search-card {
    border: 2px solid #000;
  }
  
  .table {
    border: 2px solid #000;
  }
  
  .table thead th {
    border-bottom: 2px solid #000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .search-card,
  .search-input,
  .search-button,
  .alert,
  .table tbody tr {
    transition: none;
  }
  
  @keyframes slideIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}