/* Shared Medical Page Styles */
/* Use this as a base for all medical pages: Allergies, Conditions, Immunizations, Lab Results, Medications, Practitioners, Treatments, Visits, Patient Info */

/* Base Container */
.medical-page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  background-color: #f8f9fa;
  min-height: 100vh;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Header Section */
.medical-page-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e9ecef;
}

.medical-page-header h1 {
  margin: 0;
  color: #333;
  font-size: 2rem;
  font-weight: 600;
}

/* Back Button */
.back-button {
  background: none;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.back-button:hover {
  background-color: var(--color-primary);
  color: var(--color-text-light);
  transform: translateY(-1px);
}

/* Main Content Area */
.medical-page-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Controls Section */
.medical-page-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border: 1px solid #e9ecef;
}

.controls-left {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.controls-right {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
}

/* Add Button */
.add-button {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.add-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

/* Sort Controls */
.sort-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sort-controls label {
  font-weight: 500;
  color: #495057;
}

.sort-controls select {
  padding: 8px 12px;
  border: 2px solid #e9ecef;
  border-radius: 6px;
  background: white;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.sort-controls select:focus {
  outline: none;
  border-color: #007bff;
}

.sort-order-button {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  color: #495057;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.sort-order-button:hover {
  background: #e9ecef;
  border-color: #dee2e6;
}

/* Filter Controls */
.filter-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-select {
  padding: 8px 12px;
  border: 2px solid #e9ecef;
  border-radius: 6px;
  background: white;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.filter-select:focus {
  outline: none;
  border-color: #007bff;
}

/* Form Modal Overlay */
.medical-form-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.medical-form-modal {
  background: white;
  padding: 0;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Form Header */
.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 12px 12px 0 0;
}

.form-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.close-button {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

.close-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Form Content */
.medical-form-content {
  padding: 30px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-weight: 600;
  color: #495057;
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 12px;
  border: 2px solid #e9ecef;
  border-radius: 6px;
  font-size: 16px;
  transition: border-color 0.3s ease;
  background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: 15px;
  justify-content: flex-end;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
}

.cancel-button,
.save-button {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
}

.cancel-button {
  background-color: #6c757d;
  color: white;
}

.cancel-button:hover {
  background-color: #545b62;
  transform: translateY(-1px);
}

.save-button {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
}

.save-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

/* Items List */
.medical-items-list {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border: 1px solid #e9ecef;
}

/* Items Grid */
.medical-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
}

/* Item Card */
.medical-item-card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
  border: 1px solid #e9ecef;
  padding: 20px;
  transition: all 0.3s ease;
  position: relative;
}

.medical-item-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
}

/* Item Header */
.medical-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
}

.item-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
  flex: 1;
}

.item-subtitle {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  margin: 5px 0 0 0;
}

/* Status Badge - moved to components/medical/StatusBadge.css */

/* Status Colors - moved to components/medical/StatusBadge.css */

/* Item Details */
.medical-item-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 15px;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.detail-item.full-width {
  flex-direction: column;
  align-items: stretch;
}

.detail-item .label {
  font-weight: 500;
  color: var(--color-text-secondary);
  min-width: 100px;
  flex-shrink: 0;
}

.detail-item .value {
  color: var(--color-text-primary);
  text-align: right;
  word-break: break-word;
}

.detail-item.full-width .value {
  text-align: left;
  margin-top: 5px;
}

/* Item Actions */
.medical-item-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 15px;
  border-top: 1px solid #f1f3f4;
}

.edit-button,
.delete-button,
.view-button {
  background: none;
  border: 2px solid;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.edit-button {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.edit-button:hover {
  background-color: var(--color-primary);
  color: var(--color-text-light);
}

.delete-button {
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.delete-button:hover {
  background-color: var(--color-danger);
  color: var(--color-text-light);
}

.view-button {
  border-color: var(--color-success);
  color: var(--color-success);
}

.view-button:hover {
  background-color: var(--color-success);
  color: var(--color-text-light);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-muted);
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state h3 {
  margin: 0 0 10px 0;
  color: var(--color-text-secondary);
  font-size: 1.5rem;
}

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

/* Loading State */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 20px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Messages */
.error-message {
  background-color: var(--color-danger-light);
  color: var(--color-danger-dark);
  padding: 12px 16px;
  border-radius: 6px;
  border: 1px solid var(--color-danger);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.success-message {
  background-color: var(--color-success-light);
  color: var(--color-success-dark);
  padding: 12px 16px;
  border-radius: 6px;
  border: 1px solid var(--color-success);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Responsive Design */

