/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.app-header {
  background-color: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 1rem 0;
  margin-bottom: 2rem;
}

.app-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.app-header h2 {
  margin: 0;
}

.app-header h2 a {
  color: #2563eb;
  font-size: 1.5rem;
  text-decoration: none;
}

.app-header h2 a:hover {
  color: #1d4ed8;
}

.main-nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.main-nav a {
  color: #374151;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
}

.main-nav a:hover {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

.user-nav {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.user-nav span {
  color: #666;
}

/* Main content */
main.container {
  padding: 0 1rem 2rem;
}

/* Page header */
.page-header,
.header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.page-header h1,
.header-actions h1 {
  font-size: 2rem;
  color: #1f2937;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background-color: #2563eb;
  color: white;
}

.btn-primary:hover {
  background-color: #1d4ed8;
}

.btn-secondary {
  background-color: #6b7280;
  color: white;
}

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

.btn-danger {
  background-color: #dc2626;
  color: white;
}

.btn-danger:hover {
  background-color: #b91c1c;
}

.btn-logout {
  background-color: #f3f4f6;
  color: #374151;
}

.btn-logout:hover {
  background-color: #e5e7eb;
}

/* Forms */
.form-container {
  background-color: #fff;
  padding: 2rem;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  max-width: 600px;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #374151;
}

.form-control {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 1rem;
  line-height: 1.5;
}

.form-control:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea.form-control {
  resize: vertical;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Login */
.login-container {
  max-width: 400px;
  margin: 4rem auto;
  background-color: #fff;
  padding: 2rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.login-container h1 {
  text-align: center;
  margin-bottom: 2rem;
  color: #1f2937;
}

/* Cards */
.card {
  background-color: #fff;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card h3 {
  color: #1f2937;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.card h3 a {
  color: inherit;
  text-decoration: none;
}

.card h3 a:hover {
  color: #2563eb;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.card-details {
  margin-bottom: 1rem;
}

.card-details p {
  margin-bottom: 0.5rem;
  color: #4b5563;
}

.card-details strong {
  color: #1f2937;
}

.card-actions {
  display: flex;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

/* Patients grid */
.patients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

/* Appointments list */
.appointments-list {
  display: grid;
  gap: 1rem;
}

.appointment-card {
  background-color: #fff;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.2s;
}

.appointment-card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.appointment-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.appointment-header h3 {
  color: #1f2937;
  font-size: 1.25rem;
}

.appointment-date {
  color: #6b7280;
  font-size: 0.875rem;
}

.appointment-body {
  margin-bottom: 1rem;
}

.appointment-detail {
  margin-bottom: 0.5rem;
  color: #4b5563;
}

.appointment-detail strong {
  color: #1f2937;
  margin-right: 0.5rem;
}

.appointment-actions {
  display: flex;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background-color: #fff;
  border-radius: 0.5rem;
}

.empty-state p {
  margin-bottom: 1.5rem;
  color: #6b7280;
  font-size: 1.125rem;
}

/* Alerts */
.alert {
  padding: 1rem;
  border-radius: 0.375rem;
  margin-bottom: 1.5rem;
}

.alert-notice {
  background-color: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.alert-error {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.alert h3 {
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.alert ul {
  margin-left: 1.5rem;
}

/* Error messages */
.error-messages {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  padding: 1rem;
  border-radius: 0.375rem;
  margin-bottom: 1.5rem;
}

.error-messages h2 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.error-messages ul {
  margin-left: 1.5rem;
}

/* Form styles */
.form {
  background-color: #fff;
  padding: 2rem;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  max-width: 600px;
}

.help-text {
  color: #6b7280;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Actions */
.actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.5rem;
}

/* Patient detail */
.patient-detail {
  background-color: #fff;
  padding: 2rem;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.patient-detail h1 {
  margin-bottom: 1.5rem;
  color: #1f2937;
}

.patient-info p {
  margin-bottom: 0.75rem;
  color: #4b5563;
}

.patient-info strong {
  color: #1f2937;
}

.patient-info .notes {
  background-color: #f9fafb;
  padding: 1rem;
  border-radius: 0.375rem;
  white-space: pre-wrap;
}

/* Appointment item */
.appointment-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background-color: #f9fafb;
  border-radius: 0.375rem;
  margin-bottom: 0.5rem;
}

/* Select styling */
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  .page-header,
  .header-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .app-header .container {
    flex-direction: column;
    gap: 1rem;
  }

  .main-nav {
    order: 2;
    width: 100%;
    justify-content: center;
  }

  .user-nav {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .appointment-header,
  .card-header {
    flex-direction: column;
    gap: 0.5rem;
  }

  .form-actions,
  .card-actions,
  .actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  .patients-grid {
    grid-template-columns: 1fr;
  }
}
