* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: sans-serif;
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: white;
  overflow: hidden;
}

.header {
  margin-bottom: 16px;
}

.header h1 {
  font-size: 2.5em;
  margin-bottom: 10px;
}

.header details {
  color: gray;
  max-width: 600px;
}

.header summary {
  margin-bottom: 12px;
  font-weight: bold;
}

.header p {
  margin-bottom: 0.9em;
  line-height: 1.35;
}

footer {
  display: flex;
  justify-content: flex-end;
  padding: 12px 0;
}

#resetBtn {
  background-color: red;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #495057;
}

input[type="text"] {
  width: 100%;
  padding: 12px;
  border: 1px solid #dee2e6;
  font-size: 1em;
  transition: border-color 0.3s;
}

input[type="text"]:focus {
  outline: none;
  border-color: #667eea;
}

.calendar-container {
  overflow-x: auto;
}

.calendar-header {
  margin-bottom: 16px;
}

.calendar-header h2 {
  color: #343a40;
  margin-bottom: 10px;
  font-size: 1.3em;
}

.week-navigation {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

.week-navigation span {
  font-weight: 600;
  color: #495057;
  min-width: 180px;
  text-align: center;
  font-size: 0.9em;
}

.calendar {
  display: grid;
  grid-template-columns: 80px repeat(7, 1fr);
  gap: 1px;
  background: #dee2e6;
  border: 1px solid #dee2e6;
  min-width: 800px;
}

.time-label {
  background: #f8f9fa;
  padding: 10px;
  text-align: center;
  font-size: 0.9em;
  color: #6c757d;
  font-weight: 500;
}

.day-header {
  color: black;
  padding: 16px;
  text-align: center;
  font-weight: 600;
}

.day-header.today {
  background: #bee5eb;
}

.time-slot {
  background: white;
  min-height: 40px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  user-select: none;
}

.time-slot:hover {
  background: #f1f3f5;
}

.time-slot.selecting {
  background: #e3f2fd !important;
}

.time-slot.selected {
  background: #667eea;
  position: relative;
}

.availability-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.8em;
  pointer-events: none;
}

.participants-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 25%;
  bottom: 0;
  display: flex;
  pointer-events: none;
}

.participant-segment {
  flex: 1;
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7em;
  font-weight: 600;
  color: #333;
}

.interaction-zone {
  position: absolute;
  top: 0;
  right: 0;
  width: 25%;
  bottom: 0;
  border: 1px dashed rgba(0, 0, 0, 0.1);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8em;
  color: rgba(0, 0, 0, 0.3);
}

.adaptive-text {
  color: white;
}

.adaptive-text.dark-bg {
  color: white;
}

.adaptive-text.light-bg {
  color: black;
}

.participants-list {
  padding: 16px 12px;
  border: 1px solid #dee2e6;
}

.participants-list h3 {
  margin-bottom: 10px;
  color: #343a40;
  font-size: 1.1em;
}

.participant-item {
  display: inline-block;
  margin: 5px;
  padding: 8px 16px;
  background: white;
  border-radius: 20px;
  border: 1px solid #dee2e6;
  font-size: 0.95em;
}

.participant-item.current {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: #667eea;
}

.actions {
  padding: 16px 0;
  background: white;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  padding: 8px 16px;
  border: none;
  font-size: 0.9em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 16px rgba(102, 126, 234, 0.4);
}

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

.btn-secondary:hover {
  background: #5a6268;
}

.btn-success {
  background: #28a745;
  color: white;
}

.btn-success:hover {
  background: #218838;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn:disabled:hover {
  background: inherit;
  transform: none;
  box-shadow: none;
}

.change-week-button span {
  color: inherit;
}

@media (max-width: 512px) {
  .change-week-button span {
    display: none;
  }
}

#messageArea {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 10;
}

@keyframes slide-up {
  0% {
    transform: translateY(100%);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.message {
  padding: 16px;
  font-weight: 500;
  animation: slide-up 0.3s ease-out;
}

.message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.message.info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}
