:root {
  --primary: #3b86f2;
  --bg: #f8fafc;
  --text: #1e293b;
  --border: #e2e8f0;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Poppins", sans-serif;
  background-color: #f8fafc;
  color: #1e293b;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: none;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 15px 30px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  position: sticky;
  top: 0;
  z-index: 100;
}

.controls {
  background: #f8fafc;
  padding: 10px 30px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  gap: 15px;
  margin-bottom: 0;
  flex-shrink: 0;
}

.header h1 {
  font-size: 1.8rem;
  color: var(--text);
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.2s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 10px rgba(59, 134, 242, 0.3);
}

.btn-secondary {
  background: white;
  border: 1px solid var(--border);
  color: #64748b;
}

.btn-danger {
  background: #fee2e2;
  color: #ef4444;
}

/* Calendar Grid */
.calendar-container {
  background: white;
  border-radius: 0;
  box-shadow: none;
  flex: 1;
  overflow-y: auto; /* Scrollable */
  position: relative;
}

.calendar-container::-webkit-scrollbar {
  width: 8px;
}

.calendar-container::-webkit-scrollbar-track {
  background: transparent;
}

.calendar-container::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 20px;
  border: 3px solid transparent;
  background-clip: content-box;
}

.calendar-container::-webkit-scrollbar-thumb:hover {
  background-color: #94a3b8;
}

.time-grid {
  display: grid;
  grid-template-columns: 80px 1fr;
  min-height: 100%;
}

.time-labels {
  border-right: 1px solid var(--border);
  background: #fff;
}

.time-label {
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 5px;
  font-size: 0.8rem;
  color: #94a3b8;
  position: relative;
}

.calendar-body {
  position: relative;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 59px,
    #f1f5f9 60px
  );
  border-top: 1px solid #f1f5f9;
}

.time-slot {
  height: 60px; /* 1px = 1 min */
  cursor: pointer;
}

.time-slot:hover {
  background: linear-gradient(
    90deg,
    rgba(59, 134, 242, 0.05) 0%,
    rgba(59, 134, 242, 0) 100%
  );
  border-left: 3px solid var(--primary);
  transition: all 0.2s ease;
}

.time-slot.current-hour {
  background: rgba(254, 242, 242, 0.5);
}

/* Events */
.event {
  position: absolute;
  left: 5px;
  right: 5px;
  border-left: none;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s;
  z-index: 10;
  animation: popIn 0.3s ease;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.event:hover {
  transform: scale(1.02);
  z-index: 20;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.event-time {
  font-size: 0.75rem;
  opacity: 0.8;
  margin-bottom: 2px;
  display: block;
}

/* Colors with transparency */
.event-blue {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}
.event-green {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.event-purple {
  background: #faf5ff;
  color: #6b21a8;
  border: 1px solid #e9d5ff;
}
.event-orange {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
}
.event-red {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Current Time Line */
.current-time-indicator {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: #ef4444;
  z-index: 50;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
}

.current-time-indicator::before {
  content: "";
  position: absolute;
  left: -6px;
  top: -3px;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 1000;
}

.modal-content {
  background: white;
  width: 90%;
  max-width: 400px;
  margin: 100px auto;
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  animation: slideDown 0.3s ease;
}

.form-group {
  margin-bottom: 15px;
}
/* Updated selector to include .input-label */
.form-group label,
.form-group .input-label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.9rem;
  color: #64748b;
}

.form-group input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
}
.row {
  display: flex;
  gap: 10px;
}
.half {
  flex: 1;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.modal-actions button {
  flex: 1;
}

/* Color Picker Radio Buttons */
.color-options {
  display: flex;
  gap: 10px;
}
.color-options input {
  display: none;
}
.color-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.2s;
}
.color-circle:hover {
  transform: scale(1.1);
}
.color-options input:checked + label {
  border-color: #333;
  transform: scale(1.2);
}
.blue {
  background: #3b82f6;
}
.green {
  background: #10b981;
}
.purple {
  background: #a855f7;
}
.orange {
  background: #f97316;
}
.red {
  background: #ef4444;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.empty-state {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #cbd5e1;
  font-size: 1.5rem;
  pointer-events: none;
  text-align: center;
}

.empty-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #cbd5e1;
  font-size: 1.5rem;
  font-weight: 600;
  pointer-events: none;
  z-index: 0;
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 1.4rem;
  }
  .controls {
    padding: 10px 15px;
    overflow-x: auto;
  }
  .time-grid {
    grid-template-columns: 60px 1fr;
  }
  .event {
    font-size: 0.75rem;
    padding: 2px 5px;
  }
  .event-time {
    font-size: 0.65rem;
  }
}
