/*
 * Custom Flowbite datatable refinements
 */

.datatable-wrapper {
  background: transparent;
  border: none;
}

.datatable-container {
  border: none;
  padding: 0;
}

.datatable-top,
.datatable-bottom {
  display: none !important;
}

.datatable-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.datatable-table thead {
  background-color: #f9fafb;
  color: #111827;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.datatable-table th {
  font-weight: 600;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #edeff2;
}

.datatable-table td {
  padding: 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: #1f2937;
}

.datatable-table tr:hover td {
  background-color: #f9fafb;
}

.datatable-table .datatable-sorter {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: inherit;
  font: inherit;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.text-heading {
  color: #0f172a;
}

.text-body {
  color: #475467;
}

.bg-neutral-secondary-medium {
  background-color: #f5f7fa;
}

.border-default-medium {
  border-color: #e4e7ec;
}

.bg-brand {
  background-color: #111827;
}

.hover\:bg-brand-strong:hover {
  background-color: #0b1220;
}

.focus\:ring-brand-medium:focus {
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.25);
}

.focus\:ring-brand:focus {
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.35);
}

.focus\:border-brand:focus {
  border-color: #111827;
}

.api-credit-progress {
  appearance: none;
  display: block;
  width: 100%;
  height: 0.625rem;
  overflow: hidden;
  border: 0;
  border-radius: 9999px;
  background-color: #e5e7eb;
}

.api-credit-progress::-webkit-progress-bar {
  border-radius: 9999px;
  background-color: #e5e7eb;
}

.api-credit-progress::-webkit-progress-value {
  border-radius: 9999px;
  background-color: #dc2626;
  transition: width 0.2s ease;
}

.api-credit-progress::-moz-progress-bar {
  border-radius: 9999px;
  background-color: #dc2626;
}

.dark .api-credit-progress,
.dark .api-credit-progress::-webkit-progress-bar {
  background-color: #374151;
}

.dark .api-credit-progress::-webkit-progress-value,
.dark .api-credit-progress::-moz-progress-bar {
  background-color: #ef4444;
}

.dashboard-progress {
  display: block;
  width: 100%;
  height: 0.5rem;
  overflow: hidden;
  appearance: none;
  border: 0;
  border-radius: 9999px;
  background-color: #e5e7eb;
}

.dashboard-progress--thin {
  height: 0.375rem;
  margin-top: 0.5rem;
}

.dashboard-progress::-webkit-progress-bar {
  border-radius: 9999px;
  background-color: #e5e7eb;
}

.dashboard-progress::-webkit-progress-value {
  border-radius: 9999px;
  transition: width 0.2s ease;
}

.dashboard-progress::-moz-progress-bar {
  border-radius: 9999px;
}

.dashboard-progress--healthy::-webkit-progress-value,
.dashboard-progress--language::-webkit-progress-value {
  background-color: #00ff88;
}

.dashboard-progress--healthy::-moz-progress-bar,
.dashboard-progress--language::-moz-progress-bar {
  background-color: #00ff88;
}

.dashboard-progress--warning::-webkit-progress-value {
  background-color: #eab308;
}

.dashboard-progress--warning::-moz-progress-bar {
  background-color: #eab308;
}

.dashboard-progress--danger::-webkit-progress-value {
  background-color: #dc2626;
}

.dashboard-progress--danger::-moz-progress-bar {
  background-color: #dc2626;
}

.dark .dashboard-progress,
.dark .dashboard-progress::-webkit-progress-bar {
  background-color: #374151;
}

.dashboard-chart-progress {
  display: block;
  width: 100%;
  height: 10rem;
  appearance: none;
  border: 0;
  border-radius: 0.25rem 0.25rem 0 0;
  background-color: transparent;
  transform: rotate(180deg);
  writing-mode: vertical-lr;
}

.dashboard-chart-progress::-webkit-progress-bar {
  border-radius: 0.25rem 0.25rem 0 0;
  background-color: transparent;
}

.dashboard-chart-progress::-webkit-progress-value {
  border-radius: 0.25rem 0.25rem 0 0;
  background-color: #00ff88;
  transition: height 0.2s ease;
}

.dashboard-chart-progress:hover::-webkit-progress-value {
  background-color: #00e07a;
}

.dashboard-chart-progress::-moz-progress-bar {
  border-radius: 0.25rem 0.25rem 0 0;
  background-color: #00ff88;
}

.org-logo-fallback {
  background-color: #f97316;
}

dialog[data-modal-frame-id] {
  width: 100%;
  height: 100%;
  padding: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  background: transparent;
}

dialog[data-modal-frame-id].modal-dialog-hidden {
  display: none;
}

dialog[data-modal-frame-id]::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
}

.modal-scroll-locked {
  overflow: hidden;
}

.dismissible--closing {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.notification--entering,
.notification--leaving {
  opacity: 0;
  transform: translateX(100%);
}

.notification--entering,
.notification--leaving,
[data-controller~="notification"] {
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.metrics-card-row {
  gap: 2rem;
}

.modal-backdrop-blur {
  backdrop-filter: blur(2px);
}

.customer-modal {
  display: none;
  transition: opacity 0.15s ease-in;
}

.customer-modal__panel {
  border-radius: 8px 0 0 8px;
}

.customer-modal__body {
  padding-bottom: 2rem;
}

.email-preview-frame {
  max-height: 600px;
  overflow-y: auto;
}

.phone-input-country {
  width: 180px;
  flex-shrink: 0;
}

.phone-input-number {
  flex: 1;
}

.customer-phone-country {
  width: 160px;
  flex-shrink: 0;
}

.width-full {
  width: 100%;
}

.height-fit-content {
  height: fit-content;
}

.font-unbounded {
  font-family: "Unbounded", sans-serif;
}

.min-height-email-preview {
  min-height: 400px;
}

.email-preview-shell {
  max-width: 600px;
  padding: 20px;
  margin: 0 auto;
  font-family: Arial, sans-serif;
  background-color: #f9fafb;
}

.email-preview-panel {
  padding: 20px;
  margin-bottom: 15px;
  background-color: #ffffff;
  border-radius: 8px;
}

.email-preview-header {
  margin-bottom: 30px;
}

.email-preview-header--center {
  text-align: center;
}

.email-preview-header--left {
  text-align: left;
}

.email-preview-logo {
  max-width: 200px;
  max-height: 100px;
  height: auto;
}

.email-preview-logo-placeholder {
  display: inline-block;
  width: 200px;
  height: 60px;
  font-size: 12px;
  line-height: 60px;
  color: #6b7280;
  background-color: #e5e7eb;
  border-radius: 4px;
}

.email-preview-content {
  line-height: 1.6;
  color: #333333;
  white-space: pre-wrap;
}

.email-preview-content--spaced,
.email-preview-block {
  margin: 15px 0;
}

.email-preview-button {
  display: inline-block;
  padding: 12px 24px;
  font-weight: 600;
  color: #ffffff;
  text-decoration: none;
  background-color: #111827;
  border-radius: 6px;
}

.email-preview-button--disabled {
  color: #6b7280;
  background-color: #d1d5db;
}

.email-preview-link {
  color: #3b82f6;
  text-decoration: underline;
}

.email-preview-link--plain {
  text-decoration: none;
}

.email-preview-muted {
  color: #9ca3af;
}

.email-preview-image {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.email-preview-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 200px;
  font-size: 12px;
  color: #6b7280;
  background-color: #e5e7eb;
  border-radius: 4px;
}

.email-preview-footer {
  padding: 20px;
  padding-top: 20px;
  margin-top: 30px;
  font-size: 12px;
  color: #6b7280;
  text-align: center;
  background-color: #ffffff;
  border-top: 1px solid #e5e7eb;
  border-radius: 8px;
}

.email-preview-company {
  margin-bottom: 10px;
  font-weight: bold;
  color: #111827;
}

.email-preview-contact {
  margin-bottom: 15px;
}

.email-preview-social {
  margin-top: 15px;
}

.email-preview-social-link {
  margin: 0 10px;
}

.cal-embed-frame {
  width: 100%;
  height: 100%;
  overflow: scroll;
}

.animation-delay-0 {
  animation-delay: 0ms;
}

.animation-delay-150 {
  animation-delay: 150ms;
}

.animation-delay-300 {
  animation-delay: 300ms;
}

[data-controller="help-chat"] .chat-open .chat-icon {
  display: none;
}

[data-controller="help-chat"] .chat-open .close-icon {
  display: block;
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

.animate-slide-up {
  animation: slide-up 0.2s ease-out forwards;
}

[data-help-chat-target="messages"]::-webkit-scrollbar {
  width: 6px;
}

[data-help-chat-target="messages"]::-webkit-scrollbar-track {
  background: transparent;
}

[data-help-chat-target="messages"]::-webkit-scrollbar-thumb {
  background-color: rgba(156, 163, 175, 0.5);
  border-radius: 3px;
}

[data-help-chat-target="messages"]::-webkit-scrollbar-thumb:hover {
  background-color: rgba(156, 163, 175, 0.7);
}

[data-help-chat-target="messages"] table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  white-space: nowrap;
  font-size: 0.75rem;
  border-collapse: collapse;
}

[data-help-chat-target="messages"] table th,
[data-help-chat-target="messages"] table td {
  max-width: 150px;
  padding: 0.25rem 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid rgba(156, 163, 175, 0.3);
}

[data-help-chat-target="messages"] table th {
  font-weight: 600;
  background-color: rgba(156, 163, 175, 0.1);
}

[data-help-chat-target="messages"] .prose {
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

[data-help-chat-target="messages"] .prose pre {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

@keyframes bounce {
  0%, 60%, 100% {
    transform: translateY(0);
  }

  30% {
    transform: translateY(-4px);
  }
}

.rounded-base {
  border-radius: 0.625rem;
}

.shadow-xs {
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.customer-modal__panel {
  border-radius: 12px;
  max-height: calc(100vh - 3rem);
  overflow: hidden;
}

@media (max-width: 640px) {
  .customer-modal__panel {
    max-height: calc(100vh - 1.5rem);
  }
}

/* 
 * Global Loading Indicators 
 * Ensures every navigation, frame load, or slow action shows immediate visual feedback
 */

/* 1. Make the top progress bar thick, green, and instantly visible for full page navigations */
.turbo-progress-bar {
  height: 4px;
  background-color: #00ff88; /* Matches the vibrant Kallglot brand green */
  box-shadow: 0 0 10px #00ff88, 0 0 5px #00ff88;
  z-index: 9999;
}

/* 2. For partial page loads (Turbo Frames), gracefully fade them and add a pulsing effect */
turbo-frame[busy] {
  opacity: 0.5;
  pointer-events: none;
  cursor: wait;
  transition: opacity 0.2s ease-in-out;
  animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Base pulse animation for Tailwind compatibility */
@keyframes pulse {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 0.3;
  }
}

/* 
 * Kallglot Premium Design System
 */

:root {
  --color-brand-green: #00ff88;
  --color-paper-100: #ffffff;
  --color-paper-200: #f5f7fa;
  --color-neutral-850: #0f172a;
}

.text-display-1 {
  font-family: "Unbounded", sans-serif;
  font-size: 3.5rem;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.text-display-2 {
  font-family: "Unbounded", sans-serif;
  font-size: 2.5rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.text-label-premium {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #00ff88;
}

.premium-card {
  background: white;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark .premium-card {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
}

.premium-card:hover {
  box-shadow: 0 20px 40px rgba(0, 255, 136, 0.08), 0 0 1px rgba(0, 255, 136, 0.2);
  transform: translateY(-4px);
}

.section-spacing {
  padding-top: 5rem;
  padding-bottom: 5rem;
}

@media (max-width: 768px) {
  .text-display-1 { font-size: 2.5rem; }
  .text-display-2 { font-size: 1.875rem; }
}
