/**
 * Project:     Y5 LTE
 * File:        lte_CrmHolidayCalendar.css
 *
 * @link
 * @copyright 2023 Andy Chi-Huang Ho
 * @author 2023 Andy Chi-Huang Ho
 * @package DB
 * @version 1.0.0
 *
 */

:root {
  --hc-font: 'DM Sans', sans-serif;
  --hc-mono: 'DM Mono', monospace;
  --hc-canvas: #f7f6f3;
  --hc-surface: #ffffff;
  --hc-surface2: #f1f0ed;
  --hc-border: #e8e6e1;
  --hc-border2: #d4d1cb;
  --hc-ink: #1a1917;
  --hc-ink2: #4a4844;
  --hc-ink3: #8a8784;
  --hc-accent: #2563eb;
  --hc-accent-soft: #eff4ff;
  --hc-r: 10px;
  --hc-r-lg: 16px;
  --hc-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --hc-shadow: 0 4px 12px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.05);
}

body.dark-mode {
  --hc-canvas: #0f1117;
  --hc-surface: #171b26;
  --hc-surface2: #1e2333;
  --hc-border: #2a2f3e;
  --hc-border2: #363c50;
  --hc-ink: #f0efe9;
  --hc-ink2: #a8a5a0;
  --hc-ink3: #656268;
  --hc-accent: #60a5fa;
  --hc-accent-soft: #1e3a5f;
  --hc-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --hc-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.hc-page {
  font-family: var(--hc-font);
  background: var(--hc-canvas);
  min-height: 100vh;
  color: var(--hc-ink);
}

.hc-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--hc-border);
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.hc-page-title {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--hc-ink);
  letter-spacing: -0.02em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hc-page-title-icon {
  width: 34px;
  height: 34px;
  background: var(--hc-accent-soft);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hc-accent);
  font-size: 0.95rem;
}

.hc-tabs {
  display: flex;
  gap: 2px;
  background: var(--hc-surface2);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--hc-border);
}

.hc-tab {
  padding: 7px 18px;
  border-radius: 8px;
  font-size: 0.813rem;
  font-weight: 500;
  color: var(--hc-ink3);
  cursor: pointer;
  transition: all 0.18s ease;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.hc-tab:hover {
  color: var(--hc-ink);
  background: var(--hc-surface);
}

.hc-tab.active {
  background: var(--hc-surface);
  color: var(--hc-accent);
  box-shadow: var(--hc-shadow-sm);
}

.hc-panel {
  display: none;
}

.hc-panel.active {
  display: block;
  animation: hcFadeIn 0.25s ease;
}

@keyframes hcFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hc-cal-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .hc-cal-layout {
    grid-template-columns: 1fr;
  }
}

.hc-cal-sidebar {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hc-widget {
  background: var(--hc-surface);
  border: 1px solid var(--hc-border);
  border-radius: var(--hc-r-lg);
  padding: 16px;
  box-shadow: var(--hc-shadow-sm);
}

.hc-widget-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--hc-ink3);
  margin-bottom: 12px;
}

.hc-country-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hc-country-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 7px 10px;
  border-radius: 8px;
  transition: background 0.15s;
  border: 1px solid transparent;
}

.hc-country-item:hover {
  background: var(--hc-surface2);
}

.hc-country-item.active {
  background: var(--hc-surface2);
  border-color: var(--hc-border);
}

.hc-country-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: transform 0.15s;
}

.hc-country-item:hover .hc-country-dot {
  transform: scale(1.2);
}

.hc-country-label {
  font-size: 0.813rem;
  font-weight: 500;
  color: var(--hc-ink2);
  flex: 1;
}

.hc-country-count {
  font-size: 0.72rem;
  font-family: var(--hc-mono);
  background: var(--hc-surface2);
  color: var(--hc-ink3);
  padding: 1px 7px;
  border-radius: 20px;
  min-width: 24px;
  text-align: center;
}

.hc-country-check {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--hc-border2);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: all 0.15s;
  flex-shrink: 0;
}

.hc-country-check:checked {
  background: var(--hc-accent);
  border-color: var(--hc-accent);
  background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
}

.hc-upcoming-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hc-upcoming-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--hc-border);
  animation: hcFadeIn 0.3s ease both;
}

.hc-upcoming-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.hc-upcoming-date {
  font-family: var(--hc-mono);
  font-size: 0.68rem;
  color: var(--hc-ink3);
  min-width: 60px;
  line-height: 1.4;
  padding-top: 1px;
}

.hc-upcoming-info {
  flex: 1;
  min-width: 0;
}

.hc-upcoming-name {
  font-size: 0.775rem;
  font-weight: 500;
  color: var(--hc-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.hc-upcoming-chip {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  color: #fff;
  display: inline-block;
  margin-top: 3px;
}

.hc-calendar-card {
  background: var(--hc-surface);
  border: 1px solid var(--hc-border);
  border-radius: var(--hc-r-lg);
  padding: 20px;
  box-shadow: var(--hc-shadow-sm);
}

.hc-cal-loader {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(15, 17, 23, 0.18);
  border-radius: var(--hc-r-lg);
  align-items: center;
  justify-content: center;
  z-index: 10;
  backdrop-filter: blur(2px);
}

body:not(.dark-mode) .hc-cal-loader {
  background: rgba(247, 246, 243, 0.78);
}

.hc-cal-loader.show {
  display: flex;
}

.hc-spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid var(--hc-border2);
  border-top-color: var(--hc-accent);
  border-radius: 50%;
  animation: hcSpin 0.7s linear infinite;
}

@keyframes hcSpin {
  to {
    transform: rotate(360deg);
  }
}

.hc-cal-wrap {
  position: relative;
}

.hc-calendar-card .fc {
  font-family: var(--hc-font) !important;
  font-size: 0.813rem;
}

.hc-calendar-card .fc-toolbar-title {
  font-size: 1.05rem !important;
  font-weight: 600 !important;
  letter-spacing: -0.02em;
  color: var(--hc-ink) !important;
}

.hc-calendar-card .fc-button {
  background: var(--hc-surface2) !important;
  border: 1px solid var(--hc-border) !important;
  color: var(--hc-ink2) !important;
  font-size: 0.78rem !important;
  font-weight: 500 !important;
  border-radius: 7px !important;
  padding: 5px 12px !important;
  box-shadow: none !important;
  transition: all 0.15s !important;
}

.hc-calendar-card .fc-button:hover {
  background: var(--hc-border) !important;
  color: var(--hc-ink) !important;
}

.hc-calendar-card .fc-button-active,
.hc-calendar-card .fc-button-primary:not(:disabled):active {
  background: var(--hc-accent) !important;
  border-color: var(--hc-accent) !important;
  color: #fff !important;
}

.hc-calendar-card .fc-today-button {
  background: var(--hc-accent-soft) !important;
  border-color: transparent !important;
  color: var(--hc-accent) !important;
}

.hc-calendar-card .fc-col-header-cell-cushion {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--hc-ink3) !important;
  text-decoration: none !important;
}

.hc-calendar-card .fc-daygrid-day-number {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--hc-ink2) !important;
  text-decoration: none !important;
  padding: 6px 8px !important;
}

.hc-calendar-card .fc-day-today .fc-daygrid-day-number {
  background: var(--hc-accent) !important;
  color: #fff !important;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  margin: 4px;
  font-size: 0.78rem;
}

.hc-calendar-card .fc-day-today {
  background: var(--hc-accent-soft) !important;
}

.hc-calendar-card .fc-daygrid-event {
  border-radius: 5px !important;
  border: none !important;
  padding: 2px 6px !important;
  font-size: 0.72rem !important;
  font-weight: 500 !important;
  margin: 1px 2px !important;
}

.hc-calendar-card .fc-event-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hc-calendar-card .fc-scrollgrid,
.hc-calendar-card .fc-scrollgrid td,
.hc-calendar-card .fc-scrollgrid th {
  border-color: var(--hc-border) !important;
}

.hc-calendar-card .fc-more-link {
  color: var(--hc-accent) !important;
  font-size: 0.7rem;
}

.hc-calendar-card .fc-toolbar {
  gap: 8px;
  margin-bottom: 16px !important;
}

.hc-calendar-card .fc-toolbar-chunk {
  display: flex;
  gap: 6px;
  align-items: center;
}

.hc-calendar-card .fc-button-group {
  gap: 4px;
}

.hc-calendar-card .fc-button-group .fc-button {
  border-radius: 7px !important;
}

.hc-event-tooltip {
  position: fixed;
  background: var(--hc-surface);
  border: 1px solid var(--hc-border);
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: var(--hc-shadow);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s;
  max-width: 220px;
}

.hc-event-tooltip.show {
  opacity: 1;
  transform: translateY(0);
}

.hc-event-tooltip-name {
  font-size: 0.813rem;
  font-weight: 600;
  color: var(--hc-ink);
  margin-bottom: 4px;
}

.hc-event-tooltip-meta {
  font-size: 0.72rem;
  color: var(--hc-ink3);
  display: flex;
  gap: 8px;
}

.hc-monitor-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 1100px) {
  .hc-monitor-layout {
    grid-template-columns: 1fr;
  }
}

.hc-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .hc-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

.hc-stat-card {
  background: var(--hc-surface);
  border: 1px solid var(--hc-border);
  border-radius: var(--hc-r-lg);
  padding: 16px 18px;
  box-shadow: var(--hc-shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.hc-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--hc-stat-color, var(--hc-accent));
}

.hc-stat-card:hover {
  box-shadow: var(--hc-shadow);
  border-color: var(--hc-border2);
}

.hc-stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--hc-ink3);
  margin-bottom: 8px;
}

.hc-stat-value {
  font-size: 1.75rem;
  font-weight: 600;
  font-family: var(--hc-mono);
  letter-spacing: -0.03em;
  color: var(--hc-ink);
  line-height: 1;
  margin-bottom: 4px;
}

.hc-stat-sub {
  font-size: 0.72rem;
  color: var(--hc-ink3);
}

.hc-queue-card {
  background: var(--hc-surface);
  border: 1px solid var(--hc-border);
  border-radius: var(--hc-r-lg);
  overflow: hidden;
  box-shadow: var(--hc-shadow-sm);
}

.hc-queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--hc-border);
  gap: 12px;
  flex-wrap: wrap;
}

.hc-queue-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--hc-ink);
}

.hc-queue-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.hc-pill-group {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.hc-pill {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.15s;
  background: var(--hc-surface2);
  color: var(--hc-ink3);
}

.hc-pill:hover {
  color: var(--hc-ink);
  border-color: var(--hc-border2);
}

.hc-pill.active {
  background: var(--hc-accent-soft);
  color: var(--hc-accent);
  border-color: var(--hc-accent);
}

.hc-email-table {
  width: 100%;
  border-collapse: collapse;
}

.hc-email-table thead tr {
  background: var(--hc-surface2);
}

.hc-email-table th {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--hc-ink3);
  padding: 9px 14px;
  text-align: left;
  border-bottom: 1px solid var(--hc-border);
  white-space: nowrap;
}

.hc-email-table td {
  padding: 11px 14px;
  font-size: 0.8rem;
  color: var(--hc-ink2);
  border-bottom: 1px solid var(--hc-border);
  vertical-align: middle;
}

.hc-email-table tbody tr {
  transition: background 0.12s;
}

.hc-email-table tbody tr:hover {
  background: var(--hc-surface2);
}

.hc-email-table tbody tr:last-child td {
  border-bottom: none;
}

.hc-email-name {
  font-weight: 500;
  color: var(--hc-ink);
  font-size: 0.813rem;
  margin-bottom: 2px;
}

.hc-email-addr {
  font-family: var(--hc-mono);
  font-size: 0.7rem;
  color: var(--hc-ink3);
}

.hc-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.hc-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.hc-status.pending {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

.hc-status.sent {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

.hc-status.failed {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.hc-status.scheduled {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

.hc-status.pending .hc-status-dot {
  background: #d97706;
}

.hc-status.sent .hc-status-dot {
  background: #16a34a;
}

.hc-status.failed .hc-status-dot {
  background: #dc2626;
}

.hc-status.scheduled .hc-status-dot {
  background: #2563eb;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
  animation: hcPulse 2s infinite;
}

@keyframes hcPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
  }

  50% {
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0);
  }
}

.hc-days-chip {
  font-family: var(--hc-mono);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--hc-surface2);
  color: var(--hc-ink3);
  border: 1px solid var(--hc-border);
  white-space: nowrap;
}

.hc-days-chip.urgent {
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.2);
}

.hc-days-chip.soon {
  background: rgba(245, 158, 11, 0.08);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.2);
}

.hc-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1.5px solid var(--hc-border);
  background: var(--hc-surface);
  color: var(--hc-ink2);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.hc-action-btn:hover {
  border-color: var(--hc-accent);
  color: var(--hc-accent);
  background: var(--hc-accent-soft);
}

.hc-action-btn.primary {
  background: var(--hc-accent);
  border-color: var(--hc-accent);
  color: #fff;
}

.hc-action-btn.primary:hover {
  opacity: 0.9;
  color: #fff;
}

.hc-config-card {
  background: var(--hc-surface);
  border: 1px solid var(--hc-border);
  border-radius: var(--hc-r-lg);
  overflow: hidden;
  box-shadow: var(--hc-shadow-sm);
  position: sticky;
  top: 80px;
}

.hc-config-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--hc-border);
  background: var(--hc-surface2);
}

.hc-config-title {
  font-size: 0.813rem;
  font-weight: 600;
  color: var(--hc-ink);
}

.hc-config-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hc-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hc-field-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--hc-ink3);
}

.hc-field-input {
  background: var(--hc-surface2);
  border: 1px solid var(--hc-border);
  border-radius: 8px;
  padding: 8px 11px;
  font-family: var(--hc-font);
  font-size: 0.813rem;
  color: var(--hc-ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

.hc-field-input:focus {
  border-color: var(--hc-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.hc-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--hc-border);
}

.hc-toggle-row:last-of-type {
  border-bottom: none;
}

.hc-toggle-info {
  flex: 1;
}

.hc-toggle-name {
  font-size: 0.813rem;
  font-weight: 500;
  color: var(--hc-ink);
}

.hc-toggle-desc {
  font-size: 0.7rem;
  color: var(--hc-ink3);
  margin-top: 2px;
}

.hc-switch {
  position: relative;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

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

.hc-switch-track {
  position: absolute;
  inset: 0;
  background: var(--hc-border2);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.hc-switch input:checked + .hc-switch-track {
  background: var(--hc-accent);
}

.hc-switch-track::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.hc-switch input:checked + .hc-switch-track::after {
  transform: translateX(16px);
}

.hc-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hc-tl-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  position: relative;
}

.hc-tl-item::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 26px;
  bottom: -10px;
  width: 1px;
  background: var(--hc-border);
}

.hc-tl-item:last-child::after {
  display: none;
}

.hc-tl-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid var(--hc-border2);
  background: var(--hc-surface);
  flex-shrink: 0;
  margin-top: 2px;
  z-index: 1;
}

.hc-tl-dot.done {
  background: #22c55e;
  border-color: #22c55e;
}

.hc-tl-dot.fail {
  background: #ef4444;
  border-color: #ef4444;
}

.hc-tl-dot.next {
  background: var(--hc-accent);
  border-color: var(--hc-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.hc-tl-content {
  flex: 1;
  min-width: 0;
}

.hc-tl-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--hc-ink);
}

.hc-tl-time {
  font-size: 0.68rem;
  font-family: var(--hc-mono);
  color: var(--hc-ink3);
  margin-top: 2px;
}

.hc-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--hc-ink3);
}

.hc-empty-icon {
  font-size: 2rem;
  margin-bottom: 10px;
  opacity: 0.4;
}

.hc-empty-text {
  font-size: 0.875rem;
}

@media (max-width: 768px) {
  .hc-queue-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .hc-email-table td:nth-child(4),
  .hc-email-table th:nth-child(4) {
    display: none;
  }
}
