/* Responsive polish overrides for Thiru Logs */

/* Keep the main content from forcing horizontal overflow. */
.app-main-column,
.workspace,
.app-top-menu,
.top-menu-links,
.top-menu-actions,
.knowledge-ticker,
.knowledge-ticker-window {
  min-width: 0;
}

/* Desktop header: one predictable row, no collisions. */
@media (min-width: 1181px) {
  .app-top-menu {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 62px;
    padding: 10px 20px !important;
    overflow: visible;
  }

  .app-top-menu .top-menu-brand {
    display: none !important;
  }

  .top-menu-links {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    flex-wrap: nowrap !important;
    overflow: hidden;
  }

  .top-menu-links button {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 10px !important;
    font-size: 0.88rem !important;
    white-space: nowrap;
  }

  .top-menu-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: nowrap !important;
  }

  .top-menu-actions .logged-in-label {
    max-width: 150px;
    padding-inline: 9px;
    font-size: 0.78rem;
  }

  .top-menu-actions .language-switcher {
    min-width: 166px !important;
  }

  .top-menu-actions .logout-button {
    min-width: 82px !important;
    min-height: 38px !important;
    padding-inline: 12px;
  }

  .workspace {
    padding-top: 24px !important;
  }

  .app-page-header h2,
  .topbar h2 {
    font-size: clamp(1.8rem, 2.5vw, 2.55rem) !important;
  }
}

/* Mid-size desktop/laptop widths: remove the lowest-priority label first. */
@media (min-width: 1181px) and (max-width: 1450px) {
  .app-top-menu {
    gap: 10px;
    padding-inline: 14px !important;
  }

  .top-menu-actions .logged-in-label {
    display: none !important;
  }

  .top-menu-links button {
    padding-inline: 8px !important;
    font-size: 0.84rem !important;
  }

  .top-menu-actions .language-switcher {
    min-width: 154px !important;
  }
}

/* Compact desktop: allow a clean second row instead of overlap. */
@media (min-width: 1181px) and (max-width: 1280px) {
  .app-top-menu {
    display: grid !important;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "nav actions";
  }

  .top-menu-links {
    grid-area: nav;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .top-menu-links::-webkit-scrollbar {
    display: none;
  }

  .top-menu-actions {
    grid-area: actions;
  }
}

/* Knowledge path ticker: keep moving chips behind the fixed label. */
.knowledge-ticker {
  position: relative;
  overflow: hidden !important;
}

.knowledge-ticker-label {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  background: inherit;
}

.knowledge-ticker-window {
  position: relative;
  z-index: 1;
  overflow: hidden !important;
}

.knowledge-ticker-track {
  width: max-content;
}

/* Keep cards and search controls inside the content column. */
.dashboard-search,
.admin-command,
.admin-kpi-grid,
.admin-dashboard-grid,
.dashboard-panel {
  max-width: 100%;
  min-width: 0;
}

.dashboard-search input {
  min-width: 0;
}

/* FAQ Library: keep the permission/category summary cards only on Dashboard.
   The library uses the full available width for search results. */
.content-grid {
  grid-template-columns: minmax(0, 1fr) !important;
}

.content-grid > .detail-column {
  display: none !important;
}

.content-grid > .faq-panel {
  width: 100%;
  max-width: none;
}

@media (max-width: 1180px) {
  .app-top-menu {
    overflow: visible;
  }

  .top-menu-links,
  .top-menu-actions {
    min-width: 0;
  }
}

/* Modern typography and visual hierarchy refresh. */
html,
body,
button,
input,
select,
textarea {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

body {
  line-height: 1.55;
  letter-spacing: -0.005em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  letter-spacing: -0.025em;
  line-height: 1.18;
  font-weight: 700 !important;
}

p,
li,
input,
select,
textarea {
  font-weight: 400;
}

button,
.top-menu-links button,
.logout-button,
.primary-button,
.secondary-button {
  font-weight: 600 !important;
  letter-spacing: -0.01em;
}

.app-page-header h2,
.topbar h2 {
  font-weight: 700 !important;
}

.app-page-header p,
.topbar p,
.dashboard-panel p,
.category-card p,
.faq-card p,
.faq-meta,
.category-meta {
  color: #64748b;
  font-weight: 400 !important;
  line-height: 1.6;
}

.dashboard-panel h3,
.category-card h3,
.faq-card h3,
.recent-answer-card h3,
.category-coverage-card h3 {
  font-weight: 650 !important;
  line-height: 1.32;
}

/* Cards should feel light and interactive rather than heavy. */
.dashboard-panel,
.category-card,
.faq-card,
.recent-answer-card,
.category-coverage-card,
.admin-kpi-card,
.admin-command,
.dashboard-search {
  border-color: rgba(148, 163, 184, 0.28) !important;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.055) !important;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.category-card:hover,
.faq-card:hover,
.recent-answer-card:hover,
.category-coverage-card:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.22) !important;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.085) !important;
}

/* Make search feel like the primary action. */
.dashboard-search input,
input[type="search"],
input[type="text"] {
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.dashboard-search input:focus,
input[type="search"]:focus,
input[type="text"]:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.58) !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1) !important;
}

/* Secondary labels stay useful without competing with the content. */
small,
.eyebrow,
.meta,
.faq-meta,
.category-meta,
.logged-in-label {
  font-weight: 500 !important;
  letter-spacing: 0;
}

/* Preserve strong emphasis for key counts only. */
.admin-kpi-card strong,
.category-count,
.faq-count,
.sidebar-count {
  font-weight: 700 !important;
}

/* Add FAQ: remove dashboard-style summary cards and use the full content width. */
.faq-create-layout {
  grid-template-columns: minmax(0, 1fr) !important;
}

.faq-create-layout > .faq-create-aside {
  display: none !important;
}

.faq-create-layout > .faq-create-form {
  width: 100%;
  max-width: none;
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-panel,
  .category-card,
  .faq-card,
  .recent-answer-card,
  .category-coverage-card,
  .dashboard-search input,
  input[type="search"],
  input[type="text"] {
    transition: none !important;
  }
}
