/* Navigation */
.navbar {
  background-color: white !important;
  padding: 1rem 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.navbar-brand {
  color: var(--primary-color) !important;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.5px;
}

/* Mobile Navigation */
@media (max-width: 768px) {
  .navbar {
    padding: 0.5rem 0;
  }
  
  .navbar-brand {
    font-size: 1.2rem;
  }
  
  .navbar .d-flex {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
  }
  
  .navbar .btn-group {
    order: 2;
  }
  
  .navbar .badge {
    order: 1;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }
  
  .navbar .btn {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
  }
}

/* Badges */
.badge {
  background-color: var(--secondary-color) !important;
  color: white !important;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 20px;
}

/* Buttons */
.btn-outline-primary {
  border-color: var(--primary-color);
  color: var(--primary-color);
  transition: all 0.3s ease;
}

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

.btn-outline-secondary {
  border-radius: 20px;
  padding: 0.5rem 1.5rem;
  transition: all 0.3s ease;
  border-color: var(--border-color);
  color: var(--primary-color);
  background-color: white;
}

.btn-outline-secondary:hover,
.btn-check:checked + .btn-outline-secondary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.btn-check:checked + .btn-outline-secondary {
  border-bottom-color: white;
  margin-bottom: -1px;
}

.btn-group {
  margin-bottom: 0;
}

/* Mobile Button Adjustments */
@media (max-width: 768px) {
  .btn {
    min-height: 44px; /* Touch-friendly minimum size */
    font-size: 0.875rem;
  }
  
  .btn-outline-secondary {
    padding: 0.5rem 1rem;
  }
  
  .btn-group .btn {
    padding: 0.5rem 0.75rem;
  }
}

/* Cards */
.card {
  border: 1px solid var(--border-color);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  background-color: white;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.card-header {
  background-color: var(--light-bg);
  color: var(--primary-color);
  border-radius: 8px 8px 0 0 !important;
  padding: 1rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
}

.sticky-card {
  position: sticky;
  top: 100px;
}

/* Mobile Card Adjustments */
@media (max-width: 768px) {
  .card {
    margin-bottom: 1rem;
  }
  
  .card-header {
    padding: 0.75rem;
    font-size: 0.9rem;
  }
  
  .sticky-card {
    position: static;
    top: auto;
  }
}

/* List Groups */
.list-group-item {
  border: none;
  border-bottom: 1px solid var(--border-color);
  padding: 1rem;
}

.list-group-item:last-child {
  border-bottom: none;
}

.list-group-item a {
  word-break: break-all;
  display: inline-block;
  max-width: 100%;
}

/* Mobile List Group Adjustments */
@media (max-width: 768px) {
  .list-group-item {
    padding: 0.75rem;
    font-size: 0.875rem;
  }
}

/* Navigation Tabs */
.nav-tabs {
  border: none;
  margin-bottom: 1rem;
}

.nav-tabs .nav-link {
  border: none;
  color: var(--primary-color);
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.nav-tabs .nav-link.active {
  background-color: var(--primary-color);
  color: white;
}

.nav-tabs .nav-link:hover:not(.active) {
  background-color: #f1f3f4;
}

.tab-content {
  margin-top: -1px;
  border-top: 1px solid var(--border-color);
}

/* Navigation Pills */
.nav-pills {
  margin: -0.5rem 0;
}

.nav-pills .nav-link {
  color: var(--primary-color);
  border-radius: 20px;
  padding: 0.5rem 1.5rem;
  margin: 0 0.25rem;
  transition: all 0.3s ease;
  background-color: white;
}

.nav-pills .nav-link:hover {
  background-color: var(--light-bg);
}

.nav-pills .nav-link.active {
  background-color: var(--primary-color);
  color: white;
}

.nav-pills .nav-link i {
  margin-right: 0.5rem;
}

/* Map */
#map { 
  height: 500px; 
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  border: 1px solid var(--border-color);
}

/* Mobile Map Adjustments */
@media (max-width: 768px) {
  #map {
    height: 300px;
    border-radius: 4px;
  }
}

/* Table */
#trialsTable {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  border: 1px solid var(--border-color);
}

#trialsTable tbody tr {
  transition: all 0.3s ease;
}

#trialsTable tbody tr:hover {
  cursor: pointer;
  background-color: #f1f3f4;
}

/* Mobile Table Adjustments */
@media (max-width: 768px) {
  #trialsTable {
    font-size: 0.875rem;
  }
  
  #trialsTable th,
  #trialsTable td {
    padding: 0.5rem 0.25rem;
  }
  
  /* Make table scrollable horizontally on mobile */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Mobile Layout Adjustments */
@media (max-width: 768px) {
  /* Stack columns on mobile */
  .row > .col-4,
  .row > .col-8 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  
  /* Adjust spacing */
  .container {
    padding: 0.5rem;
  }
  
  .mb-4 {
    margin-bottom: 1rem !important;
  }
  
  .g-4 {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 1rem;
  }
  
  /* Adjust chart containers */
  #statusChart,
  #categoryChart,
  #countryChart {
    height: 200px !important;
  }
  
  /* Adjust filter containers */
  .card-body {
    padding: 0.75rem;
  }
  
  /* Make filters more touch-friendly */
  .ts-wrapper .ts-control {
    min-height: 44px;
    padding: 0.75rem;
  }
  
  /* Adjust trial counter */
  #trialCounter {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
  }
  
  /* Adjust view toggle buttons */
  .btn-group {
    width: 100%;
    margin-bottom: 1rem;
  }
  
  .btn-group .btn {
    flex: 1;
    text-align: center;
  }
}

/* Tablet Adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  .row > .col-4 {
    flex: 0 0 35%;
    max-width: 35%;
  }
  
  .row > .col-8 {
    flex: 0 0 65%;
    max-width: 65%;
  }
  
  #map {
    height: 400px;
  }
  
  #statusChart,
  #categoryChart,
  #countryChart {
    height: 220px !important;
  }
}

/* Large Screen Optimizations */
@media (min-width: 1200px) {
  .container {
    max-width: 1400px;
  }
  
  #map {
    height: 600px;
  }
  
  #statusChart,
  #categoryChart,
  #countryChart {
    height: 280px !important;
  }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Increase touch targets */
  .btn,
  .nav-link,
  .list-group-item {
    min-height: 44px;
  }
  
  /* Remove hover effects on touch devices */
  .btn:hover,
  .nav-link:hover,
  .list-group-item:hover {
    transform: none;
  }
  
  /* Add active states for touch feedback */
  .btn:active,
  .nav-link:active,
  .list-group-item:active {
    transform: scale(0.98);
  }
}

/* High DPI Display Optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .card {
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  }
  
  #map {
    border-width: 0.5px;
  }
}

/* Print Styles */
@media print {
  .navbar,
  .btn-group,
  #clearFilters,
  .sticky-card {
    display: none !important;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
  
  #map {
    height: 400px;
    page-break-inside: avoid;
  }
  
  #trialsTable {
    font-size: 12px;
  }
} 