html,
body {
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
  font-size: 14px;
  color: #3B2C25;
  background-color: #ffaa00;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25' viewBox='0 0 1600 800'%3E%3Cg %3E%3Cpath fill='%23ffb742' d='M486 705.8c-109.3-21.8-223.4-32.2-335.3-19.4C99.5 692.1 49 703 0 719.8V800h843.8c-115.9-33.2-230.8-68.1-347.6-92.2C492.8 707.1 489.4 706.5 486 705.8z'/%3E%3Cpath fill='%23ffc368' d='M1600 0H0v719.8c49-16.8 99.5-27.8 150.7-33.5c111.9-12.7 226-2.4 335.3 19.4c3.4 0.7 6.8 1.4 10.2 2c116.8 24 231.7 59 347.6 92.2H1600V0z'/%3E%3Cpath fill='%23ffd08b' d='M478.4 581c3.2 0.8 6.4 1.7 9.5 2.5c196.2 52.5 388.7 133.5 593.5 176.6c174.2 36.6 349.5 29.2 518.6-10.2V0H0v574.9c52.3-17.6 106.5-27.7 161.1-30.9C268.4 537.4 375.7 554.2 478.4 581z'/%3E%3Cpath fill='%23ffddae' d='M0 0v429.4c55.6-18.4 113.5-27.3 171.4-27.7c102.8-0.8 203.2 22.7 299.3 54.5c3 1 5.9 2 8.9 3c183.6 62 365.7 146.1 562.4 192.1c186.7 43.7 376.3 34.4 557.9-12.6V0H0z'/%3E%3Cpath fill='%23FFEAD0' d='M181.8 259.4c98.2 6 191.9 35.2 281.3 72.1c2.8 1.1 5.5 2.3 8.3 3.4c171 71.6 342.7 158.5 531.3 207.7c198.8 51.8 403.4 40.8 597.3-14.8V0H0v283.2C59 263.6 120.6 255.7 181.8 259.4z'/%3E%3Cpath fill='%23ffedd6' d='M1600 0H0v136.3c62.3-20.9 127.7-27.5 192.2-19.2c93.6 12.1 180.5 47.7 263.3 89.6c2.6 1.3 5.1 2.6 7.7 3.9c158.4 81.1 319.7 170.9 500.3 223.2c210.5 61 430.8 49 636.6-16.6V0z'/%3E%3Cpath fill='%23fff0dd' d='M454.9 86.3C600.7 177 751.6 269.3 924.1 325c208.6 67.4 431.3 60.8 637.9-5.3c12.8-4.1 25.4-8.4 38.1-12.9V0H288.1c56 21.3 108.7 50.6 159.7 82C450.2 83.4 452.5 84.9 454.9 86.3z'/%3E%3Cpath fill='%23fff2e3' d='M1600 0H498c118.1 85.8 243.5 164.5 386.8 216.2c191.8 69.2 400 74.7 595 21.1c40.8-11.2 81.1-25.2 120.3-41.7V0z'/%3E%3Cpath fill='%23fff5ea' d='M1397.5 154.8c47.2-10.6 93.6-25.3 138.6-43.8c21.7-8.9 43-18.8 63.9-29.5V0H643.4c62.9 41.7 129.7 78.2 202.1 107.4C1020.4 178.1 1214.2 196.1 1397.5 154.8z'/%3E%3Cpath fill='%23FFF8F0' d='M1315.3 72.4c75.3-12.6 148.9-37.1 216.8-72.4h-723C966.8 71 1144.7 101 1315.3 72.4z'/%3E%3C/g%3E%3C/svg%3E");
  background-attachment: fixed;
  background-size: cover;
}

#calendar {
  max-width: 100vh;
  height: 80vh;
  margin: 1rem auto;
  background-color: #FFF8F0;
  border: 2px solid #A9826D;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(59, 44, 37, 0.1);
  overflow-y: auto;
  overflow-x: hidden;
}

/* Todo Form Styles */
.todo-form {
  max-width: 70vh;
  margin: 20px auto;
  padding: 20px;
  border: 1px solid #A9826D;
  border-radius: 8px;
  background-color: #FFF8F0;
  box-shadow: 0 2px 4px rgba(59, 44, 37, 0.1);
}

.todo-form.hidden {
  display: none;
}

.selected-date {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 15px;
  color: #3B2C25;
  text-align: center;
}

/* Note Section Styles */
.note-section {
  margin-bottom: 20px;
}

#day-note {
  width: 100%;
  min-height: 80px;
  padding: 10px;
  border: 1px solid #A9826D;
  border-radius: 4px;
  font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
  font-size: 14px;
  resize: vertical;
  box-sizing: border-box;
  color: #3B2C25;
}

#day-note:focus {
  outline: none;
  border-color: #D64541;
  box-shadow: 0 0 0 2px rgba(214, 69, 65, 0.2);
}

/* Todos Section Styles */
.todos-section {
  margin-top: 20px;
}

#todos-list {
  margin-bottom: 15px;
}

#add-todo {
  background-color: #D64541;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

#add-todo:hover {
  background-color: #E3B778;
  color: #3B2C25;
}

#add-todo:active {
  background-color: #C54A3F;
  color: white;
}

/* Todo Item Styles */
.todo-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  margin-bottom: 10px;
  border: 1px solid #A9826D;
  border-radius: 6px;
  background-color: #FFF8F0;
  transition: all 0.2s ease;
  position: relative;
}

.todo-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.todo-item.todo-completed {
  opacity: 0.7;
}

.todo-item.todo-completed[data-background-color] {
  opacity: 0.5;
}

.todo-item.todo-completed .todo-title,
.todo-item.todo-completed .todo-comment {
  text-decoration: line-through;
  color: #7C5E4A;
}

/* Background color application for todo items */
.todo-item[data-background-color="coral"] {
  background-color: #ffb3ba;
}

.todo-item[data-background-color="mint"] {
  background-color: #baffc9;
}

.todo-item[data-background-color="sky"] {
  background-color: #bae1ff;
}

.todo-item[data-background-color="lavender"] {
  background-color: #d4baff;
}

.todo-item[data-background-color="peach"] {
  background-color: #ffffba;
}

.todo-item[data-background-color="rose"] {
  background-color: #ffb3e6;
}

.todo-checkbox {
  margin-top: 4px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.todo-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.todo-title {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #A9826D;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  box-sizing: border-box;
  color: #3B2C25;
}

.todo-title:focus {
  outline: none;
  border-color: #D64541;
  box-shadow: 0 0 0 2px rgba(214, 69, 65, 0.2);
}

.todo-comment {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #A9826D;
  border-radius: 4px;
  font-size: 13px;
  color: #7C5E4A;
  box-sizing: border-box;
}

.todo-comment:focus {
  outline: none;
  border-color: #D64541;
  box-shadow: 0 0 0 2px rgba(214, 69, 65, 0.2);
}

.todo-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}



/* Кастомный селектор цветов как цветные прямоугольники */
.color-selector {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}

.color-selector-label {
  font-size: 12px;
  color: #7C5E4A;
  margin-right: 6px;
  white-space: nowrap;
}

.color-option {
  width: 24px;
  height: 24px;
  border: 2px solid #A9826D;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.color-option:hover {
  transform: scale(1.1);
  border-color: #D64541;
}

.color-option.selected {
  border-color: #D64541;
  border-width: 3px;
  transform: scale(1.1);
}

.color-option.selected::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #D64541;
  font-size: 12px;
  font-weight: bold;
}

.color-option[data-color="coral"] {
  background-color: #ffb3ba;
}

.color-option[data-color="mint"] {
  background-color: #baffc9;
}

.color-option[data-color="sky"] {
  background-color: #bae1ff;
}

.color-option[data-color="lavender"] {
  background-color: #d4baff;
}

.color-option[data-color="peach"] {
  background-color: #ffffba;
}

.color-option[data-color="rose"] {
  background-color: #ffb3e6;
}

.todo-tag {
  padding: 4px 8px;
  border: 1px solid #A9826D;
  border-radius: 4px;
  font-size: 12px;
  color: #7C5E4A;
  min-width: 60px;
  flex: 1;
}

.todo-tag:focus {
  outline: none;
  border-color: #D64541;
  box-shadow: 0 0 0 2px rgba(214, 69, 65, 0.2);
}

.todo-tag:not(:placeholder-shown) {
  background-color: #E3B778;
  border-color: #A9826D;
  font-weight: 500;
  color: #3B2C25;
}

.todo-tag[value]:not([value=""]) {
  background-color: #E3B778;
  border-color: #A9826D;
  font-weight: 500;
  color: #3B2C25;
}

.todo-delete {
  background-color: #C54A3F;
  color: white;
  border: none;
  border-radius: 4px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.2s;
}

.todo-delete:hover {
  background-color: #D64541;
}

.todo-delete:active {
  background-color: #A9826D;
}

/* Responsive adjustments for todo items */
@media (max-width: 600px) {
  .todo-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .todo-color,
  .todo-tag {
    min-width: auto;
  }
}

/* Selected Day Highlighting */
.fc-day.selected-day {
  background-color: #E3B778 !important;
  border: 2px solid #D64541 !important;
}

.fc-day.selected-day:hover {
  background-color: #FFEAD0 !important;
}

/* Calendar Day Content Structure */
.calendar-day-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  padding: 2px;
  box-sizing: border-box;
}

.calendar-day-todos {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: visible;
  width: 100%;
  margin-top: 2px;
  min-height: 0;
}

/* Calendar Todos Display */
.calendar-todos-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  box-sizing: border-box;
}

.calendar-todo-item {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 1px 2px;
  border-radius: 2px;
  font-size: 10px;
  line-height: 1.2;
  min-height: 14px;
  cursor: pointer;
  transition: opacity 0.2s ease;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.calendar-todo-item:hover {
  opacity: 0.8;
}

.calendar-todo-checkbox {
  font-size: 8px;
  font-weight: bold;
  color: #D64541;
  flex-shrink: 0;
  width: 10px;
  text-align: center;
  margin-right: 1px;
}

.calendar-todo-title {
  flex: 1;
  overflow: hidden;
  color: #3B2C25;
  font-weight: 500;
  min-width: 0;
  word-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

/* Responsive adjustments for calendar todos */
@media (max-width: 768px) {
  .calendar-todos-list {
    max-height: 60px;
    padding: 0 1px;
  }

  .calendar-todo-item {
    font-size: 9px;
    min-height: 12px;
    padding: 1px;
    gap: 1px;
  }

  .calendar-todo-checkbox {
    font-size: 7px;
    width: 8px;
  }
}

/* Ensure calendar cells have enough space for todos and proper layout */
.fc-daygrid-day-frame {
  min-height: 120px;
  position: relative;
}

.fc-daygrid-day-top {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 0;
}

.fc-daygrid-day-number {
  padding: 2px 4px;
  font-weight: bold;
  align-self: flex-start;
  margin-bottom: 2px;
}

/* Ensure proper containment within calendar cells */
.fc-daygrid-day {
  overflow: visible;
}

.fc-daygrid-day-events {
  margin-top: 0;
}

.logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 1rem;
  margin-bottom: 0;
}

.logo {

  height: 5rem;
}

/* Calendar Day Header with Drag Handle */
.calendar-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 2px;
}

.drag-handle {
  font-size: 12px;
  color: #7C5E4A;
  cursor: grab;
  padding: 2px 4px;
  border-radius: 3px;
  transition: all 0.2s ease;
  user-select: none;
  line-height: 1;
  opacity: 0.6;
}

.drag-handle:hover {
  background-color: rgba(227, 183, 120, 0.3);
  color: #D64541;
  opacity: 1;
  transform: scale(1.1);
}

.drag-handle:active {
  cursor: grabbing;
  background-color: rgba(214, 69, 65, 0.2);
}

/* Drag and Drop Visual Feedback Styles */
.fc-daygrid-day.fc-dragging {
  opacity: 0.7 !important;
  transform: scale(0.95);
  transition: all 0.2s ease;
}

.fc-daygrid-day.fc-drop-target {
  background-color: rgba(227, 183, 120, 0.3) !important;
  border: 2px dashed #D64541 !important;
  box-shadow: 0 0 8px rgba(214, 69, 65, 0.3) !important;
  transform: scale(1.02);
  transition: all 0.2s ease;
}

.fc-daygrid-day.fc-drop-invalid {
  background-color: rgba(197, 74, 63, 0.2) !important;
  border: 2px dashed #C54A3F !important;
  box-shadow: 0 0 8px rgba(197, 74, 63, 0.3) !important;
  cursor: not-allowed;
}

/* Prevent text selection during drag */
.fc-daygrid-day.fc-dragging * {
  user-select: none !important;
  pointer-events: none !important;
}

/* Calendar Header and Button Styles */
.fc-toolbar {
  margin-bottom: 1rem;
}

/* Hide view selection buttons (Month, Week, Day) */
.fc-dayGridMonth-button,
.fc-timeGridWeek-button,
.fc-timeGridDay-button {
  display: none !important;
}

/* Calendar navigation buttons */
.fc-button-group .fc-button,
.fc-today-button {
  background-color: #D64541 !important;
  border-color: #D64541 !important;
  color: white !important;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.fc-button-group .fc-button:hover,
.fc-today-button:hover {
  background-color: #E3B778 !important;
  border-color: #E3B778 !important;
  color: #3B2C25 !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(59, 44, 37, 0.2);
}

.fc-button-group .fc-button:active,
.fc-today-button:active {
  background-color: #C54A3F !important;
  border-color: #C54A3F !important;
  color: white !important;
  transform: translateY(0);
}

.fc-button-group .fc-button:focus,
.fc-today-button:focus {
  box-shadow: 0 0 0 2px rgba(214, 69, 65, 0.3) !important;
  outline: none;
}

/* Active/pressed state for navigation buttons */
.fc-button-group .fc-button.fc-button-active,
.fc-button-group .fc-button:not(:disabled).fc-button-active:focus {
  background-color: #A9826D !important;
  border-color: #A9826D !important;
  color: white !important;
}

/* Disabled state */
.fc-button-group .fc-button:disabled,
.fc-today-button:disabled {
  background-color: #7C5E4A !important;
  border-color: #7C5E4A !important;
  color: rgba(255, 255, 255, 0.6) !important;
  cursor: not-allowed;
  transform: none;
}

/* Calendar title styling */
.fc-toolbar-title {
  color: #3B2C25 !important;
  font-weight: bold;
  font-size: 1.5rem;
}

/* Button group spacing */
.fc-button-group {
  display: inline-flex;
  gap: 2px;
}

.fc-button-group .fc-button {
  margin: 0 !important;
}

/* First and last button border radius */
.fc-button-group .fc-button:first-child {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

.fc-button-group .fc-button:last-child {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

.fc-button-group .fc-button:not(:first-child):not(:last-child) {
  border-radius: 0 !important;
}

/* Today button separate styling */
.fc-today-button {
  margin-left: 8px !important;
}

/* Remove default FullCalendar button styles */
.fc-button-primary {
  background-color: transparent !important;
  border-color: transparent !important;
}

.fc-button-primary:not(:disabled):active,
.fc-button-primary:not(:disabled).fc-button-active {
  background-color: transparent !important;
  border-color: transparent !important;
}

/* Basic calendar cell styling */
.fc-daygrid-body td {
  vertical-align: top;
}

.fc-daygrid-day-frame {
  overflow: visible;
}

/* 
Better approach for preventing scrollbars in calendar cells */
.fc-daygrid-day-events {
  max-height: none !important;
  overflow: visible !important;
}

.fc-daygrid-more-link {
  display: none !important;
}

/* Allow calendar rows to expand naturally */
.fc-daygrid-body tr {
  height: auto;
}

/* C
alendar day borders in our color scheme */
.fc-daygrid-day {
  border-color: #A9826D !important;
}

.fc-daygrid-day-top {
  border-color: #A9826D !important;
}

.fc-daygrid-day-frame {
  border-color: #A9826D !important;
}

/* Calendar table borders */
.fc-scrollgrid-sync-table {
  border-color: #A9826D !important;
}

.fc-scrollgrid-sync-table td,
.fc-scrollgrid-sync-table th {
  border-color: #A9826D !important;
}

/* Header row borders */
.fc-col-header-cell {
  border-color: #A9826D !important;
}

/* General table borders */
.fc table {
  border-color: #A9826D !important;
}

.fc td,
.fc th {
  border-color: #A9826D !important;
}

/* Week header styling */
.fc-col-header-cell-cushion {
  color: #3B2C25 !important;
  font-weight: bold;
}

/* Let FullCalendar manage its own height naturally */