/* CraftedTrust Shared Components */

/* Skeleton loading */
.ct-skeleton {
  background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
  background-size: 200% 100%;
  animation: ct-shimmer 1.5s infinite;
  border-radius: 0.5rem;
}
.ct-skeleton--text { height: 1rem; width: 60%; margin-bottom: 0.5rem; }
.ct-skeleton--title { height: 1.5rem; width: 40%; margin-bottom: 0.75rem; }
.ct-skeleton--card { height: 120px; border-radius: 1rem; }
.ct-skeleton--stat { height: 80px; border-radius: 0.75rem; }
@keyframes ct-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Empty state */
.ct-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: #64748b;
}
.ct-empty__icon {
  width: 56px; height: 56px;
  margin: 0 auto 1rem;
  opacity: 0.3;
}
.ct-empty__title {
  font-size: 1rem; font-weight: 600;
  color: #94a3b8;
  margin-bottom: 0.375rem;
}
.ct-empty__desc {
  font-size: 0.875rem;
  max-width: 320px;
  margin: 0 auto 1.25rem;
  line-height: 1.6;
}
.ct-empty__action {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  background: #1ABC9C; color: #0f172a;
  border: none; border-radius: 0.625rem;
  font-size: 0.875rem; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: all 150ms;
}
.ct-empty__action:hover { background: #48d1b0; box-shadow: 0 4px 20px rgba(26, 188, 156, 0.4); }

/* Error state */
.ct-error {
  text-align: center;
  padding: 2rem 1.5rem;
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: 0.75rem;
  color: #94a3b8;
}
.ct-error__title { color: #ef4444; font-weight: 600; margin-bottom: 0.375rem; }
.ct-error__retry {
  display: inline-flex; align-items: center; gap: 0.375rem;
  margin-top: 0.75rem; padding: 0.375rem 1rem;
  background: rgba(239, 68, 68, 0.1); color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2); border-radius: 0.5rem;
  font-size: 0.8125rem; font-weight: 600; cursor: pointer;
  transition: all 150ms;
}
.ct-error__retry:hover { background: rgba(239, 68, 68, 0.2); }

/* Offline banner */
.ct-offline {
  position: fixed; bottom: 0; left: 0; right: 0;
  padding: 0.625rem;
  background: #D35400;
  color: #fff;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  z-index: 9999;
  transform: translateY(100%);
  transition: transform 300ms ease;
}
.ct-offline.visible { transform: translateY(0); }

/* Confirmation modal */
.ct-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 10000;
  opacity: 0; pointer-events: none;
  transition: opacity 200ms;
}
.ct-modal-overlay.visible { opacity: 1; pointer-events: auto; }
.ct-modal {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 1.5rem;
  max-width: 400px; width: 90%;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}
.ct-modal__title { font-size: 1.125rem; font-weight: 700; color: #f1f5f9; margin-bottom: 0.5rem; }
.ct-modal__desc { font-size: 0.875rem; color: #94a3b8; margin-bottom: 1.25rem; line-height: 1.5; }
.ct-modal__actions { display: flex; gap: 0.75rem; justify-content: flex-end; }
.ct-modal__cancel {
  padding: 0.5rem 1rem; background: transparent;
  border: 1px solid rgba(255,255,255,0.1); border-radius: 0.5rem;
  color: #94a3b8; font-size: 0.8125rem; font-weight: 600; cursor: pointer;
}
.ct-modal__confirm {
  padding: 0.5rem 1rem; background: #ef4444;
  border: none; border-radius: 0.5rem;
  color: #fff; font-size: 0.8125rem; font-weight: 600; cursor: pointer;
}

/* Focus-visible (keyboard only, no mouse) */
*:focus-visible {
  outline: 2px solid #1ABC9C;
  outline-offset: 2px;
}
*:focus:not(:focus-visible) {
  outline: none;
}

/* Skip to content */
.ct-skip-link {
  position: absolute;
  left: -9999px; top: 0;
  z-index: 99999;
  padding: 0.75rem 1.5rem;
  background: #1ABC9C;
  color: #0f172a;
  font-weight: 700;
  font-size: 0.875rem;
  text-decoration: none;
  border-radius: 0 0 0.5rem 0;
}
.ct-skip-link:focus { left: 0; }

/* Print styles */
@media print {
  .site-header, .site-footer, .ct-skip-link, .ct-offline,
  .ct-modal-overlay, .search-bar, .btn, button,
  .site-header__toggle, .ct-toasts {
    display: none !important;
  }
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 12pt;
  }
  .container, .main, main {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  a { color: #000 !important; text-decoration: underline; }
  .trust-badge, .cert-badge, .badge {
    border: 1px solid #000 !important;
    color: #000 !important;
    background: #fff !important;
  }
  .server-card, .stat-card, .action-card, .section {
    border: 1px solid #ccc !important;
    background: #fff !important;
    color: #000 !important;
    break-inside: avoid;
  }
}
