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

:root {
  --primary: #6200EA;
  --primary-dark: #4B00B5;
  --secondary: #03DAC6;
  --background: #F5F5F5;
  --surface: #FFFFFF;
  --error: #B00020;
  --text-primary: #000000;
  --text-secondary: #757575;
  --shadow: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 8px rgba(0,0,0,0.15);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--background);
  color: var(--text-primary);
  overflow-x: hidden;
}

.app-header {
  background: var(--primary);
  color: white;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-header h1 {
  font-size: 20px;
  font-weight: 500;
}

.icon-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.icon-btn:active {
  background: rgba(255,255,255,0.2);
}

#main-content {
  padding: 16px;
  max-width: 600px;
  margin: 0 auto;
}

/* Day Cards */
.day-card {
  background: var(--surface);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.day-card:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-lg);
}

.day-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.day-card-date {
  font-size: 18px;
  font-weight: 500;
}

.day-card-info {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Slots View */
#slots-view {
  animation: slideIn 0.3s;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.back-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 16px;
  padding: 12px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

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

.slots-header h2 {
  font-size: 20px;
  margin-top: 8px;
}

.slot-card {
  background: var(--surface);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s;
}

.slot-card:active {
  transform: scale(0.98);
}

.slot-card.booked {
  border-left: 4px solid var(--primary);
}

.slot-card.available {
  border-left: 4px solid var(--secondary);
}

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

.slot-number {
  background: var(--primary);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 14px;
}

.slot-time {
  font-size: 16px;
  font-weight: 500;
}

.slot-venue {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 4px;
}

.slot-name {
  color: var(--primary);
  font-weight: 500;
  font-size: 14px;
}

.slot-status {
  color: var(--secondary);
  font-weight: 500;
  font-size: 14px;
}

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

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--surface);
  border-radius: 12px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalSlideUp 0.3s;
}

.modal-content.small {
  max-width: 350px;
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.modal-header h2, .modal-content h3 {
  font-size: 20px;
  font-weight: 500;
}

.modal-header .icon-btn {
  color: var(--text-primary);
}

.form-group {
  padding: 16px 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid #E0E0E0;
  border-radius: 4px;
  font-size: 16px;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Range inputs */
#ranges-container {
  padding: 16px 20px;
}

#ranges-container h3 {
  font-size: 16px;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.range-item {
  background: #F5F5F5;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.range-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.range-item-header span {
  font-weight: 500;
}

.remove-range-btn {
  background: none;
  border: none;
  color: var(--error);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
}

.time-row {
  margin-bottom: 12px;
}

.time-row label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.time-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr 80px;
  gap: 8px;
}

.time-inputs select {
  padding: 8px;
  border: 1px solid #E0E0E0;
  border-radius: 4px;
  font-size: 14px;
  background: white;
}

.venue-row {
  margin-top: 12px;
}

.venue-row label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.venue-select {
  width: 100%;
  padding: 8px;
  border: 1px solid #E0E0E0;
  border-radius: 4px;
  font-size: 14px;
  background: white;
}

/* Buttons */
.primary-btn,
.secondary-btn,
.delete-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  margin: 16px 20px;
  width: calc(100% - 40px);
}

.primary-btn {
  background: var(--primary);
  color: white;
}

.primary-btn:active {
  background: var(--primary-dark);
}

.secondary-btn {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.secondary-btn:active {
  background: rgba(98, 0, 234, 0.1);
}

.delete-btn {
  background: var(--error);
  color: white;
}

.delete-btn:active {
  background: #8B0016;
}

.delete-btn.hidden {
  display: none;
}

.modal-actions {
  padding: 0 20px 20px;
  display: flex;
  gap: 12px;
}

.modal-actions button {
  margin: 0;
  width: 100%;
}

#slot-info {
  padding: 16px 20px;
  background: #F5F5F5;
  margin: 0 20px;
  border-radius: 8px;
}

#slot-info p {
  margin-bottom: 4px;
  color: var(--text-secondary);
}

.hidden {
  display: none !important;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.empty-state p {
  margin-top: 8px;
}