:root {
  --background: #ffff;
  --primary-color-gradient: linear-gradient(135deg, #e2272d, #d11d23);
  --primary-color: #d11d23;
  --primary-hover-color: #9e181d;
  --box-shadow: rgb(209, 46, 46);
  --text-color: black;
  --text-color-alt: white;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Open Sans", "Noto Sans Thai", "Noto Sans JP", sans-serif;
  background: var(--background);
  color: var(--text-color);
  margin-top: 60px;
}

/* Scroll to top button */
.scroll-to-top {
  position: fixed;
  bottom: 90px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--primary-color-gradient);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(209, 29, 35, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
}

.scroll-to-top i {
  color: white;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 24px rgba(209, 29, 35, 0.4);
  background: linear-gradient(135deg, #c71f25, var(--primary-hover-color));
}

/* Calendar */
.calendar-section {
  background: white;
  padding: 35px;
  border-radius: 12px;
  box-shadow: 0 2px 15px rgba(209, 29, 35, 0.08);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.calendar-section h3 {
  color: var(--primary-color);
  margin-bottom: 10px;
  font-size: 1.8rem;
}

.calendar-section > p {
  color: #666;
  margin-bottom: 25px;
  font-size: 0.95rem;
}

.calendar {
  width: 100%;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.calendar-header h3 {
  font-size: 1.15rem;
  color: var(--text-color);
  font-weight: 600;
}

.calendar-nav {
  display: flex;
  gap: 10px;
}

.calendar-nav button {
  background: var(--primary-color);
  color: white;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.1rem;
  transition:
    background 0.3s ease,
    transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-nav button:hover {
  background: var(--primary-hover-color);
  transform: scale(1.05);
}

.calendar-nav button:active {
  transform: scale(0.95);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar-days-wrapper {
  display: contents;
}

.calendar-day-header {
  text-align: center;
  font-weight: 600;
  color: var(--primary-color);
  padding: 10px 5px;
  font-size: 0.85rem;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  border: 1px solid #f0f0f0;
  background: white;
}

.calendar-day:hover:not(.other-month) {
  background: #f8f8f8;
  color: var(--primary-color);
  border-color: var(--primary-color);
  transform: scale(1.05);
}

.calendar-day.other-month {
  color: #d0d0d0;
  cursor: default;
}

.calendar-day.today {
  background: var(--primary-color);
  color: white;
  font-weight: 600;
  border-color: var(--primary-color);
}

.calendar-day.closed {
  background: #ffebee;
  color: #c62828;
  position: relative;
  text-decoration: line-through;
  border-color: #ffcdd2;
  cursor: not-allowed;
}

.legend {
  margin-top: 20px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 20px;
  border-top: 1px solid #f0f0f0;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.legend-box {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
}

.legend-box.today {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.legend-box.closed {
  background: #ffebee;
  border-color: #ffcdd2;
}

/* Line Chat Floating Button */
.line-chat-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: #06c755;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(6, 199, 85, 0.4);
  text-decoration: none;
  z-index: 1000;
  transition: all 0.3s ease;
}

.line-chat-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 24px rgba(6, 199, 85, 0.55);
}

/* Pulse ring */
.line-chat-btn::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(6, 199, 85, 0.5);
  animation: line-pulse 2.4s ease-out infinite;
  pointer-events: none;
}

.line-chat-btn svg {
  width: 28px;
  height: 28px;
  fill: #fff;
}

/* Tooltip */
.line-chat-btn__tooltip {
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  background: rgba(15, 15, 15, 0.8);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.line-chat-btn__tooltip::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 100%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-left-color: rgba(15, 15, 15, 0.8);
}

.line-chat-btn:hover .line-chat-btn__tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

@keyframes line-pulse {
  0% {
    transform: scale(1);
    opacity: 0.9;
  }
  80% {
    transform: scale(1.6);
    opacity: 0;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

@media (max-width: 968px) {
  .calendar-day {
    font-size: 0.85rem;
  }

  .calendar-day-header {
    font-size: 0.8rem;
    padding: 8px 3px;
  }
}

@media (max-width: 768px) {
  .scroll-to-top {
    bottom: 75px;
    right: 20px;
    width: 45px;
    height: 45px;
  }

  .line-chat-btn {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
  }

  .line-chat-btn svg {
    width: 25px;
    height: 25px;
  }
}
