/**
 * HomeSelector Component
 * Grid of app module cards for selection
 * 
 * Dependencies: chat-tokens.css
 */

/* ============================================
   PAGE LAYOUT
   ============================================ */

.home-selector header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--clr-primary);
  margin-bottom: 0.5rem;
}

.home-selector header p {
  font-size: 1.1rem;
  color: var(--clr-subtle);
  margin: 0;
}

.home-selector .page-below-header {
  padding-top: var(--header-height) !important;
}

/* Hide QPO bar and sidebar on home */
.home-selector #qpoqqcc-progress,
.home-selector .header-left,
.home-selector .sidebar-toggle {
  display: none !important;
}

/* Ensure proper height calculations without QPO bar */
.home-selector.with-qpo-bar main#chat,
.home-selector.with-qpo-bar .page-below-header {
  max-height: calc(100vh - var(--header-height)) !important;
  padding-top: var(--header-height) !important;
}

/* ============================================
   APP GRID
   ============================================ */

.home-selector .app-grid {
  display: grid;
  grid-template-columns: repeat(3, 160px);
  gap: 40px;
  justify-content: center;
  margin-top: var(--header-height);
}

/* ============================================
   APP CARD
   ============================================ */

.home-selector .app-card {
  background-color: var(--clr-surface);
  border-radius: var(--radius-lg);
  width: 160px;
  height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  color: var(--clr-primary);
  font-size: 1rem;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
}

.home-selector .app-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.home-selector .app-card > span.material-symbols-outlined {
  font-size: 2.4rem;
  margin-bottom: 10px;
}

/* ============================================
   QUALIFICATION TILE WITH SUBMENU
   ============================================ */

#qualificationTile {
  width: 160px;
  height: 160px;
  position: relative;
}

#qualificationToggle {
  all: unset;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  color: inherit;
  text-align: center;
}

#qualificationToggle .material-symbols-outlined {
  font-size: 18px;
  opacity: 0.7;
}

/* Submenu positioning */
#qualificationMenu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  margin-top: 8px;
  padding: 8px;
  box-shadow: var(--shadow-sm);
  z-index: 50;
}

.submenu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 0.5rem;
}

.submenu.hidden {
  display: none;
}

.btn-sub {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

.btn-sub:hover {
  background: var(--clr-accent);
  color: #fff;
}

/* ============================================
   DARK MODE
   ============================================ */

body.dark-mode .home-selector .app-card {
  background-color: var(--clr-surface);
  color: var(--clr-text);
  border: 1px solid var(--clr-border);
  transition: background 0.23s, box-shadow 0.23s, border-color 0.22s;
}

body.dark-mode .home-selector .app-card:hover {
  background-color: var(--clr-accent);
  color: #fff !important;
  border-color: var(--clr-accent);
  box-shadow: 0 12px 24px rgba(131, 111, 255, 0.24);
}

body.dark-mode .home-selector .app-card:hover *,
body.dark-mode .home-selector .app-card:hover span {
  color: #fff !important;
  fill: #fff !important;
  stroke: #fff !important;
}

body.dark-mode .home-selector .app-card:hover svg {
  fill: #fff !important;
  stroke: #fff !important;
}

body.dark-mode .btn-sub {
  background: var(--clr-panel);
  color: var(--clr-text);
  border: 1px solid var(--clr-border);
}

body.dark-mode .btn-sub:hover {
  background: var(--clr-accent);
  color: #fff;
}

