/* ========== Reset & Base ========== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

/* ========== Header ========== */
.header {
  background: #1a1a2e;
  color: #fff;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-user {
  font-size: 0.85rem;
  opacity: 0.8;
}

.btn {
  padding: 6px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: opacity 0.2s;
}

.btn:hover {
  opacity: 0.85;
}

.btn-primary {
  background: #4a6cf7;
  color: #fff;
}

.btn-secondary {
  background: #6c757d;
  color: #fff;
}

.btn-danger {
  background: #dc3545;
  color: #fff;
}

.btn-outline {
  background: transparent;
  border: 1px solid #ccc;
  color: #333;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.8rem;
}

/* ========== Hamburger Menu ========== */
.hamburger-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.3);
  z-index: 200;
}

.menu-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 260px;
  height: 100%;
  background: #fff;
  box-shadow: -2px 0 8px rgba(0,0,0,0.15);
  z-index: 201;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.menu-panel h3 {
  margin-bottom: 20px;
  color: #1a1a2e;
}

.menu-item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  text-align: left;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s;
}

.menu-item:hover {
  background: #e9ecef;
}

.menu-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: #666;
}

/* ========== Container ========== */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

/* ========== Auth Forms ========== */
.auth-container {
  max-width: 400px;
  margin: 60px auto;
  padding: 30px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.auth-container h2 {
  text-align: center;
  margin-bottom: 24px;
  color: #1a1a2e;
}

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

.form-group label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 0.85rem;
  color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

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

.form-actions {
  margin-top: 20px;
}

.form-actions .btn {
  width: 100%;
  padding: 10px;
  font-size: 1rem;
}

.auth-link {
  text-align: center;
  margin-top: 16px;
  font-size: 0.85rem;
}

.auth-link a {
  color: #4a6cf7;
  cursor: pointer;
  text-decoration: underline;
}

.alert {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 0.85rem;
}

.alert-error {
  background: #fde8e8;
  color: #c53030;
  border: 1px solid #feb2b2;
}

.alert-success {
  background: #e6ffed;
  color: #22543d;
  border: 1px solid #9ae6b4;
}

/* ========== Calendar ========== */
.calendar-section {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  padding: 20px;
  margin-bottom: 24px;
}

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

.calendar-header h2 {
  font-size: 1.2rem;
  color: #1a1a2e;
}

.calendar-nav {
  background: none;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 4px 12px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}

.calendar-nav:hover {
  background: #f0f0f0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-dow {
  text-align: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: #888;
  padding: 6px 0;
}

.calendar-cell {
  aspect-ratio: 1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s;
  min-height: 40px;
}

.calendar-cell:hover {
  transform: scale(1.05);
}

.calendar-cell.empty {
  cursor: default;
  background: transparent;
}

.calendar-cell.empty:hover {
  transform: none;
}

.calendar-cell.today {
  outline: 3px solid #4a6cf7;
  outline-offset: -3px;
}

.calendar-cell .date-num {
  position: relative;
  z-index: 1;
}

/* ========== Modal ========== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #fff;
  border-radius: 10px;
  width: 90%;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
}

.modal-header h3 {
  font-size: 1.1rem;
  color: #1a1a2e;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: #999;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

/* ========== Shop Card (in modal & main list) ========== */
.shop-block {
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
  border: 1px solid #e9ecef;
}

.shop-block-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 8px;
}

.shop-block-score {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 8px;
}

.cast-list {
  list-style: none;
}

.cast-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
}

.cast-item:last-child {
  border-bottom: none;
}

.cast-name {
  font-weight: 500;
}

.cast-score {
  font-weight: 700;
  font-size: 0.85rem;
}

.cast-score.positive {
  color: #e53e3e;
}

.cast-score.negative {
  color: #3182ce;
}

.cast-score.neutral {
  color: #888;
}

/* ========== Today Section ========== */
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #4a6cf7;
}

.today-section {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  padding: 20px;
  margin-bottom: 24px;
}

.no-data {
  color: #999;
  text-align: center;
  padding: 20px;
  font-size: 0.9rem;
}

/* ========== Registration Forms ========== */
.register-container {
  max-width: 560px;
  margin: 40px auto;
  padding: 30px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.register-container h2 {
  margin-bottom: 24px;
  color: #1a1a2e;
}

.inline-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.inline-form .form-group {
  flex: 1;
  margin-bottom: 0;
}

/* ========== Staff Preference Slider ========== */
.pref-slider-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.pref-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, #0000ff, #ff0000);
  outline: none;
}

.pref-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #333;
  cursor: pointer;
}

.pref-value {
  min-width: 30px;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
}

/* ========== Loading ========== */
.loading {
  text-align: center;
  padding: 40px;
  color: #999;
}

.loading::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #ddd;
  border-top-color: #4a6cf7;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========== Responsive ========== */
@media (max-width: 600px) {
  .container {
    padding: 12px;
  }

  .calendar-cell {
    font-size: 0.75rem;
    min-height: 34px;
  }

  .modal-content {
    width: 95%;
    max-height: 85vh;
  }

  .header-title {
    font-size: 1.1rem;
  }
}
