
.dac-day-slot-counts {
  background: rgba(255, 255, 255, 0.9);
  padding: 4px 6px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: 'sub', sans-serif;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  gap: 2px;
}

.dac-day-count {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.dac-day-count .emoji {
  font-family: emoji;
  font-size: 13px;
}

.dac-day-count .text {
  font-family: 'sub', sans-serif;
  font-weight: 600;
}

.calendar-day {
    position: relative;
    min-height: 50px;
    cursor: pointer;
    padding: 5px;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.calendar-day:hover {
    background-color: #f5f5f5;
}
.calendar-day.selected {
    background-color: #009688 !important;
    border-color: #00bcd4;
}
.calendar-day.today {
    font-weight: bold;
    background-color: #0683a6;
}
.dac-day-slot-counts {
    position: absolute;
    bottom: 2px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 5px;
    font-size: 9px;
    pointer-events: none;
}
.dac-day-count {
    display: inline-block;
    padding: 0 3px;
    border-radius: 3px;
    font-weight: bold;
}
.dac-day-count.booked {
    background-color: #e53e3e20;
    color: #e53e3e;
}
.dac-day-count.available {
    background-color: #38a16920;
    color: #38a169;
}
.calendar-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}
.calendar-nav button {
    padding: 5px 10px;
    border: 1px solid #ddd;
    background: #f5f5f5;
    cursor: pointer;
    border-radius: 4px;
}

.flatpickr-day.has-counts {
  position: relative !important;
}

.dac-day-slot-counts {
  position: absolute !important;
  bottom: 2px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  font-size: 10px !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  text-align: center !important;
  z-index: 10 !important;
  pointer-events: none !important;
  font-weight: bold !important;
}

.dac-day-count.booked {
  display: block !important;
  color: #e53e3e !important;
}

.dac-day-count.available {
  display: block !important;
  color: #38a169 !important;
}

.dac-day-slot-counts {
  position: absolute !important;
  bottom: 2px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  font-size: 10px !important;
  white-space: nowrap !important;
  line-height: 1.2 !important;
  text-align: center !important;
}

.dac-day-slot-counts {
  font-size: 10px;
  line-height: 1.1;
  text-align: center;
  margin-top: 2px;
}

.dac-day-count {
  display: block !important;
  font-weight: 600 !important;
}

.dac-day-count.booked {
  color: #e53e3e !important;
}

.dac-day-count.available {
  color: #38a169 !important;
}

.flatpickr-day.fully-booked {
  background-color: #ffe5e5 !important;
  border: 1px solid #e53e3e !important;
}

.flatpickr-day.partially-booked {
  background-color: #fff3cd !important;
  border: 1px solid #f0ad4e !important;
}

.flatpickr-day.has-slots {
  font-weight: bold;
  border: 2px solid #22543d;
}
.bg-green-200 { background-color: #c6f6d5; color: #22543d; }
.bg-yellow-200 { background-color: #fefcbf; color: #744210; }
.bg-red-200 { background-color: #fed7d7; color: #742a2a; }

#gfield_7_33 {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transform: translateY(-10px);
  transition: all 0.5s ease-in-out;
}

#gfield_7_33.dac-visible {
  opacity: 1;
  max-height: 1000px;
  transform: translateY(0);
}

.dac-slot-btn {
  padding: 10px;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  background-color: #3498db;
  color: white;
  cursor: pointer;
  width: 100%;
  max-width: 120px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: background-color 0.2s ease;
}

.dac-slot-btn:hover:not(.disabled) {
  background-color: #2980b9;
}

.dac-slot-btn.disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.dac-slot-btn.selected {
    background-color: #007cba;
    color: #fff;
    border-color: #007cba;
}

.dac-appointment-slots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 1rem;
}
.dac-slot-btn {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #f1f1f1;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}
.dac-slot-btn:hover {
    background-color: #e2e6ea;
}
.dac-slot-btn.selected {
    background-color: #007cba;
    color: white;
    border-color: #007cba;
}
.dac-slot-btn.disabled {
    background-color: #ff000033;
    color: #ff0000c7;
    border-color: #ff000033;
    cursor: not-allowed;
    position: relative;
}
.dac-slot-btn[title]:hover::after {
  content: attr(title);
  position: absolute;
  top: -28px; /* قربه أكثر */
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: #fff;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 9999;
  opacity: 1;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.dac-slot-btn {
      transition: transform 0.25s ease, background-color 0.25s ease, color 0.25s ease;
  will-change: transform;
  position: relative; /* مهم جداً حتى يظهر التولتيب بالنسبة للزر */
}

.dac-slot-btn:hover {
  background-color: #4caf50;
  color: #fff;
  transform: scale(1.3);
  z-index: 999;
}
.dac-slot-btn.selected {
    background-color: #0683a6;
    color: #fff;
    border-color: #0683a6;
}

.dac-slot-btn.disabled {
  background-color: #fca5a5;
  border-color: #f87171;
  color: #fff;
  cursor: not-allowed;
  opacity: 0.8;
}
/* 📦 الحاوية الأساسية */
@media (min-width: 768px) {
  .flatpickr-calendar.inline {
    width: 700px !important;
    max-width: 100% !important;
    border-radius: 12px;
    padding: 1rem;
    font-size: 16px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
  }

  .flatpickr-month {
    display: flex !important;
    justify-content: center;
    align-items: center;
    font-size: 1.4rem;
    font-weight: bold;
    height: 60px;
    background: #f4f4f4;
    margin-bottom: 10px;
  }

  .flatpickr-current-month {
    display: flex !important;
    align-items: center;
    gap: 10px;
  }


  .flatpickr-prev-month,
  .flatpickr-next-month {
    font-size: 2rem;
    color: #555;
    top: 18px !important;
  }

  .flatpickr-weekdays {
    display: flex !important;
    grid-template-columns: repeat(7, 1fr) !important;
    text-align: center;
    font-weight: 600;
    background: #fafafa;
    font-size: 1rem;
    height: 40px;
    align-items: center;
    width: 650px !important;
    max-width: 650px !important;
  }

  .flatpickr-days {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 6px;
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
  }

  .flatpickr-day {
    width: 90px;
    height: 60px;
    line-height: 60px;
    text-align: center;
    border-radius: 6px;
    transition: background 0.2s ease;
    font-size: 1rem;
    box-sizing: border-box;
  }

  .flatpickr-day:hover {
    background-color: #f3f3f3;
    cursor: pointer;
  }

  .flatpickr-day.booked {
    background-color: #ffe5e5;
    color: #b00000;
    cursor: not-allowed;
    pointer-events: none;
  }

  .dayContainer {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 6px !important;
    width: 650px !important;
    max-width: 700px !important;
    min-width: unset !important;
    box-sizing: border-box !important;
    justify-items: center !important;
    align-items: center !important;
  }
}
.flatpickr-calendar.animate.inline {
    box-shadow: none !important;
    border: solid 1px #eee;
    margin-top: 20px;
}
.dac-appointment-slots
 {
    padding: 10px;
    margin: 10px;
    border: solid 1px #eee;
    border-radius: 5px;
    background: #fdfdfd;
}

@media (min-width: 768px) {
  .flatpickr-calendar {
     margin: 40px auto !important; /* وسّط أفقيًا وزدنا شوي فراغ من فوق وتحت */
    display: block !important;
    width: 700px !important;
    max-width: 100% !important;
    border-radius: 12px;
    padding: 1rem;
    font-size: 16px;
    background-color: #fff;
    text-align: center;
  }
}
.flatpickr-months
 {
    background: #0683a6 !important;
    margin: 5px;
    border-radius: 5px;
}
select.flatpickr-monthDropdown-months {
    color: #fff !important;
}
input.numInput.cur-year {
    color: #fff !important;
}
.flatpickr-current-month .flatpickr-monthDropdown-months {
	border: none !important;}

/* File: assets/css/dac-appointment-style.css */

.dac-day-summary {
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background-color: #f9f9f9;
  font-size: 14px;
  font-weight: 500;
  display: inline-block;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.dac-day-summary::before {
  content: "\1F4C5 "; /* calendar emoji */
}

.dac-day-summary .available {
  color: #2f855a;
  font-weight: bold;
}

.dac-day-summary .booked {
  color: #c53030;
  font-weight: bold;
}

/* === Original Styles (Preserved) === */
.flatpickr-day.has-counts {
  position: relative !important;
}

.dac-day-slot-counts {
  position: absolute !important;
  bottom: 2px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  font-size: 10px !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  text-align: center !important;
  z-index: 10 !important;
  pointer-events: none !important;
  font-weight: bold !important;
}

.dac-day-count.booked {
  display: block !important;
  color: #e53e3e !important;
}

.dac-day-count.available {
  display: block !important;
  color: #38a169 !important;
}

.flatpickr-day.fully-booked {
  background-color: #ffe5e5 !important;
  border: 1px solid #e53e3e !important;
}

.flatpickr-day.partially-booked {
  background-color: #fff3cd !important;
  border: 1px solid #f0ad4e !important;
}

.flatpickr-day.has-slots {
  font-weight: bold;
  border: 2px solid #22543d;
}

/* === Custom Calendar Styles (New) === */
.custom-calendar {
  width: 100%;
  max-width: 100vw;
  padding: 10px;
  box-sizing: border-box;
  background: #fff;
  border-radius: 8px;
  font-family: Arial, sans-serif;
}

.calendar-header {
  text-align: center;
  font-size: 20px;
  font-weight: bold;
  color: #0683a6;
  margin-bottom: 10px;
}

.calendar-weekdays {
display: grid;
    grid-template-columns: repeat(7, 1fr);
    font-weight: bold;
    color: #ffffff;
    background: #0683a6;
    text-transform: uppercase;
    padding: 10px 0;
    text-align: center;
    margin-bottom: 10px;
    border-radius: 5px;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

.calendar-day {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border-radius: 10px;
  background: #f9f9f9;
  cursor: pointer;
  transition: background 0.2s ease-in-out;
}

.calendar-day:hover {
  background: #0683a6;
  color: white;
}

.calendar-day.today {
  background: #0683a6;
  color: white;
  font-weight: bold;
}

.calendar-day.selected {
  background: #04556f;
  color: white;
}

/* === Custom Calendar Styles (New) === */
.custom-calendar {
  width: 100%;
  max-width: 100vw;
  padding: 10px;
  box-sizing: border-box;
  background: #fff;
  border-radius: 8px;
  font-family: Arial, sans-serif;
}

.calendar-header {
  text-align: center;
  font-size: 20px;
  font-weight: bold;
  color: #0683a6;
  margin-bottom: 10px;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  font-weight: bold;
  color: #ffffff;
  background: #0683a6;
  text-transform: uppercase;
  padding: 10px 0;
  text-align: center;
  margin-bottom: 10px;
  border-radius: 5px;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

.calendar-day {
  height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  border-radius: 10px;
  background: #f9f9f9;
  cursor: pointer;
  transition: background 0.2s ease-in-out;
  padding: 4px;
  text-align: center;
  position: relative;
}

.calendar-day:hover {
  background: #0683a6;
  color: white;
}

.calendar-day.today {
  background: #0683a6;
  color: white;
  font-weight: bold;
}

.calendar-day.selected {
  background: #04556f;
  color: white;
}

/* تاريخ اليوم بأعلى الخلية */
.calendar-day .day-number {
  font-weight: bold;
  font-size: 16px;
  color: #333;
  margin-bottom: 4px;
}

.calendar-day .day-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* عداد الحجوزات */
.dac-day-slot-counts {
  background: rgba(255, 255, 255, 0.9);
  padding: 4px 6px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: 'sub', sans-serif;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  gap: 2px;
}

.dac-day-count {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.dac-day-count .emoji {
  font-family: emoji;
  font-size: 13px;
}

.dac-day-count .text {
  font-family: 'sub', sans-serif;
  font-weight: 600;
}

/* === Responsive Mobile Calendar Styles === */
@media (max-width: 768px) {
  .custom-calendar {
    padding: 8px;
    border-radius: 6px;
    font-size: 14px;
  }

  .calendar-header {
    font-size: 18px;
    margin-bottom: 8px;
  }

  .calendar-weekdays {
    font-size: 11px;
    padding: 6px 0;
    border-radius: 4px;
  }

  .calendar-days {
    gap: 6px;
  }

  .calendar-day {
    height: 70px;
    padding: 3px;
  }

  .calendar-day .day-number {
    font-size: 14px;
    margin-bottom: 2px;
  }

  .dac-day-slot-counts {
    font-size: 10px;
    padding: 2px 3px;
    border-radius: 4px;
  }

  .dac-day-count {
    flex-direction: column;
    gap: 1px;
  }

  .dac-day-count .emoji {
    font-size: 12px;
  }

  .dac-day-count .text {
    font-size: 10px;
  }
}
@media (max-width: 768px) {
  .calendar-day {
    height: 80px;
    padding: 4px;
    font-size: 13px;
  }

  .calendar-day .day-number {
    font-size: 14px;
    margin-bottom: 2px;
  }

  .dac-day-slot-counts {
    background: rgba(255, 255, 255, 0.85); /* خلفية شبه شفافة */
    padding: 3px 5px;
    border-radius: 6px;
    width: 95%; /* تقريبًا كل عرض الخلية */
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'sub', sans-serif;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    gap: 2px;
    margin-top: auto;
  }

  .dac-day-count {
    font-size: 10px;
    gap: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .dac-day-count .emoji {
    font-size: 12px;
    line-height: 1;
    vertical-align: middle;
  }

  .dac-day-count .text {
    font-size: 10px;
    line-height: 1;
    font-weight: 600;
    vertical-align: middle;
  }
.dac-day-slot-counts
 {
    margin-right: -20px !important;
}
}

#slot-popup-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

#slot-popup-box {
    background: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 90%;
    max-height: 80%;
    overflow-y: auto;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    text-align: center;
    position: relative;
}

#slot-popup-title {
    margin-top: 0;
    font-size: 18px;
}

#slot-popup-content {
  margin-top: 15px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
  justify-items: center;
}


#slot-popup-close,
#slot-popup-cancel {
    padding: 8px 16px;
    margin-top: 20px;
    margin-right: 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#slot-popup-cancel {
    background-color: #e74c3c;
    color: white;
}

#dac-loading-indicator {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-oval {
    width: 50px;
    height: 50px;
    border: 6px solid transparent;
    border-top: 6px solid #3498db;
    border-left: 6px solid #3498db;
    border-radius: 50%;
    animation: dac-spin 0.8s linear infinite;
}



@keyframes dac-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.dac-slot-btn {
    margin: 5px;
    padding: 8px 14px;
    font-size: 14px;
    border: none;
    border-radius: 4px;
    background-color: #3498db;
    color: white;
    cursor: pointer;
}

.dac-slot-btn.disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.dac-day-slot-counts {
    margin-top: 5px;
    font-size: 12px;
    display: flex;
    justify-content: center;
    gap: 6px;
}

.dac-day-count {
    display: flex;
    align-items: center;
    gap: 4px;
}
h3#slot-popup-title
 {
    font-family: 'sud' !important;
}