/* Patient Management Styles */

.patients-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.patients-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.search-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-input {
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.9rem;
  min-width: 300px;
  background: white;
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(63, 185, 189, 0.1);
}

.filter-section select {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
  min-width: 150px;
}

.patients-actions {
  display: flex;
  gap: 0.5rem;
}

/* Statistics Cards */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  font-size: 2rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  border-radius: 50%;
}

.stat-content h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: bold;
  color: #333;
}

.stat-content p {
  margin: 0.25rem 0 0 0;
  color: #6c757d;
  font-size: 0.9rem;
}

/* Patients List */
.patients-container {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.patients-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1rem;
  padding: 1rem;
}

.patient-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.patient-card:hover {
  background-color: #f8f9fa;
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(63, 185, 189, 0.15);
  transform: translateY(-2px);
}

.patient-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.patient-name {
  font-weight: 600;
  font-size: 1.2rem;
  color: #1f2937;
  margin-bottom: 0.25rem;
}

.patient-contact {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.patient-phone,
.patient-email,
.patient-birth {
  color: #6b7280;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.patient-address {
  color: #6b7280;
  font-size: 0.85rem;
  font-weight: 500;
  margin: 0.5rem 0;
  padding: 0.5rem;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 3px solid #3b82f6;
}

.patient-stats {
  display: flex;
  gap: 1.5rem;
  margin: 1rem 0;
  padding: 0.75rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.patient-stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #374151;
  font-weight: 500;
}

.patient-stat i {
  font-size: 0.7rem;
}

.patient-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.patient-actions .btn {
  flex: 1;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.patient-actions .btn-primary {
  background: #3b82f6;
  border: 1px solid #3b82f6;
  color: white;
}

.patient-actions .btn-primary:hover {
  background: #3b82f6;
  border-color: #3b82f6;
}

.patient-actions .btn-secondary {
  background: #6b7280;
  border: 1px solid #6b7280;
  color: white;
}

.patient-actions .btn-secondary:hover {
  background: #4b5563;
  border-color: #4b5563;
}

/* Patient Details */
.patient-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.patient-info-section {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 4px;
}

.patient-info-section h4 {
  margin: 0 0 0.5rem 0;
  color: #333;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.patient-info-item {
  margin-bottom: 0.5rem;
}

.patient-info-label {
  font-weight: 600;
  color: #666;
  font-size: 0.8rem;
}

.patient-info-value {
  color: #333;
  font-size: 0.9rem;
}

/* Patient History */
.patient-history {
  margin-top: 1rem;
}

.history-section {
  margin-bottom: 1rem;
}

.history-section h4 {
  margin: 0 0 0.5rem 0;
  color: #333;
  font-size: 0.9rem;
}

.history-item {
  padding: 0.5rem;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.history-item-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.history-item-date {
  font-size: 0.8rem;
  color: #666;
}

.history-item-content {
  font-size: 0.85rem;
  color: #333;
}

/* Modal Enhancements */
.large-modal {
  max-width: 800px;
  width: 90%;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .patients-header {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .patients-controls {
    flex-direction: column;
    gap: 0.5rem;
  }

  .search-input {
    min-width: auto;
  }

  .patients-actions {
    justify-content: center;
  }

  .stats-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .patients-list {
    grid-template-columns: 1fr;
    padding: 0.5rem;
  }

  .patient-details {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .patient-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .patient-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .stats-cards {
    grid-template-columns: 1fr;
  }

  .patient-stats {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Loading States */
.loading-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 1rem 2rem;
  border-radius: 8px;
  z-index: 1000;
}

/* Patient Detail Page Styles */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.info-item.full-width {
  grid-column: 1 / -1;
}

.info-item label {
  font-weight: 600;
  color: #374151;
  font-size: 0.9rem;
}

.info-item span {
  color: #6b7280;
  font-size: 0.95rem;
}

.medical-history-content,
.secretary-notes-content,
.allergies-content,
.notes-content {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
  border-left: 4px solid #3b82f6;
  white-space: pre-wrap;
  line-height: 1.6;
  color: #374151;
}

.allergies-content {
  border-left-color: #ef4444;
  background: #fef2f2;
}

.notes-content {
  border-left-color: #6b7280;
  background: #f9fafb;
}

.patient-edit-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.patient-edit-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.patient-edit-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.patient-edit-form label {
  font-weight: 600;
  color: #374151;
  font-size: 0.9rem;
}

.patient-edit-form input,
.patient-edit-form textarea,
.patient-edit-form select {
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: border-color 0.2s ease;
  background: white;
}

.patient-edit-form input:focus,
.patient-edit-form textarea:focus,
.patient-edit-form select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(63, 185, 189, 0.1);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: #6c757d;
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  margin: 0 0 0.5rem 0;
  color: #333;
}

.empty-state p {
  margin: 0;
  font-size: 0.9rem;
}
