/* calender/calender.css */
.MTB .mtb-datefield {
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

/* .MTB .mtb-datefield:hover {
  background-color: var(--text-gray-lightest);
} */

.MTB .mtb-date-input {
  flex: 1;
  border: none;
  outline: none;
  padding-left: 18px;
  /* height: 55px; */
  font-size: 16px !important;
  font-weight: 400 !important;
  color: var(--primary);
  background: transparent;
  cursor: pointer;
  user-select: none;
}

.MTB .mtb-date-input::placeholder {
  color: var(--bar);
  font-weight: 400 !important;
  font-size: 16px !important;
}

.MTB .calendar-container .icon.calendar-icon {
  position: absolute;
  top: 6px;
}

.MTB .mtb-calendar {
  position: absolute;
  top: calc(100% + 8px);
  left: -100%;
  z-index: 9999;
  max-width: 620px;
  min-width: 320px;
  background: var(--bg-white);
  border: 2px solid var(--primary);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 0;
  display: none;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.MTB .mtb-calendar.is-open {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Header */
.MTB .mtb-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-lighter);
  border-radius: 12px 12px 0 0;
}

.MTB .mtb-cal-title {
  font-weight: 600;
  font-size: 16px;
  color: var(--primary);
  flex: 1;
  text-align: center;
  letter-spacing: 0;
}

.MTB .mtb-cal-btn {
  border: none;
  background: transparent;
  color: var(--text-gray);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  line-height: 1;
  user-select: none;
  font-size: 28px;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.MTB .mtb-cal-btn:hover {
  background: var(--bg-gray-lighter);
  color: var(--text-dark);
}

.MTB .mtb-cal-btn:active {
  transform: scale(0.95);
}

/* Months grid */
.MTB .mtb-months {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 24px;
  background: var(--bg-white);
  border-radius: 0 0 12px 12px;
}

.MTB .mtb-month-name {
  text-align: center;
  font-weight: 600;
  color: var(--primary);
  font-size: 16px;
  margin: 0 0 16px;
  letter-spacing: 0;
}

/* Day names */
.MTB .mtb-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.MTB .mtb-dow div {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-gray-medium);
  text-align: center;
  padding: 8px 0;
  text-transform: uppercase;
  letter-spacing: 0;
}

/* Days */
.MTB .mtb-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.MTB .mtb-day {
  aspect-ratio: 1;
  border-radius: 6px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
  display: grid;
  place-items: center;
  user-select: none;
  transition: all 0.2s ease;
  position: relative;
}

.MTB .mtb-day:hover {
  background: var(--bg-gray-lighter);
}

.MTB .mtb-day.is-muted {
  color: var(--text-gray-lighter);
  background: transparent;
}

.MTB .mtb-day.is-muted:hover {
  background: var(--bg-gray-light);
  color: var(--text-gray-light);
}

.MTB .mtb-day.is-disabled {
  color: var(--text-gray-lightest);
  background: transparent;
  cursor: not-allowed;
  text-decoration: line-through;
}

.MTB .mtb-day.is-disabled:hover {
  background: transparent;
}

/* .MTB .mtb-day.is-today {
  background: #1e3a8a;
  color: var(--bg-white);
  font-weight: 600;
}

.MTB .mtb-day.is-today:hover {
  background: #1e40af;
} */

.MTB .mtb-day.is-selected {
  background: var(--primary);
  color: var(--bg-white);
  font-weight: 600;
}

.MTB .mtb-day.is-selected:hover {
  background: #1e40af;
}

/* Footer - Hidden by default to match the image */
.MTB .mtb-cal-footer {
  display: none;
  gap: 8px;
  padding: 16px 24px;
  background: var(--bg-white);
  border-top: 1px solid var(--border-lighter);
  border-radius: 0 0 12px 12px;
}

.MTB .mtb-footer-btn {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border-default);
  background: var(--bg-white);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-gray);
}

.MTB .mtb-footer-btn:hover {
  background: var(--bg-gray-lighter);
}

.MTB .mtb-footer-btn.btn-clear {
  color: var(--text-gray-medium);
}

.MTB .mtb-footer-btn.btn-clear:hover {
  background: var(--bg-gray-lighter);
}

.MTB .mtb-footer-btn.btn-today {
  color: var(--primary);
}

.MTB .mtb-footer-btn.btn-today:hover {
  background: var(--primary-background);
}

.MTB .mtb-footer-btn.btn-ok {
  background: var(--primary);
  color: var(--bg-white);
  border-color: var(--primary);
}

.MTB .mtb-footer-btn.btn-ok:hover {
  background: var(--primary-hover);
}

/* Animations */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.MTB .mtb-calendar.is-open .mtb-month {
  animation: slideIn 0.3s ease-out;
}

.MTB .mtb-calendar.is-open .mtb-month:nth-child(2) {
  animation-delay: 0.05s;
}

.MTB .mtb-date-input-group {
  display: flex;
  align-items: center;
  border: 2px solid var(--border-default);
  border-radius: 10px;
  padding: 14px 16px;
  background: linear-gradient(
    to bottom,
    var(--bg-white) 0%,
    var(--bg-gray-light) 100%
  );
  transition: all 0.3s ease;
  cursor: pointer;
}

.MTB .mtb-date-input-group:hover {
  border-color: var(--text-gray-light);
  background: var(--bg-white);
  box-shadow: var(--shadow-sm);
}

.MTB .mtb-datefield:focus-within .mtb-date-input-group {
  border-color: var(--primary);
  background: var(--bg-white);
}

.MTB .mtb-date-input-group .icon {
  margin-right: 10px;
  font-size: 16px;
  flex-shrink: 0;
  height: 100%;
}

.MTB .mtb-date-input-group .icon svg {
  width: 16px;
  height: 16px;
  fill: var(--primary);
  transition: transform 0.2s ease;
}

.MTB .mtb-day-empty {
  background: transparent !important;
  cursor: default !important;
  pointer-events: none;
  visibility: hidden;
}

.MTB .mtb-datefield::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 6px; /* keep your current positioning */
  width: 16px;
  height: 16px;
  pointer-events: none;

  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath fill='%23003366' d='M128 0c17.7 0 32 14.3 32 32v32h128V32c0-17.7 14.3-32 32-32s32 14.3 32 32v32h32c35.3 0 64 28.7 64 64v288c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V128C0 92.7 28.7 64 64 64h32V32c0-17.7 14.3-32 32-32zM64 240v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16H80c-8.8 0-16 7.2-16 16zm128 0v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16h-32zM64 368v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16H80c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16h-32zm112 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16z'/%3E%3C/svg%3E")
    no-repeat center / contain;
}

.MTB .calendar-container::after {
  content: "";
  position: absolute;
  top: 30%;
  height: 40%;
  width: 2px;
  background: var(--bar);
  right: 0;
}

/* Mobile optimizations */
@media (max-width: 400px) {
  .MTB .mtb-day {
    border-radius: 4px;
    font-size: 13px;
  }

  .MTB .mtb-dow div {
    font-size: 12px;
    padding: 6px 0;
  }

  .MTB .mtb-month-name {
    font-size: 14px;
    margin-bottom: 12px;
  }

  .MTB .mtb-cal-header {
    padding: 16px 20px;
  }

  .MTB .mtb-cal-title {
    font-size: 14px;
  }

  .MTB .mtb-cal-btn {
    width: 28px;
    height: 28px;
    font-size: 20px;
  }

  .MTB .mtb-months {
    gap: 16px;
    padding: 20px 16px;
  }
}

/* Better mobile positioning */
@media (max-width: 768px) {
  .MTB .mtb-calendar {
    max-width: calc(100vw - 40px);
  }
  .MTB .mtb-month-name {
    text-align: left !important;
  }
}

@media (max-width: 560px) {
  .MTB .mtb-months {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px;
  }
  .MTB .mtb-calendar {
    min-width: 300px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
  }
  .MTB .mtb-calendar.is-open {
    transform: translateX(-50%) translateY(0);
  }
}

.MTB .mtb-month {
  min-width: 260px;
}

@media (max-width: 560px) {
  .MTB .mtb-month {
    width: 100%;
    min-width: auto;
  }
}

 .mtb-day.is-disabled.is-range-start,
  .mtb-day.is-disabled.is-range-start:hover
  {
    background-color: var(--primary);
  }

@media (max-width: 768px) {
  /* ===== Mobile Fullscreen Modal Calendar ===== */
  .mtb-cal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 999999;
    display: flex;
    align-items: stretch;
    justify-content: center;
  }
 

  .mtb-cal-modal {
    width: 100%;
    height: 100%;
    background: #fff;
    display: flex;
  }

  .mtb-calendar.is-modal {
    position: static !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: column;
    opacity: 1 !important;
    transform: none !important;
  }

  /* Header */
  .mtb-modal-header {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px;
    border-bottom: 1px solid var(--border-lighter);
  }

  .mtb-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--bg-white);
  }
  .mtb-modal-close {
    border: 0px !important;
    padding: 0px !important;
    background-color: transparent;
  }
  .mtb-modal-close:hover {
    background-color: transparent !important;
  }
  .mtb-modal-close svg {
    width: 20px;
    height: 20px;
    fill: var(--bg-white);
    border: none;
    padding: 0px;
  }

  /* Scroll area */
  .mtb-modal-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 12px 120px; /* space for footer */
  }

  /* One month per row */
  .mtb-months.mtb-months-vertical {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 18px;
    padding: 0;
  }

  /* Footer fixed bottom */
  .mtb-modal-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 6;
    background: #fff;
    border-top: 1px solid var(--border-lighter);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .mtb-modal-summary {
    display: flex;
    justify-content: flex-start;
    font-weight: 600;
    color: var(--primary);
  }

  .mtb-confirm-btn {
    width: 100% !important;
    padding: 14px 16px !important;
    border: none !important;
    border-radius: 10px !important;
    background: var(--primary) !important;
    color: #fff !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
  }

  .mtb-confirm-btn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
  }

  /* Keep day grid looking same */
  .mtb-month {
    width: 100%;
    min-width: 0 !important;
  }
  .mtb-dow {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
  }
  .mtb-dow div {
    font-size: 12px;
    padding: 6px 0;
    font-weight: 800;
    color: var(--primary);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0;
  }
  .mtb-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    border-radius: 4px;
    padding: 0;
    border: none;
    font-size: 13px;
    aspect-ratio: 1;
    font-weight: 500;
    color: var(--primary);
    place-items: center;
    user-select: none;
    transition: all 0.2s ease;
    position: relative;
  }
  .mtb-day.is-disabled {
    color: var(--text-gray-lightest);
    background: transparent;
    cursor: not-allowed;
    text-decoration: line-through;
  }
  .mtb-day.is-selected {
    background-color: var(--primary);
    color: var(--bg-white);
    font-weight: 600;
  }
  .mtb-day {
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    margin: auto 0;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
  }

  .mtb-month-name {
    text-align: left !important;
    font-weight: 600;
    color: var(--primary);
    font-size: 16px;
    margin: 0 0 16px;
    letter-spacing: 0;
  }
  .MTB .mtb-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
  }
}

/* Only enable modal on mobile */
@media (min-width: 769px) {
  .mtb-cal-overlay {
    display: none !important;
  }
}

/* Range styles (Return calendar) */
.mtb-day.is-in-range {
  background: #e9eef5;
  color: var(--primary);
  border-radius: 6px;
}

.mtb-day.is-range-start,
.mtb-day.is-range-end {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

/* optional: make range feel connected */
.mtb-day.is-range-start:hover {
  background: var(--primary-hover);
}
