/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * App theme: "AI terminal" dark - shared design language with landing.css.
 * Bootstrap runs with data-bs-theme="dark"; rules here only layer the brand look on top.
 */

:root {
  /* nativní ovládací prvky (option popupy, scrollbary, date pickery) v tmavé */
  color-scheme: dark;
  --brand-accent: #20c997;
  --accent-indigo: #6366f1;
  --bg-deep: #0a0f1c;
  --bg-panel: #0e1626;
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.09);
  --text-dim: rgba(255, 255, 255, 0.6);
  --text-faint: rgba(255, 255, 255, 0.4);
  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, monospace;
}

body {
  min-height: 100vh;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  background:
    radial-gradient(circle at 10% -10%, rgba(32, 201, 151, 0.08), transparent 32rem),
    radial-gradient(circle at 90% 10%, rgba(99, 102, 241, 0.07), transparent 30rem),
    linear-gradient(180deg, var(--bg-deep) 0%, #0c1322 100%);
  color: #e2e8f0;
}

.app-shell h1,
.app-shell h2,
.app-shell h3 {
  font-family: var(--font-display);
  color: #fff;
}

/* ── Header / navigation ── */
.app-header {
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
}

.top-navbar {
  background: rgba(10, 15, 28, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  min-height: 68px;
  /* Paint above .sub-navbar so the notifications dropdown is not covered by it
     (both bars create stacking contexts via backdrop-filter) */
  position: relative;
  z-index: 3;
}

.brand-mark {
  align-items: center;
  background: var(--brand-accent);
  border-radius: 8px;
  color: #06121f;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 800;
  height: 34px;
  justify-content: center;
  letter-spacing: 0;
  width: 34px;
  box-shadow: 0 0 18px rgba(32, 201, 151, 0.35);
}

.user-chip {
  align-items: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 0.86rem;
  gap: 0.5rem;
  padding: 0.42rem 0.8rem;
  max-width: 100%;
}

.user-chip span + span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.user-dot {
  background: var(--brand-accent);
  border-radius: 999px;
  display: inline-block;
  height: 0.55rem;
  width: 0.55rem;
  box-shadow: 0 0 8px rgba(32, 201, 151, 0.8);
}

.sub-navbar {
  background: rgba(14, 22, 38, 0.82);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.subnav-inner {
  align-items: center;
  display: flex;
  gap: 0.35rem;
  padding: 0.65rem 0;
}

.subnav-scroll {
  display: flex;
  flex: 1;
  gap: 0.35rem;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}

.subnav-scroll::-webkit-scrollbar {
  display: none;
}

.subnav-link {
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.48rem 0.75rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.subnav-link:hover {
  background: rgba(32, 201, 151, 0.1);
  color: var(--brand-accent);
}

.subnav-link-strong {
  background: rgba(32, 201, 151, 0.15);
  color: var(--brand-accent);
  border: 1px solid rgba(32, 201, 151, 0.3);
}

.app-main {
  min-height: calc(100vh - 116px);
}

/* ── Cards (glass) ── */
.card {
  --bs-card-bg: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.card-header {
  background: rgba(255, 255, 255, 0.03);
  border-bottom-color: var(--glass-border);
  font-family: var(--font-display);
}

/* ── Tables ── */
.table {
  --bs-table-bg: transparent;
  --bs-table-hover-bg: rgba(32, 201, 151, 0.05);
}

.table td,
.table th {
  white-space: nowrap;
  border-color: rgba(255, 255, 255, 0.07);
}

.table thead th {
  color: var(--text-faint);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Numbers & tickers read better in mono */
.table tbody td {
  font-variant-numeric: tabular-nums;
}

.table-responsive {
  -webkit-overflow-scrolling: touch;
}

/* Opt-in: first column (ticker) stays pinned while the table scrolls
   horizontally on smaller screens. Solid bg hides content sliding under;
   Bootstrap row tints still paint over it via inset box-shadow. */
@media (max-width: 991.98px) {
  .table-sticky-first th:first-child,
  .table-sticky-first td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background-color: #101a2c;
    /* první vrstva zachovává Bootstrap hover/variant tint, druhá je stín hrany */
    box-shadow:
      inset 0 0 0 9999px var(--bs-table-accent-bg),
      8px 0 12px -8px rgba(0, 0, 0, 0.7);
  }
}

/* ── Locked sections (free tier) - blurred placeholder with one CTA overlay ── */
.locked-section-content {
  filter: blur(7px);
  pointer-events: none;
  user-select: none;
}

.locked-section-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  text-align: center;
}

/* Contextual row variants (bull/bear, hit/miss/partial) - Bootstrap's dark
   variants paint whole rows with heavy tints; remap to subtle terminal-style
   glow tints with a colored edge instead. */
.table-success,
.table-danger,
.table-warning {
  --bs-table-color: #e2e8f0;
  --bs-table-striped-color: #e2e8f0;
  --bs-table-active-color: #fff;
  --bs-table-hover-color: #fff;
}
.table-success {
  --bs-table-bg: rgba(32, 201, 151, 0.07);
  --bs-table-border-color: rgba(32, 201, 151, 0.14);
  --bs-table-striped-bg: rgba(32, 201, 151, 0.1);
  --bs-table-active-bg: rgba(32, 201, 151, 0.16);
  --bs-table-hover-bg: rgba(32, 201, 151, 0.12);
}
.table-danger {
  --bs-table-bg: rgba(239, 68, 68, 0.07);
  --bs-table-border-color: rgba(239, 68, 68, 0.14);
  --bs-table-striped-bg: rgba(239, 68, 68, 0.1);
  --bs-table-active-bg: rgba(239, 68, 68, 0.16);
  --bs-table-hover-bg: rgba(239, 68, 68, 0.12);
}
.table-warning {
  --bs-table-bg: rgba(251, 191, 36, 0.07);
  --bs-table-border-color: rgba(251, 191, 36, 0.14);
  --bs-table-striped-bg: rgba(251, 191, 36, 0.1);
  --bs-table-active-bg: rgba(251, 191, 36, 0.16);
  --bs-table-hover-bg: rgba(251, 191, 36, 0.12);
}
.table > tbody > .table-success > :first-child { border-left: 2px solid rgba(32, 201, 151, 0.55); }
.table > tbody > .table-danger > :first-child  { border-left: 2px solid rgba(239, 68, 68, 0.5); }
.table > tbody > .table-warning > :first-child { border-left: 2px solid rgba(251, 191, 36, 0.5); }

.btn {
  border-radius: 8px;
}

pre {
  max-height: 520px;
  overflow: auto;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: #a7f3d0;
  font-family: var(--font-mono);
}

/* ── Modals / dropdowns on dark ── */
.modal-content {
  background: var(--bg-panel);
  border: 1px solid var(--glass-border);
}

.dropdown-menu {
  --bs-dropdown-bg: var(--bg-panel);
  --bs-dropdown-border-color: var(--glass-border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

/* ── Pagination ── */
.pagination {
  --bs-pagination-bg: var(--glass-bg);
  --bs-pagination-border-color: var(--glass-border);
  --bs-pagination-color: var(--text-dim);
  --bs-pagination-hover-bg: rgba(32, 201, 151, 0.12);
  --bs-pagination-hover-border-color: rgba(32, 201, 151, 0.4);
  --bs-pagination-hover-color: var(--brand-accent);
  --bs-pagination-active-bg: var(--brand-accent);
  --bs-pagination-active-border-color: var(--brand-accent);
  --bs-pagination-active-color: #06121f;
  --bs-pagination-disabled-bg: transparent;
  --bs-pagination-disabled-border-color: rgba(255, 255, 255, 0.05);
  --bs-pagination-disabled-color: rgba(255, 255, 255, 0.2);
}

/* ── Forms ── */
.form-control,
.form-select {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--glass-border);
}

.form-control:focus,
.form-select:focus {
  background-color: rgba(255, 255, 255, 0.07);
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(32, 201, 151, 0.15);
}

/* rozbalený seznam option - Chrome/Firefox přebírají bg/color z <option> */
.form-select option {
  background-color: var(--bg-panel);
  color: #e2e8f0;
}
.form-select option:checked {
  background-color: rgba(32, 201, 151, 0.25);
}

@keyframes cell-flash {
  0%   { background-color: rgba(250, 204, 21, 0.35); }
  100% { background-color: transparent; }
}

.cell-updated {
  animation: cell-flash 1.5s ease-out forwards;
  border-radius: 3px;
  padding: 1px 4px;
}

/* Bookmark column - hidden until row hover, always visible when bookmarked */
.bookmark-col {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
tr:hover .bookmark-col,
.bookmark-col:has(.btn-warning) {
  opacity: 1;
  pointer-events: auto;
}

/* Notification dropdown item hover */
.notification-item {
  cursor: pointer;
}
.notification-item:hover {
  background-color: rgba(32, 201, 151, 0.08);
}
.notification-item.is-unread {
  background-color: rgba(13, 110, 253, 0.08);
}
.notification-item.is-unread:hover {
  background-color: rgba(13, 110, 253, 0.14);
}

/* Unread row in notifications table (dark-mode safe) */
.unread-notification-row {
  box-shadow: inset 3px 0 0 rgba(13, 110, 253, 0.7);
  background-color: rgba(13, 110, 253, 0.07) !important;
}

/* ── Mobile ── */
@media (max-width: 767.98px) {
  /* užší okraje stránky (layout používá utility px-4 = 1.5rem) */
  .app-main > .container-fluid,
  .app-header .container-fluid {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* kompaktnější datové tabulky */
  .table {
    font-size: 0.82rem;
  }
  .table td,
  .table th {
    padding: 0.45rem 0.55rem;
  }

  /* key-value tabulky na show stránkách se můžou lámat */
  .table-borderless td,
  .table-borderless th {
    white-space: normal;
  }

  /* tap targety */
  .btn-sm {
    padding: 0.4rem 0.75rem;
  }
  .subnav-link {
    padding: 0.55rem 0.85rem;
  }
  .pagination .page-link {
    min-width: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* navigační ovládání v rozbaleném hamburger menu */
  .navbar .user-chip span + span {
    max-width: 40vw;
  }

  /* na mobilu se account řádek v nav zalamuje pod ikonkový řádek */
  .navbar-collapse .navbar-nav {
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    margin-bottom: 0.25rem;
  }

  .card-body {
    padding: 0.9rem;
  }

  h1.h3 {
    font-size: 1.3rem;
  }

  /* sign-out button — full width na mobilu v hamburger menu */
  .navbar-collapse [data-turbo="false"] .btn-outline-light {
    width: 100%;
    margin-top: 0.25rem;
  }
}

@media (max-width: 575.98px) {
  .dropdown-menu {
    max-width: calc(100vw - 1.5rem);
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
