:root {
  --primary-color: #6366f1; /* Indigo */
  --primary-hover: #4f46e5;
  --secondary-color: #ec4899; /* Pink */
  --bg-color: #f3f4f6; /* Gray 100 */
  --card-bg: #ffffff;
  --text-dark: #1f2937;
  --text-light: #6b7280;
  --border-color: #e5e7eb;
  --success: #10b981;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-dark);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Authentication Forms (Login / Register) */
.auth-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.auth-card {
  background: var(--card-bg);
  padding: 2.5rem;
  border-radius: 1rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
  animation: slideUp 0.5s ease-out;
}

.auth-card h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.75rem;
  color: var(--primary-color);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-dark);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: all 0.3s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.btn {
  display: inline-block;
  font-weight: 500;
  text-align: center;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  width: 100%;
  font-size: 1rem;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.auth-toggle {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.auth-toggle a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
}

.auth-toggle a:hover {
  text-decoration: underline;
}

/* Dashboard */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card-bg);
  padding: 1.5rem 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border-radius: 1rem;
  margin-bottom: 2rem;
}

.header h1 {
  color: var(--primary-color);
  font-size: 1.5rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-logout {
  background: none;
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 0.5rem 1rem;
  width: auto;
}
.btn-logout:hover {
  background: var(--danger);
  color: white;
}

.main-content {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
}

@media (max-width: 768px) {
  .main-content {
    grid-template-columns: 1fr;
  }
}

.sidebar, .calendar-area {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.author-list {
  list-style: none;
  max-height: 600px;
  overflow-y: auto;
  margin-top: 1rem;
}

.author-item {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  margin-bottom: 0.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.author-item:hover {
  background: var(--bg-color);
  border-color: var(--primary-color);
}

.author-item.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Calendar styling */
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}

.day-name {
  text-align: center;
  font-weight: 600;
  color: var(--text-light);
  padding: 0.5rem 0;
}

.day-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: var(--bg-color);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  position: relative;
}

.day-cell:hover:not(.booked):not(.empty) {
  background: var(--primary-color);
  color: white;
  transform: scale(1.05);
}

.day-cell.empty {
    background-color: transparent;
    border: none;
    cursor: default;
}

.day-cell.past {
    background-color: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.7;
}

.day-cell.booked {
    background-color: var(--primary-color);
    color: white;
    cursor: default;
}

.booked-badge {
  font-size: 0.65rem;
  background: var(--danger);
  color: white;
  padding: 2px 5px;
  border-radius: 10px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90%;
}

.alert {
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  display: none;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #34d399;
}

.alert-danger {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #f87171;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: var(--card-bg);
  padding: 2rem;
  border-radius: 1rem;
  width: 90%;
  max-width: 400px;
  position: relative;
  animation: slideUp 0.3s ease-out;
}

.close-modal {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
}

.close-modal:hover {
  color: var(--danger);
}

/* Responsive updates */
@media (max-width: 768px) {
  .calendar-grid {
    gap: 0.25rem;
  }
  .day-cell {
    font-size: 0.85rem;
  }
  .booked-badge {
    font-size: 0.55rem;
    padding: 1px 3px;
  }
  .container {
    padding: 1rem;
  }
  .header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
}
