/* Suggestions */
.suggestions-container {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  margin-top: 5px;
  overflow-x: hidden;
}

.suggestion-item {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  word-wrap: break-word;
  white-space: normal;
}

.suggestion-item:hover {
  background: #f8fafc;
  transform: translateX(5px);
}

.suggestion-item.active {
  background: var(--primary);
  color: white;
}

.drug-name {
  font-weight: 600;
  color: var(--dark);
}

.active-ingredient {
  font-size: 0.9rem;
  color: var(--secondary);
  font-style: italic;
}

.drug-name,
.active-ingredient {
  word-break: break-word;
  white-space: normal;
}

.suggestion-item.active .drug-name,
.suggestion-item.active .active-ingredient {
  color: white;
}

/* Drug Card */
.drug-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin-bottom: 2rem;
  border: 1px solid #f1f5f9;
  transition: all 0.3s ease;
}

.drug-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.drug-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 1.5rem;
}

.drug-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.drug-subtitle {
  opacity: 0.9;
  font-size: 1rem;
}

.drug-body {
  padding: 1.5rem;
}

/* Info Grid */
.info-grid {
  display: flex;
  flex-direction: column;
  max-width: 100%;
}

.info-section {
  background: #f8fafc;
  border-radius: 12px;
  padding: 1rem;
  width: 100%;
  margin-bottom: 0;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-row {
  display: flex;
  justify-content: column;
  align-items: flex-start;
  padding: 0.75rem 0;
  border-bottom: 1px solid #e2e8f0;
  gap: 0.25rem;
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  font-weight: 600;
  color: var(--dark);
  text-align: left;
  min-width: 160px;
}

.info-value {
  color: var(--secondary);
  text-align: left;
  white-space: pre-wrap;
  line-height: 1.5;
}

/* Buttons */
.action-buttons {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e2e8f0;
  margin-bottom: 1rem;
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--secondary);
  color: var(--secondary);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
}

/* Animations */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Custom Dropdown Styles */
.calculator-form .form-select {
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.875rem 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--dark);
  background-color: white;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-position: right 1rem center;
  background-repeat: no-repeat;
  background-size: 16px 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  appearance: none;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.calculator-form .form-select:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.calculator-form .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15),
    0 4px 12px rgba(37, 99, 235, 0.1);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%232563eb' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  outline: none;
}

/* Nav Tabs */
.nav-tabs {
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 1.5rem;
  background: #f8fafc;
  border-radius: 8px;
  padding: 4px;
}

.nav-tabs .nav-link {
  border: none;
  color: var(--secondary);
  font-weight: 500;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  transition: all 0.3s ease;
  margin: 0 2px;
}

.nav-tabs .nav-link.active {
  color: var(--primary);
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-bottom: none;
}

.nav-tabs .nav-link:hover {
  color: var(--primary);
  background: rgba(37, 99, 235, 0.05);
  border-color: transparent;
}

/* Mobile Responsive for Components */
@media (max-width: 768px) {
  .info-grid {
    grid-template-columns: 1fr;
  }

  .info-row {
    flex-direction: column;
    gap: 0.5rem;
  }

  .info-label {
    min-width: auto;
  }

  .info-value {
    text-align: left;
  }

  .action-buttons {
    flex-direction: column;
  }

  .suggestions-container {
    position: fixed;
    top: auto;
    left: 20px;
    right: 20px;
    max-height: 200px;
  }
}

/* Print Styles */
@media print {
  .search-section,
  .action-buttons,
  .stats-bar {
    display: none !important;
  }
  .app-header {
    background: #2563eb !important;
    -webkit-print-color-adjust: exact;
  }
  body {
    background: white !important;
  }
  .app-container {
    box-shadow: none !important;
    margin: 0 !important;
  }
}
