/* ── Components: Modals, Tables, Notifications & Tabs ─────────────────── */

/* ── Modals ────────────────────────────────────────────────────────────── */
.lk-modal .modal-content {
  border: 1px solid var(--lk-border);
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: var(--lk-shadow);
  background: var(--lk-surface-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.lk-modal-icon {
  width: 2.75rem;
  height: 2.75rem;
  min-width: 2.75rem;
  background: var(--lk-accent-soft);
  border: 1px solid var(--lk-accent-border);
  border-radius: 0.75rem;
  color: var(--lk-accent-strong);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lk-settings-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lk-settings-item {
  background: var(--lk-surface);
  border: 1px solid var(--lk-border);
  border-radius: 0.85rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.lk-settings-item:hover {
  background: color-mix(in srgb, var(--lk-surface) 88%, var(--lk-accent-soft));
  border-color: var(--lk-accent-border);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(13, 110, 253, 0.1);
}

.lk-settings-item__icon {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.6rem;
  background: var(--lk-accent-soft);
  color: var(--lk-accent-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease;
}

.lk-settings-item:hover .lk-settings-item__icon {
  transform: scale(1.08);
  background: var(--lk-accent);
  color: #ffffff;
}

.lk-settings-item__title {
  color: var(--lk-title-color);
  font-size: 0.98rem;
}

.lk-settings-item__chevron {
  color: var(--lk-muted);
  transition: transform 0.25s ease, color 0.25s ease;
}

.lk-modal-icon--success {
  background: rgba(25, 135, 84, 0.12) !important;
  border-color: rgba(25, 135, 84, 0.28) !important;
  color: #198754 !important;
}

[data-bs-theme="dark"] .lk-modal-icon--success {
  background: rgba(25, 135, 84, 0.22) !important;
  border-color: rgba(25, 135, 84, 0.38) !important;
  color: #75b798 !important;
}

/* Payment Option Cards in Modal */
.lk-payment-option {
  background: var(--lk-surface);
  border: 1px solid var(--lk-border);
  border-radius: 0.9rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
  color: var(--lk-title-color) !important;
}

.lk-payment-option:hover,
.lk-payment-option:focus,
.lk-payment-option:focus-visible {
  background: color-mix(in srgb, var(--lk-surface) 88%, rgba(25, 135, 84, 0.12));
  border-color: rgba(25, 135, 84, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(25, 135, 84, 0.12);
  color: var(--lk-title-color) !important;
  outline: none;
}

.lk-payment-option:active {
  background: color-mix(in srgb, var(--lk-surface) 75%, rgba(25, 135, 84, 0.25)) !important;
  border-color: rgba(25, 135, 84, 0.5) !important;
  transform: scale(0.98);
}

[data-bs-theme="dark"] .lk-payment-option {
  background: var(--lk-surface-strong);
  border-color: var(--lk-border);
  color: var(--lk-title-color) !important;
}

[data-bs-theme="dark"] .lk-payment-option:hover,
[data-bs-theme="dark"] .lk-payment-option:focus,
[data-bs-theme="dark"] .lk-payment-option:focus-visible {
  background: rgba(25, 135, 84, 0.22) !important;
  border-color: rgba(25, 135, 84, 0.48) !important;
  color: #ffffff !important;
}

[data-bs-theme="dark"] .lk-payment-option:active {
  background: rgba(25, 135, 84, 0.35) !important;
  border-color: rgba(25, 135, 84, 0.65) !important;
  color: #ffffff !important;
}

.lk-payment-option__icon {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 0.6rem;
  background: rgba(25, 135, 84, 0.12);
  color: #198754;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

.lk-payment-option:hover .lk-payment-option__icon,
.lk-payment-option:focus .lk-payment-option__icon {
  transform: scale(1.08);
  background: #198754;
  color: #ffffff;
}

.lk-payment-option__title {
  color: var(--lk-title-color);
  font-size: 0.98rem;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal;
}

.lk-payment-option__address {
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal;
  line-height: 1.35;
}

.lk-payment-option__badge {
  font-size: 0.78rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-weight: 700;
}

.lk-payment-option__badge--pos {
  background: rgba(25, 135, 84, 0.12);
  color: #198754;
  border: 1px solid rgba(25, 135, 84, 0.28);
}

.lk-payment-option__badge--neg {
  background: rgba(220, 53, 69, 0.12);
  color: #dc3545;
  border: 1px solid rgba(220, 53, 69, 0.28);
}

.lk-payment-option__arrow {
  color: var(--lk-muted);
  transition: transform 0.25s ease, color 0.25s ease;
}

.lk-payment-option:hover .lk-payment-option__arrow {
  color: #198754;
  transform: translateX(4px);
}

.lk-support-modal .modal-content {
  border: 0;
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: var(--lk-shadow);
  background: var(--lk-surface-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.lk-support-modal .modal-header {
  background: linear-gradient(135deg, var(--lk-accent-soft), transparent);
  border-bottom: 1px solid var(--lk-border);
  padding: 1.5rem 1.5rem 0.85rem;
}

.lk-support-modal-icon {
  width: 2.75rem;
  height: 2.75rem;
  min-width: 2.75rem;
  background: var(--lk-accent-soft);
  border: 1px solid var(--lk-accent-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lk-support-modal-icon span {
  font-size: 1.3rem;
  line-height: 1;
}

.lk-support-modal .modal-title {
  color: var(--lk-title-color);
  font-weight: 700;
}

.lk-support-modal-subtitle,
.lk-support-modal-hint {
  color: var(--lk-muted);
}

.lk-support-modal .modal-body {
  padding: 1rem 1.5rem 0.5rem;
}

.lk-support-modal .modal-footer {
  border-top: 1px solid var(--lk-border);
  padding: 0.75rem 1.5rem 1.5rem;
  gap: 0.5rem;
}

.lk-support-success__icon {
  font-size: 2.5rem;
  line-height: 1;
}

/* ── History Tables ────────────────────────────────────────────────────── */
.lk-history-table-wrap {
  border: 1px solid var(--lk-border);
  border-radius: 0.8rem;
  background: color-mix(in srgb, var(--lk-surface) 86%, transparent);
  overflow: hidden;
}

.lk-history-nav {
  gap: 0.5rem;
}

.lk-history-nav .nav-item {
  flex-shrink: 0;
}

.lk-history-nav .nav-link {
  border: 1px solid var(--lk-border);
  border-radius: 999px;
  color: var(--lk-muted);
  background: color-mix(in srgb, var(--lk-surface) 90%, transparent);
  padding: 0.5rem 0.9rem;
  transition: all 0.2s ease;
}

.lk-history-nav .nav-link.active {
  color: var(--lk-title-color);
  background: var(--lk-accent-soft);
  border-color: var(--lk-accent-border);
}

.lk-history-filter-label {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--lk-border);
  border-radius: 999px;
  padding: 0.28rem 0.58rem;
  background: color-mix(in srgb, var(--lk-surface) 92%, transparent);
  color: var(--lk-muted) !important;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.lk-history-table thead th {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--lk-muted);
  border-bottom-color: var(--lk-border);
}

.lk-history-table td,
.lk-history-table th {
  border-color: var(--lk-border);
  padding: 0.7rem 0.85rem;
}

.lk-history-table tbody td {
  color: var(--lk-title-color);
}

.lk-active-session-row td {
  background-color: var(--lk-active-session-bg) !important;
}

/* ── Unified Alert System (Errors, Rate Limits, Warnings & Notifications) ── */
.alert,
.lk-alert {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.15rem;
  border-radius: 1rem;
  font-size: 0.92rem;
  line-height: 1.45;
  font-weight: 500;
  border: 1px solid transparent;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  margin-bottom: 1.25rem;
  color: var(--lk-title-color);
}

.lk-alert__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 0.55rem;
  flex-shrink: 0;
}

.lk-alert__content {
  flex: 1;
}

/* Danger / Error Alert (Invalid Login, Password Errors, System Errors) */
.alert-danger,
.lk-alert--danger {
  background: rgba(220, 53, 69, 0.08) !important;
  border-color: rgba(220, 53, 69, 0.28) !important;
  color: #a71d2a !important;
}

.alert-danger .lk-alert__icon,
.lk-alert--danger .lk-alert__icon {
  background: rgba(220, 53, 69, 0.14);
  color: #dc3545;
}

[data-bs-theme="dark"] .alert-danger,
[data-bs-theme="dark"] .lk-alert--danger {
  background: rgba(220, 53, 69, 0.18) !important;
  border-color: rgba(248, 113, 113, 0.35) !important;
  color: #fca5a5 !important;
}

[data-bs-theme="dark"] .alert-danger .lk-alert__icon,
[data-bs-theme="dark"] .lk-alert--danger .lk-alert__icon {
  background: rgba(239, 68, 68, 0.25);
  color: #f87171;
}

/* Warning / Lockout Alert (Rate Limit, Remaining Attempts, Locks) */
.alert-warning,
.lk-alert--warning {
  background: rgba(255, 193, 7, 0.12) !important;
  border-color: rgba(255, 193, 7, 0.35) !important;
  color: #855304 !important;
}

.alert-warning .lk-alert__icon,
.lk-alert--warning .lk-alert__icon {
  background: rgba(255, 193, 7, 0.22);
  color: #d97706;
}

[data-bs-theme="dark"] .alert-warning,
[data-bs-theme="dark"] .lk-alert--warning {
  background: rgba(245, 158, 11, 0.18) !important;
  border-color: rgba(251, 191, 36, 0.38) !important;
  color: #fde047 !important;
}

[data-bs-theme="dark"] .alert-warning .lk-alert__icon,
[data-bs-theme="dark"] .lk-alert--warning .lk-alert__icon {
  background: rgba(245, 158, 11, 0.28);
  color: #fbbf24;
}

/* Success Alert (Updated Password, Success Submissions) */
.alert-success,
.lk-alert--success {
  background: rgba(25, 135, 84, 0.08) !important;
  border-color: rgba(25, 135, 84, 0.28) !important;
  color: #0d5231 !important;
}

.alert-success .lk-alert__icon,
.lk-alert--success .lk-alert__icon {
  background: rgba(25, 135, 84, 0.16);
  color: #198754;
}

[data-bs-theme="dark"] .alert-success,
[data-bs-theme="dark"] .lk-alert--success {
  background: rgba(25, 135, 84, 0.18) !important;
  border-color: rgba(74, 222, 128, 0.35) !important;
  color: #86efac !important;
}

[data-bs-theme="dark"] .alert-success .lk-alert__icon,
[data-bs-theme="dark"] .lk-alert--success .lk-alert__icon {
  background: rgba(34, 197, 94, 0.25);
  color: #4ade80;
}

/* Info Alert (Hints & System Notes) */
.alert-info,
.lk-alert--info {
  background: rgba(13, 110, 253, 0.08) !important;
  border-color: rgba(13, 110, 253, 0.25) !important;
  color: #084298 !important;
}

.alert-info .lk-alert__icon,
.lk-alert--info .lk-alert__icon {
  background: rgba(13, 110, 253, 0.14);
  color: #0d6efd;
}

[data-bs-theme="dark"] .alert-info,
[data-bs-theme="dark"] .lk-alert--info {
  background: rgba(13, 110, 253, 0.18) !important;
  border-color: rgba(110, 168, 254, 0.35) !important;
  color: #93c5fd !important;
}

[data-bs-theme="dark"] .alert-info .lk-alert__icon,
[data-bs-theme="dark"] .lk-alert--info .lk-alert__icon {
  background: rgba(59, 130, 246, 0.25);
  color: #6ea8fe;
}

.lk-history-table td::before {
  content: none;
}

/* Mobile display of history tables */
@media (max-width: 767.98px) {
  .lk-history-table td,
  .lk-history-table th {
    padding: 0.6rem 0.65rem;
    font-size: 0.88rem;
  }

  .lk-history-table-wrap {
    overflow: hidden;
  }

  .lk-history-table,
  .lk-history-table thead,
  .lk-history-table tbody,
  .lk-history-table tr,
  .lk-history-table th,
  .lk-history-table td {
    display: block;
    width: 100%;
  }

  .lk-history-table thead {
    display: none;
  }

  .lk-history-table tbody {
    display: grid;
    gap: 0.75rem;
    padding: 0.75rem;
  }

  .lk-history-table tbody tr {
    border: 1px solid var(--lk-border);
    border-radius: 0.75rem;
    padding: 0.6rem 0.85rem;
    background: color-mix(in srgb, var(--lk-surface) 94%, transparent);
    overflow: hidden;
  }

  .lk-history-table tbody td {
    display: grid;
    grid-template-columns: minmax(5.5rem, 32%) minmax(0, 1fr);
    gap: 0.4rem;
    align-items: start;
    border: 0;
    padding: 0.45rem 0;
    text-align: left !important;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-size: 0.9rem;
  }

  .lk-history-table tbody td + td {
    border-top: 1px solid var(--lk-border);
  }

  .lk-history-table td::before {
    content: attr(data-label);
    display: block;
    color: var(--lk-muted);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }
}

@media (max-width: 575.98px) {
  .lk-history-nav .nav-link {
    font-size: 0.9rem;
    padding: 0.55rem 0.9rem;
  }

  .lk-history-filter-label {
    font-size: 0.74rem;
    padding: 0.24rem 0.48rem;
  }
}

/* ── Notifications & Channel Cards ─────────────────────────────────────── */
.lk-channel-card {
  min-width: 140px;
  max-width: 180px;
  background: var(--lk-surface, #f8f9fa) !important;
  color: var(--lk-text, #222) !important;
  border: 1px solid var(--lk-border);
  border-radius: 0.75rem;
}

[data-bs-theme="dark"] .lk-channel-card {
  background: #23272b !important;
  color: #fff !important;
  border: 1px solid #444 !important;
}

.notif-tab-pane {
  display: none;
}

.notif-tab-pane--active {
  display: block;
}

.lk-notice-list {
  display: grid;
  gap: 0.75rem;
}

.lk-notice-item {
  border: 1px solid var(--lk-border);
  border-radius: 0.8rem;
  padding: 0.85rem 1rem;
  background: color-mix(in srgb, var(--lk-surface) 88%, transparent);
}

.lk-empty-state {
  background: color-mix(in srgb, var(--lk-surface) 86%, transparent);
  border-color: var(--lk-border) !important;
  color: var(--lk-muted);
  border-radius: 1.25rem;
}

/* ── Tabs & Placeholders ───────────────────────────────────────────────── */
.tab-content > .tab-pane {
  display: block;
  margin: 0 !important;
  padding: 0 !important;
  position: static;
}

.tab-content > .tab-pane:not(.active) {
  display: none !important;
}

.lk-glass .tab-content {
  min-height: 200px;
}

.lk-glass .tab-pane {
  opacity: 1;
  transition: opacity 0.15s ease-in-out;
}

.lk-glass .tab-pane.fade:not(.show) {
  opacity: 0;
}

[data-sessions-table],
[data-payments-table],
[data-notifications-pane] > div:not(.d-flex) {
  min-height: 150px;
}

@media (max-width: 575.98px) {
  .lk-modal .modal-dialog {
    margin: 0.5rem auto;
    max-width: calc(100vw - 1rem);
  }

  .lk-payment-option {
    padding: 0.65rem 0.75rem !important;
    gap: 0.5rem !important;
  }

  .lk-payment-option__title {
    font-size: 0.88rem !important;
  }

  .lk-payment-option__badge {
    font-size: 0.72rem !important;
    padding: 0.2rem 0.5rem !important;
  }

  .lk-glass .tab-content {
    min-height: 280px;
  }

  [data-sessions-placeholder],
  [data-payments-placeholder] {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
