/* Dashboard UX polish — dark desk */

/* Focus visibility */
body.dash-body :focus-visible {
  outline: 2px solid #7dcea0;
  outline-offset: 3px;
}

.dash-nav a:focus-visible,
.nav-cat-toggle:focus-visible,
.cat-3d-card:focus-visible,
.theme-btn:focus-visible {
  outline-offset: 2px;
}

/* Smooth section transitions */
.dash-section.active {
  animation: dashRise 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes dashRise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 9999;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  background: #22823a;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 1rem;
}

/* Topbar breadcrumb / hint */
.dash-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.dash-title-wrap h1 {
  margin: 0;
  line-height: 1.15;
}

.dash-crumb {
  font-size: 0.72rem;
  color: rgba(232, 240, 234, 0.45);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-crumb span {
  color: #7dcea0;
}

/* Keyboard hint chip */
.kbd-hint {
  display: none;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 8px;
  font-size: 0.7rem;
  color: rgba(232, 240, 234, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.kbd-hint kbd {
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(125, 206, 160, 0.15);
  color: #7dcea0;
  border: 1px solid rgba(125, 206, 160, 0.25);
}

@media (min-width: 1100px) {
  .kbd-hint {
    display: inline-flex;
  }
}

/* Search field for Learn */
.learn-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.15rem;
}

.learn-search {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.learn-search i {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(125, 206, 160, 0.7);
  font-size: 0.85rem;
  pointer-events: none;
}

.learn-search input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.4rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 14, 10, 0.65);
  color: #e8f0ea;
  font-family: inherit;
  font-size: 0.92rem;
  transition: 0.2s;
}

.learn-search input::placeholder {
  color: rgba(232, 240, 234, 0.4);
}

.learn-search input:focus {
  outline: none;
  border-color: #22823a;
  box-shadow: 0 0 0 3px rgba(34, 130, 58, 0.25);
}

.learn-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.learn-chip {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(232, 240, 234, 0.7);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: 0.2s;
}

.learn-chip:hover,
.learn-chip.active {
  background: rgba(34, 130, 58, 0.3);
  border-color: rgba(125, 206, 160, 0.4);
  color: #9de0b0;
}

/* Skeleton pulse while loading */
.learn-grades:empty::before {
  content: "Loading syllabus…";
  display: block;
  padding: 2rem;
  text-align: center;
  color: rgba(232, 240, 234, 0.45);
}

@media (max-width: 768px) {
  .kbd-hint,
  .dash-topbar-actions .hide-sm,
  .dash-topbar-actions .btn-label {
    display: none !important;
  }
  .dash-topbar-actions .theme-btn {
    padding: 0.45rem 0.65rem;
  }
  .dash-user .meta {
    display: none;
  }
  .dash-actions.sticky-actions {
    position: sticky;
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    z-index: 20;
    padding: 0.65rem;
    border-radius: 14px;
    background: rgba(10, 16, 12, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .dash-section.active,
  .float-3d,
  .cat-3d-card,
  .learn-grade {
    animation: none !important;
    transition: none !important;
  }
}

/* Better scrollbar in dark sidebar */
.dash-nav::-webkit-scrollbar {
  width: 6px;
}
.dash-nav::-webkit-scrollbar-thumb {
  background: rgba(125, 206, 160, 0.25);
  border-radius: 99px;
}
.dash-nav::-webkit-scrollbar-track {
  background: transparent;
}

/* Active nav item glow pulse soft */
.dash-nav a.active i {
  color: #7dcea0;
}

/* Command palette style quick jump hint in empty space */
.ux-tip {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px dashed rgba(125, 206, 160, 0.25);
  background: rgba(34, 130, 58, 0.1);
  color: rgba(232, 240, 234, 0.7);
  font-size: 0.85rem;
}

.ux-tip strong {
  color: #9de0b0;
}
