:root {
  --bg-color: #000000;
  --panel-bg: #0a0a0a;
  --panel-border: rgba(239, 68, 68, 0.25);
  --text-main: #ffffff;
  --text-muted: #a0a0a5;
  
  --primary-glow: radial-gradient(circle, rgba(239, 68, 68, 0.18) 0%, rgba(0, 0, 0, 0) 75%);
  --accent-color: #ef4444;
  --accent-glow: 0 0 18px rgba(239, 68, 68, 0.5);
  
  /* Curated Red Palette for Tasks */
  --color-bright-red: #ff3333;
  --color-coral-red: #ff5e5e;
  --color-crimson: #c0392b;
  --color-dark-red: #962d22;
  --color-rose: #ff7675;
}

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

html, body {
  font-family: 'Outfit', 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
  position: relative;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}

/* Glowing Background */
.glow-bg {
  position: fixed;
  top: -10%;
  left: -10%;
  width: 120%;
  height: 120%;
  background: var(--primary-glow);
  z-index: -1;
  pointer-events: none;
}

.app-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 40px;
  width: 100%;
}

/* Header */
.app-header {
  margin-bottom: 20px;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.settings-btn {
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.25rem;
  cursor: pointer;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.settings-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-color);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ef4444, #5c0606);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.4);
}

h1 {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Calendar Card */
.calendar-card {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px 0 rgba(239, 68, 68, 0.08);
}

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

.calendar-nav h2 {
  font-size: 1.1rem;
  font-weight: 600;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
}

.weekdays-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 6px;
  column-gap: 6px;
  text-align: center;
}

.day-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 400;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

.day-cell:hover:not(.empty) {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
}

.day-cell.active {
  background: #ef4444;
  color: white;
  font-weight: 600;
  box-shadow: var(--accent-glow);
}

.day-cell.today:not(.active) {
  border-color: var(--accent-color);
  color: #ff8080;
  font-weight: 600;
}

.day-cell.empty {
  cursor: default;
}

/* Small dots under the day number representing task slots filled */
.day-dots {
  display: flex;
  gap: 3px;
  margin-top: 3px;
  height: 4px;
}

.day-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
}

/* Schedule Section */
.schedule-section {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 8px 32px 0 rgba(239, 68, 68, 0.08);
}

.schedule-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 10px;
}

.schedule-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.date-badge {
  background: rgba(239, 68, 68, 0.15);
  color: #ff9e9e;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 500;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hour-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.hour-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  width: 42px;
  padding-top: 6px;
}

.hour-content-container {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hour-slot {
  background: rgba(255, 255, 255, 0.01);
  border: 1px dashed rgba(239, 68, 68, 0.15);
  border-radius: 12px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hour-slot:hover {
  background: rgba(239, 68, 68, 0.05);
  border-color: var(--accent-color);
}

.hour-slot .slot-placeholder {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.hour-slot .slot-placeholder i {
  font-size: 0.7rem;
  opacity: 0.6;
}

/* Tasks */
.task-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-left: 4px solid var(--accent-color);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
}

.task-item:hover {
  background: rgba(239, 68, 68, 0.08);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.task-text {
  font-size: 0.85rem;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 80%;
}

.task-edit-icon {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.task-item:hover .task-edit-icon {
  opacity: 1;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 16px;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #080808;
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  width: 100%;
  max-width: 400px;
  padding: 20px;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.open .modal-content {
  transform: scale(1);
}

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

.modal-header h4 {
  font-size: 1.1rem;
  font-weight: 600;
}

.close-modal-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

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

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

.form-group input[type="text"] {
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 12px;
  color: white;
  padding: 12px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-group input[type="text"]:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.2);
}

/* Color Picker */
.color-picker {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
}

.color-option {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.2s ease;
}

.color-option.selected {
  border-color: white;
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(255,255,255,0.2);
}

/* Buttons */
.modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
}

.right-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.btn {
  padding: 10px 16px;
  border-radius: 12px;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--accent-color);
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-primary:hover {
  background: #dc2626;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

/* Toggle Switch & Select Controls */
.flex-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .3s;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
}

input:checked + .slider {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

.slider.round {
  border-radius: 24px;
}

.slider.round:before {
  border-radius: 50%;
}

.form-select {
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 12px;
  color: white;
  padding: 12px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-select:focus {
  border-color: var(--accent-color);
}

.form-select option {
  background: #080808;
  color: white;
}

/* Strikethrough & Todo UI */
.task-item.completed {
  border-left-color: var(--text-muted) !important;
  opacity: 0.5;
}

.task-item.completed .task-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-checkbox-container {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 80%;
}

.task-checkbox {
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
}

.task-item:hover .task-checkbox {
  color: #ff9e9e;
}

.task-item.completed .task-checkbox {
  color: var(--accent-color);
}
