/* Global CSS for unified styling across all modules */

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

body {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  color: #1f2937;
  background-color: #f9fafb;
}

main {
  padding: 1rem;
}

/* Form elements - unified styling */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
textarea,
select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  background-color: white;
  transition: all 0.15s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Button unified styling */
button,
input[type="submit"],
.btn {
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  font-size: 0.875rem;
}

.btn-primary,
input[type="submit"] {
  background-color: #4f46e5;
  color: white;
}

.btn-primary:hover,
input[type="submit"]:hover {
  background-color: #4338ca;
}

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

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

/* Links */
a {
  color: #4f46e5;
  text-decoration: none;
}

a:hover {
  color: #3730a3;
  text-decoration: none;
}

/* Calendar styles */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  text-align: center;
}

.calendar-day {
  padding: 0.75rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.15s ease;
  background-color: white;
  border: 1px solid #e5e7eb;
}

.calendar-day:hover {
  background-color: #f3f4f6;
}

.calendar-day.selected {
  background-color: #4f46e5;
  color: white;
}

.calendar-day.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: #f9fafb;
}

.calendar-day.today {
  font-weight: 600;
  color: #059669;
  border-color: #059669;
}

.calendar-day.same-day-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}

/* Time slots */
.time-slot-btn {
  padding: 0.5rem 0.75rem;
  margin: 0.125rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  background-color: white;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.875rem;
}

.time-slot-btn:hover {
  background-color: #dbeafe;
  border-color: #4f46e5;
}

.time-slot-btn.selected {
  background-color: #4f46e5;
  color: white;
  border-color: #4f46e5;
}

.time-slot-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: #f9fafb;
}

/* Room selection */
.room-btn {
  padding: 1rem;
  margin: 0.5rem 0;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  background-color: white;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.room-btn:hover {
  border-color: #4f46e5;
  background-color: #f8fafc;
}

.room-btn.selected {
  background-color: #dbeafe;
  border-color: #4f46e5;
}

/* Alert messages */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.alert-success {
  background-color: #dcfce7;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.alert-error {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.alert-info {
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}

.alert-warning {
  background-color: #fefce8;
  border: 1px solid #fde047;
  color: #a16207;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

th {
  background-color: #f9fafb;
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  color: #374151;
  border-bottom: 1px solid #e5e7eb;
}

td {
  padding: 0.75rem;
  border-bottom: 1px solid #f3f4f6;
}

tr:hover {
  background-color: #f9fafb;
}

/* Loading states */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid #e5e7eb;
  border-top: 2px solid #4f46e5;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Responsive utilities */
@media (max-width: 640px) {
  main {
    padding: 0.5rem;
  }
  
  .calendar-day {
    padding: 0.5rem;
    font-size: 0.75rem;
  }
  
  .room-btn {
    padding: 0.75rem;
  }
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-success {
  background-color: #dcfce7;
  color: #166534;
}

.status-pending {
  background-color: #fef3c7;
  color: #92400e;
}

.status-error {
  background-color: #fef2f2;
  color: #b91c1c;
}
