/* ============================================
   iQSMM Premium Design System
   Clean, spacious, modern aesthetic
   Version: 1.0
   ============================================ */

/* ─── Light Theme Variable Overrides ─── */
:root {
  /* Rounder base radius: 12px (was 8px) */
  --radius: 0.75rem;

  /* Subtle off-white page background (was pure white) */
  --background: #f8f9fb;

  /* Softer, lighter border */
  --border: oklch(95.5% 0.003 264);

  /* Lighter muted for more airy feel */
  --muted: oklch(97.5% 0.002 264);

  /* Softer input border */
  --input: oklch(93% 0.003 264);

  /* Card stays white for contrast */
  --card: #ffffff;
}

/* ─── Dark Theme Variable Overrides ─── */
.dark {
  --background: oklch(13.5% 0.005 285);
  --card: oklch(16% 0.005 285);
  --border: oklch(28% 0.006 285);
  --muted: oklch(19% 0.005 285);
}


/* ═══════════════════════════════════════
   CARDS
   ═══════════════════════════════════════ */

.kt-card {
  border-radius: 16px !important;
  border-color: transparent !important;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 14px rgba(0, 0, 0, 0.03) !important;
}

.dark .kt-card {
  border-color: var(--border) !important;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.2),
    0 4px 14px rgba(0, 0, 0, 0.12) !important;
}

/* Card content — generous padding */
.kt-card-content {
  padding: calc(var(--spacing) * 6) !important;
}

/* Compact cards (small stat metrics, text-center cards) — preserve tighter padding */
.kt-card-content.p-4 {
  padding: calc(var(--spacing) * 4) !important;
}
.kt-card-content.p-3 {
  padding: calc(var(--spacing) * 3) !important;
}

/* Card header — more height and padding */
.kt-card-header {
  min-height: calc(var(--spacing) * 16) !important;
  padding-inline: calc(var(--spacing) * 6) !important;
}

/* Card footer — consistent padding */
.kt-card-footer {
  padding-inline: calc(var(--spacing) * 6) !important;
}


/* ═══════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════ */

.kt-btn {
  border-radius: 10px !important;
  padding-inline: calc(var(--spacing) * 4) !important;
  height: calc(var(--spacing) * 9) !important;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.kt-btn-lg {
  border-radius: 12px !important;
  padding-inline: calc(var(--spacing) * 5) !important;
  height: calc(var(--spacing) * 11) !important;
}

.kt-btn-sm {
  border-radius: 8px !important;
  height: calc(var(--spacing) * 7.5) !important;
}

/* Icon-only buttons */
.kt-btn.kt-btn-icon {
  border-radius: 10px !important;
  width: calc(var(--spacing) * 9) !important;
  height: calc(var(--spacing) * 9) !important;
  padding-inline: 0 !important;
}

.kt-btn-lg.kt-btn-icon {
  border-radius: 12px !important;
  width: calc(var(--spacing) * 11) !important;
  height: calc(var(--spacing) * 11) !important;
}


/* ═══════════════════════════════════════
   INPUTS
   ═══════════════════════════════════════ */

.kt-input {
  border-radius: 10px !important;
  height: calc(var(--spacing) * 10) !important;
  padding-inline: calc(var(--spacing) * 4) !important;
  font-size: 0.875rem !important;
}

.kt-input:focus-visible {
  border-color: var(--primary) !important;
  --tw-ring-color: color-mix(in oklab, var(--primary) 15%, transparent) !important;
}

.kt-input-lg {
  border-radius: 12px !important;
}


/* ═══════════════════════════════════════
   DROPDOWNS
   ═══════════════════════════════════════ */

.kt-dropdown-menu {
  border-radius: 12px !important;
  border-color: transparent !important;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.08),
    0 1px 3px rgba(0, 0, 0, 0.04) !important;
  padding: calc(var(--spacing) * 2.5) !important;
}

.dark .kt-dropdown-menu {
  border-color: var(--border) !important;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.3),
    0 1px 3px rgba(0, 0, 0, 0.2) !important;
}


/* ═══════════════════════════════════════
   MODALS
   ═══════════════════════════════════════ */

.kt-modal-content {
  border-radius: 20px !important;
  border-color: transparent !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12) !important;
}

.dark .kt-modal-content {
  border-color: var(--border) !important;
}


/* ═══════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════ */

header h1,
.kt-card-title {
  font-weight: 600;
  letter-spacing: -0.025em;
}


/* ═══════════════════════════════════════
   PAGE LAYOUT — MORE BREATHING ROOM
   ═══════════════════════════════════════ */

/* Main content area — generous padding */
main.grow {
  padding: calc(var(--spacing) * 7) !important;
}

/* Page header — more spacious, consistent bg */
header.border-b {
  background-color: var(--card) !important;
  padding-block: calc(var(--spacing) * 5) !important;
  padding-inline: calc(var(--spacing) * 7) !important;
}

/* Mobile — compact padding, preserve bottom nav space */
@media (max-width: 1023px) {
  main.grow {
    padding: 12px !important;
    padding-bottom: 80px !important;
  }
  header.border-b {
    padding-inline: 12px !important;
    padding-block: 10px !important;
  }
  /* Reduce card content padding on mobile */
  .kt-card-content {
    padding: 12px !important;
  }
  .kt-card-content.p-4 {
    padding: 12px !important;
  }
  .kt-card-content.p-3 {
    padding: 10px !important;
  }
  /* Card header compact */
  .kt-card-header {
    min-height: calc(var(--spacing) * 10) !important;
    padding-inline: 12px !important;
  }
}


/* ═══════════════════════════════════════
   SIDEBAR REFINEMENT
   ═══════════════════════════════════════ */

#sidebar {
  background-color: var(--card) !important;
  border-right: 1px solid var(--border);
  z-index: 10000 !important;
}

/* Sidebar menu links — softer hover/active */
#sidebar .kt-menu-link {
  transition: all 0.15s ease;
}

#sidebar .kt-menu-item-active .kt-menu-link {
  background-color: var(--background) !important;
  border-color: var(--border) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Sidebar dropdowns — premium shadow */
#profileDropdown,
#langDropdown {
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.08),
    0 1px 4px rgba(0, 0, 0, 0.04) !important;
  border-radius: 16px !important;
}

.dark #profileDropdown,
.dark #langDropdown {
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.3),
    0 1px 4px rgba(0, 0, 0, 0.2) !important;
}

/* bg-card utility — not in compiled Tailwind, define manually */
.bg-card {
  background-color: var(--card) !important;
}

/* Mobile bottom nav — softer */
nav.lg\:hidden {
  background-color: var(--card) !important;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.04) !important;
}

/* Mobile more dropdown */
#mobileMoreDropdown {
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.1),
    0 1px 4px rgba(0, 0, 0, 0.04) !important;
  border-radius: 16px !important;
}


/* ═══════════════════════════════════════
   TABLES — SOFTER LOOK
   ═══════════════════════════════════════ */

.kt-table th {
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.7rem;
}


/* ═══════════════════════════════════════
   CUSTOM SCROLLBARS — THIN & SUBTLE
   ═══════════════════════════════════════ */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: oklch(82% 0 0);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: oklch(70% 0 0);
}

.dark ::-webkit-scrollbar-thumb {
  background-color: oklch(32% 0 0);
}

.dark ::-webkit-scrollbar-thumb:hover {
  background-color: oklch(42% 0 0);
}


/* ═══════════════════════════════════════
   SKELETON LOADERS — SOFTER
   ═══════════════════════════════════════ */

.skeleton {
  background: linear-gradient(90deg, #f3f4f6 25%, #e9eaed 50%, #f3f4f6 75%) !important;
  border-radius: 8px;
}

.dark .skeleton {
  background: linear-gradient(90deg, #222 25%, #1a1a1a 50%, #222 75%) !important;
}


/* ═══════════════════════════════════════
   BADGES & PILLS — ROUNDER
   ═══════════════════════════════════════ */

.kt-badge {
  border-radius: 8px !important;
}


/* ═══════════════════════════════════════
   TRIAL RESTRICTIONS
   ═══════════════════════════════════════ */

/* Top banner */
.trial-top-banner {
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  color: #fff;
  padding: 10px 20px;
  margin-bottom: 16px;
  border-radius: 12px;
}

.trial-top-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.trial-upgrade-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  background: #fff;
  color: #d97706;
  font-weight: 600;
  font-size: 13px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.trial-upgrade-btn:hover {
  background: #fef3c7;
  transform: translateY(-1px);
}

.trial-banner-dismiss {
  background: rgba(255,255,255,0.2);
  border: none;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: background 0.2s;
}

.trial-banner-dismiss:hover {
  background: rgba(255,255,255,0.35);
}

/* Video blur overlay - grid cards */
.trial-blur-overlay {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.dark .trial-blur-overlay {
  background: rgba(0, 0, 0, 0.6);
}

.trial-blur-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
}

/* Overlay on table rows */
.trial-blur-overlay-row {
  border-radius: 0;
  gap: 8px;
}

/* View Plans button inside overlay */
.trial-view-plans-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  background: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.trial-view-plans-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Smaller button for table rows */
.trial-view-plans-btn-sm {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s;
}

.trial-view-plans-btn-sm:hover {
  transform: translateY(-1px);
}

/* Mobile responsive */
@media (max-width: 640px) {
  .trial-top-banner {
    padding: 8px 12px;
    margin-bottom: 12px;
    font-size: 13px;
  }
  .trial-top-banner-content {
    gap: 8px;
  }
  .trial-upgrade-btn {
    padding: 5px 12px;
    font-size: 12px;
  }
}


/* ═══════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════ */

.iqsmm-toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 420px;
  width: calc(100% - 32px);
  pointer-events: none;
}

.iqsmm-toast {
  pointer-events: auto;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.06);
  animation: iqsmm-toast-in 0.3s ease-out;
  background: var(--card, #fff);
  border: 1px solid var(--border, #e5e7eb);
  color: var(--foreground, #111);
}

.iqsmm-toast-out {
  animation: iqsmm-toast-out 0.25s ease-in forwards;
}

/* Type variants */
.iqsmm-toast-success {
  border-left: 4px solid #22c55e;
}
.iqsmm-toast-error {
  border-left: 4px solid #ef4444;
}
.iqsmm-toast-warning {
  border-left: 4px solid #f59e0b;
}
.iqsmm-toast-info {
  border-left: 4px solid #3b82f6;
}

.iqsmm-toast-body {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.iqsmm-toast-icon-wrap {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

.iqsmm-toast-icon {
  width: 20px;
  height: 20px;
}

.iqsmm-toast-success .iqsmm-toast-icon { color: #22c55e; }
.iqsmm-toast-error .iqsmm-toast-icon { color: #ef4444; }
.iqsmm-toast-warning .iqsmm-toast-icon { color: #f59e0b; }
.iqsmm-toast-info .iqsmm-toast-icon { color: #3b82f6; }

.iqsmm-toast-content {
  flex: 1;
  min-width: 0;
}

.iqsmm-toast-message {
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}

.iqsmm-toast-help {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted-foreground, #6b7280);
}

.iqsmm-toast-help a {
  color: #3b82f6;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.iqsmm-toast-help a:hover {
  color: #2563eb;
}

.iqsmm-toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: var(--muted-foreground, #9ca3af);
  cursor: pointer;
  padding: 0 0 0 8px;
  transition: color 0.15s;
}

.iqsmm-toast-close:hover {
  color: var(--foreground, #111);
}

@keyframes iqsmm-toast-in {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes iqsmm-toast-out {
  from { opacity: 1; transform: translateX(0); max-height: 200px; margin-bottom: 0; }
  to   { opacity: 0; transform: translateX(40px); max-height: 0; margin-bottom: -8px; padding: 0 16px; }
}

/* Dark mode */
.dark .iqsmm-toast {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35), 0 1px 4px rgba(0, 0, 0, 0.25);
}

.dark .iqsmm-toast-help a {
  color: #60a5fa;
}

.dark .iqsmm-toast-help a:hover {
  color: #93bbfd;
}

/* Mobile */
@media (max-width: 640px) {
  .iqsmm-toast-container {
    top: 8px;
    right: 8px;
    width: calc(100% - 16px);
    max-width: none;
  }
  .iqsmm-toast {
    padding: 12px 14px;
  }
}
