/* Visits Page Styles */
.visits-page {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.visits-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 20px;
}

.visits-title {
  color: #2c3e50;
  font-size: 2rem;
  font-weight: 600;
  margin: 0;
}

.visits-actions {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
}

.add-visit-btn {
  background: linear-gradient(135deg, #9b59b6, #8e44ad);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.add-visit-btn:hover {
  background: linear-gradient(135deg, #8e44ad, #9b59b6);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(155, 89, 182, 0.3);
}

.visits-search {
  position: relative;
  min-width: 300px;
}

.visits-search input {
  width: 100%;
  padding: 12px 16px 12px 40px;
  border: 2px solid #e0e6ed;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.3s ease;
}

.visits-search input:focus {
  outline: none;
  border-color: #9b59b6;
}

.visits-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #95a5a6;
}

.visits-filters {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.filter-group label {
  font-size: 12px;
  font-weight: 500;
  color: #7f8c8d;
  text-transform: uppercase;
}

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

.filter-group select:focus {
  outline: none;
  border-color: #9b59b6;
}

.visits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.visit-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border-left: 4px solid #9b59b6;
}

.visit-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.visit-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
  gap: 15px;
}

.visit-reason {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2c3e50;
  margin: 0 0 5px 0;
}

.visit-datetime {
  font-size: 0.9rem;
  color: #9b59b6;
  margin: 0;
  font-weight: 500;
}

.visit-badges {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-end;
  flex-shrink: 0;
}

.visit-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 15px;
  margin-bottom: 15px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #95a5a6;
  text-transform: uppercase;
}

.detail-value {
  font-size: 0.9rem;
  color: #2c3e50;
  font-weight: 500;
  line-height: 1.3;
}

.follow-up-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8f9fa;
  padding: 10px 15px;
  border-radius: 6px;
  margin-bottom: 15px;
  border-left: 3px solid #f39c12;
}

.follow-up-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #f39c12;
  text-transform: uppercase;
}

.follow-up-date {
  font-size: 0.9rem;
  color: #2c3e50;
  font-weight: 500;
}

.visit-notes {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #ecf0f1;
}

.notes-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #95a5a6;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.notes-content {
  font-size: 0.9rem;
  color: #34495e;
  line-height: 1.5;
}

.no-visits {
  text-align: center;
  padding: 60px 20px;
  color: #95a5a6;
}

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

.no-visits h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: #7f8c8d;
}

.no-visits p {
  font-size: 1rem;
  margin-bottom: 30px;
}

.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #ecf0f1;
  border-top: 4px solid #9b59b6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.error-message {
  background: #fadbd8;
  color: #e74c3c;
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 4px solid #e74c3c;
}

.success-message {
  background: #d5f4e6;
  color: #27ae60;
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 4px solid #27ae60;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modal Styles */
.modal-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;
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 30px;
  width: 90%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #2c3e50;
  margin: 0;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #95a5a6;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  color: #7f8c8d;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #34495e;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e6ed;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #9b59b6;
}

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

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

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: #34495e;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
  cursor: pointer;
}

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

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-primary {
  background: #9b59b6;
  color: white;
}

.btn-primary:hover {
  background: #8e44ad;
}

.btn-secondary {
  background: #95a5a6;
  color: white;
}

.btn-secondary:hover {
  background: #7f8c8d;
}

/* Status Badge Customizations for Visits */
.visit-badges .status-badge.status-scheduled {
  background: #ebf3fd;
  color: #3498db;
}

.visit-badges .status-badge.status-completed {
  background: #d5f4e6;
  color: #27ae60;
}

.visit-badges .status-badge.status-cancelled {
  background: #fadbd8;
  color: #e74c3c;
}

.visit-badges .status-badge.status-in-progress {
  background: #fef9e7;
  color: #f39c12;
}

.visit-badges .status-badge.status-no-show {
  background: #fadbd8;
  color: #e74c3c;
}

.visit-badges .status-badge.status-consultation {
  background: #ebf3fd;
  color: #3498db;
}

.visit-badges .status-badge.status-follow-up {
  background: #fef9e7;
  color: #f39c12;
}

.visit-badges .status-badge.status-emergency {
  background: #fadbd8;
  color: #e74c3c;
}

.visit-badges .status-badge.status-routine {
  background: #d5f4e6;
  color: #27ae60;
}

.visit-badges .status-badge.status-specialist {
  background: #f4ecf7;
  color: #9b59b6;
}

/* Responsive Design */
