/* kalender-skeleton.css — Loading skeleton + empty state */
/* Auto-split from kalender.css + kalender-ai.css — 205 lines */

/* ════════════════════════════════════════════════════════════
   LOADING SKELETON OVERLAY
   ════════════════════════════════════════════════════════════ */

.cal-loading-overlay {
  position: absolute;
  inset: 0;
  background: var(--color-card);
  z-index: 10;
  border-radius: var(--radius-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.cal-loading-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ── Skeleton layout ── */

.cal-skeleton {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 16px 20px;
  gap: 16px;
}

.cal-skeleton-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
}

.cal-skeleton-pill {
  border-radius: 6px;
  background: linear-gradient(90deg,
    rgba(0,0,0,0.06) 25%,
    rgba(0,0,0,0.10) 50%,
    rgba(0,0,0,0.06) 75%
  );
  background-size: 200% 100%;
  height: 14px;
}

/* Only animate when overlay is visible — stops GPU work when hidden */
.cal-loading-overlay.active .cal-skeleton-pill {
  animation: cal-skeleton-shimmer 1.4s ease infinite;
}

@keyframes cal-skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.cal-skeleton-grid {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cal-skeleton-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 8px 0 10px;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
}

.cal-skeleton-header .cal-skeleton-pill {
  justify-self: center;
}

.cal-skeleton-rows {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.cal-skeleton-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  flex: 1;
  gap: 0;
}

.cal-skeleton-cell {
  border-right: 0.5px solid rgba(0, 0, 0, 0.08);
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
  padding: 6px 4px;
  min-height: 0;
}

.cal-skeleton-cell:nth-child(7) {
  border-right: none;
}

.cal-skeleton-row:last-child .cal-skeleton-cell {
  border-bottom: none;
}

.cal-skeleton-event {
  height: 8px;
  border-radius: 6px;
  margin-top: 4px;
  background-size: 200% 100%;
}

.cal-loading-overlay.active .cal-skeleton-event {
  animation: cal-skeleton-shimmer 1.4s ease infinite;
  animation-delay: calc(var(--i, 0) * 0.15s);
}

/* Stagger shimmer on event pills */
.cal-skeleton-row:nth-child(1) .cal-skeleton-event { --i: 0; }
.cal-skeleton-row:nth-child(2) .cal-skeleton-event { --i: 1; }
.cal-skeleton-row:nth-child(3) .cal-skeleton-event { --i: 2; }
.cal-skeleton-row:nth-child(4) .cal-skeleton-event { --i: 3; }
.cal-skeleton-row:nth-child(5) .cal-skeleton-event { --i: 4; }

/* ── Dark mode ── */

[data-theme="dark"] .cal-loading-overlay {
  background: var(--color-card);
}

[data-theme="dark"] .cal-skeleton-pill {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.06) 25%,
    rgba(255,255,255,0.10) 50%,
    rgba(255,255,255,0.06) 75%
  );
  background-size: 200% 100%;
}

[data-theme="dark"] .cal-skeleton-event {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.04) 75%
  );
  background-size: 200% 100%;
}

[data-theme="dark"] .cal-skeleton-cell {
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .cal-skeleton-toolbar,
[data-theme="dark"] .cal-skeleton-header {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

/* ════════════════════════════════════════════════════════════
   EMPTY STATE
   ════════════════════════════════════════════════════════════ */

.cal-empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 40px;
  text-align: center;
}

.cal-empty-state.active {
  opacity: 1;
  pointer-events: auto;
}

.cal-empty-icon {
  font-size: 44px;
  line-height: 1;
  opacity: 0.6;
}

.cal-empty-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
}

.cal-empty-text {
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
  max-width: 300px;
  margin: 0;
  line-height: 1.5;
}

.cal-empty-btn {
  margin-top: 8px;
  padding: 10px 24px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  background: var(--color-text-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md, 8px);
  cursor: pointer;
  font-family: var(--font-family);
  transition: background 0.15s ease, transform 0.1s ease;
}

.cal-empty-btn:hover {
  opacity: 0.9;
}

.cal-empty-btn:active {
  transform: scale(0.97);
}

[data-theme="dark"] .cal-empty-btn {
  background: var(--color-text-primary);
  color: #fff;
}


