/* ============================================
   Neon Rose Scheduler — Styles
   Minimal grayscale design — compact for extension popup
   ============================================ */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #1a1a1a;
  background: #f7f7f7;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  font-size: 13px;
}

/* --- Layout --- */
.container {
  max-width: 400px;
  margin: 0 auto;
  padding: 0 16px;
}

/* --- Header --- */
.header {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 10px 0;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

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

.header-user {
  color: #555;
}

.btn-sign-out {
  background: none;
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 3px 10px;
  font-size: 11px;
  color: #555;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-sign-out:hover {
  border-color: #1a1a1a;
  color: #1a1a1a;
}

/* --- Navigation Tabs --- */
.nav-tabs {
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  gap: 0;
}

.nav-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  color: #888;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.nav-tab:hover {
  color: #1a1a1a;
}

.nav-tab.active {
  color: #1a1a1a;
  border-bottom-color: #1a1a1a;
}

/* --- Sign-in Card --- */
.sign-in-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 60px);
  background: #fff;
}

.sign-in-card {
  text-align: center;
  padding: 36px 28px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  max-width: 360px;
  width: 100%;
}

.sign-in-card h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
}

.sign-in-card .subtitle {
  color: #888;
  font-size: 13px;
  margin-bottom: 24px;
}

.sign-in-card .note {
  color: #999;
  font-size: 11px;
  margin-top: 12px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
}

.btn:hover {
  background: #333;
}

.btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.btn-secondary {
  background: #fff;
  color: #1a1a1a;
  border: 1px solid #d0d0d0;
}

.btn-secondary:hover {
  background: #f5f5f5;
}

.btn-secondary:disabled {
  background: #fafafa;
  color: #bbb;
  border-color: #e0e0e0;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 5px;
}

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

.btn-danger:hover {
  background: #444;
}

/* --- Sections --- */
.section {
  display: none;
  padding: 16px 0 24px;
}

.section.active {
  display: block;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 14px;
}

/* (card styles defined above near nav) */

/* --- Form Elements --- */
label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 4px;
  color: #333;
}

input[type="text"],
input[type="date"],
input[type="search"] {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  color: #1a1a1a;
  background: #fff;
  transition: border-color 0.15s;
}

input[type="text"]:focus,
input[type="date"]:focus,
input[type="search"]:focus {
  outline: none;
  border-color: #888;
}

/* --- Nav bar background --- */
.nav-tabs {
  background: #fff;
}

/* --- Card --- */
.card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* --- Teammate Picker --- */
.picker-area {
}

.picker-label {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 8px;
}

.search-wrapper {
  position: relative;
}

.selected-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
  min-height: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 16px;
  padding: 3px 10px;
  font-size: 12px;
  color: #333;
}

.pill.pill-self {
  background: #e8e8e8;
  font-weight: 500;
}

.pill .pill-remove {
  background: none;
  border: none;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  color: #999;
  padding: 0 0 0 2px;
}

.pill .pill-remove:hover {
  color: #1a1a1a;
}

.teammate-list {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  max-height: 160px;
  overflow-y: auto;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  margin-top: 2px;
}

.teammate-list.open {
  display: block;
}

.teammate-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.1s;
}

.teammate-item:hover {
  background: #f7f7f7;
}

.teammate-item + .teammate-item {
  border-top: 1px solid #f0f0f0;
}

.teammate-item input[type="checkbox"] {
  accent-color: #1a1a1a;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.teammate-item .name {
  flex: 1;
}

.teammate-item .email {
  color: #999;
  font-size: 11px;
}

.teammate-empty {
  padding: 12px;
  text-align: center;
  color: #999;
  font-size: 12px;
}

/* --- Middle Controls --- */
.middle-controls {
  padding: 14px 0;
}

/* --- Quick Date Selectors --- */
.quick-dates {
  display: flex;
  gap: 0;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  overflow: hidden;
}

.quick-date {
  flex: 1;
  text-align: center;
  padding: 6px 4px;
  font-size: 11px;
  font-weight: 400;
  cursor: pointer;
  border: none;
  border-right: 1px solid #d0d0d0;
  background: #fff;
  color: #555;
  transition: background 0.15s;
  font-family: inherit;
}

.quick-date:last-child {
  border-right: none;
}

.quick-date.active {
  background: #1a1a1a;
  color: #fff;
  font-weight: 500;
}

.quick-date:hover:not(.active) {
  background: #f5f5f5;
}

.custom-dates {
  display: none;
  margin-top: 10px;
}

.custom-dates.visible {
  display: block;
}

/* --- Date Range Row --- */
.date-range-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.date-range-row .field {
  flex: 1;
}

/* --- Duration + Find Row --- */
.duration-find-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.duration-find-label {
  font-size: 12px;
  font-weight: 500;
  color: #555;
  white-space: nowrap;
  margin-bottom: 0;
}

.duration-select {
  padding: 6px 8px;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  color: #1a1a1a;
}

/* --- Copy Button (outlined) --- */
.btn-copy {
  background: none;
  color: #555;
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s;
}

.btn-copy:hover {
  border-color: #1a1a1a;
  color: #1a1a1a;
}

.copy-icon {
  width: 12px;
  height: 12px;
  position: relative;
  display: inline-block;
}

.copy-icon::before,
.copy-icon::after {
  content: '';
  position: absolute;
  border: 1.2px solid currentColor;
  border-radius: 1.5px;
  width: 8px;
  height: 9px;
}

.copy-icon::before {
  top: 0;
  left: 0;
}

.copy-icon::after {
  top: 2px;
  left: 3px;
  background: #fff;
}

/* --- Results --- */
.results-area {
  display: none;
}

.results-area.visible {
  display: block;
}

.results-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.results-header h3 {
  font-size: 13px;
  font-weight: 600;
}

.result-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
  position: relative;
}

/* Day-grouped slot display */
.day-group {
  margin-bottom: 16px;
}

.day-group:last-of-type {
  margin-bottom: 0;
}

.day-label {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 5px;
}

.day-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.slot-chip {
  flex: 0 1 calc(50% - 3px);
  padding: 7px 0;
  text-align: center;
  font-size: 12px;
  color: #333;
  border: 1.5px solid #d0d0d0;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  background: #fff;
}

.slot-chip:hover {
  border-color: #999;
  background: #fafafa;
}

.slot-chip.selected {
  border-color: #1a1a1a;
  background: #1a1a1a;
  color: #fff;
}

.slot-chip.overflow {
  display: none;
}

.day-group.expanded .slot-chip.overflow {
  display: block;
}

.show-more {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  color: #888;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  padding: 0;
}

.show-more:hover {
  color: #1a1a1a;
}

.selection-hint {
  font-size: 11px;
  color: #999;
}

/* --- Toast notifications --- */
.result-actions {
  position: relative;
}

.toast {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.2s;
  position: absolute;
  right: 0;
  top: -24px;
  white-space: nowrap;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
}

.toast-success {
  background: #1a1a1a;
  color: #fff;
}

.toast-warning {
  background: #555;
  color: #fff;
}

/* --- Results footer --- */
.results-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}

.btn-more-days {
  font-size: 11px;
  color: #555;
  cursor: pointer;
  border: 1px solid #d0d0d0;
  border-radius: 5px;
  background: #fff;
  font-family: inherit;
  padding: 4px 10px;
  transition: border-color 0.15s, color 0.15s;
}

.btn-more-days:hover {
  border-color: #1a1a1a;
  color: #1a1a1a;
}

/* --- Calendar List --- */
.calendar-list {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
}

.calendar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  font-size: 13px;
}

.calendar-item + .calendar-item {
  border-top: 1px solid #f0f0f0;
}

.calendar-name {
  flex: 1;
}

/* Toggle Switch */
.toggle {
  position: relative;
  width: 38px;
  height: 20px;
  flex-shrink: 0;
}

.toggle input {
  display: none;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
}

.toggle input:checked + .toggle-slider {
  background: #1a1a1a;
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

.helper-text {
  color: #999;
  font-size: 12px;
  margin-bottom: 12px;
}

/* --- Admin Table --- */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th {
  text-align: left;
  font-weight: 500;
  color: #888;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 6px 8px;
  border-bottom: 1px solid #e0e0e0;
}

.admin-table td {
  padding: 8px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

.admin-table select {
  padding: 4px 6px;
  border: 1px solid #d0d0d0;
  border-radius: 5px;
  font-size: 12px;
  font-family: inherit;
  background: #fff;
  color: #1a1a1a;
}

/* --- Loading & Errors --- */
.loading-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #ddd;
  border-top-color: #1a1a1a;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.loading-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 0;
  color: #888;
  font-size: 13px;
}

.error-msg {
  padding: 10px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 13px;
  color: #666;
  background: #fafafa;
  margin-top: 6px;
}

.error-msg::before {
  content: '[ ! ] ';
  font-weight: 600;
}

/* --- Placeholder Page (book.html) --- */
.placeholder-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
}

.placeholder-page h1 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
}

.placeholder-page p {
  color: #888;
  font-size: 13px;
}

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

  .header-title {
    font-size: 13px;
  }

  .sign-in-card {
    padding: 24px 16px;
  }

  .date-range-row {
    flex-direction: column;
    gap: 10px;
  }

  .nav-tab {
    padding: 8px 10px;
    font-size: 11px;
  }

  .admin-table {
    font-size: 12px;
  }

  .admin-table th,
  .admin-table td {
    padding: 6px 4px;
  }

  .result-actions {
    flex-direction: column;
  }
}
