/* css/components/focus-menu.css - Focus Menu Styling */
/* v1.0 - 10/23/25 - Ported from legacy for Phase 2 focus menu implementation */

/* Focus Menu Container */
.focus-menu {
  position: fixed;
  width: 200px;
  background: var(--bg-secondary, #333);
  border-radius: var(--border-radius);
  padding: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  z-index: calc(var(--z-widget-focused) + 2); /* 202 - Higher than widget fullscreen (201) to always stay visible */
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 1;
  pointer-events: auto; /* CRITICAL: Allow menu to capture mouse events */

  /* Smooth transform animation - matches widget centering animation */
  transition: transform 0.4s cubic-bezier(0.4, 0.0, 0.2, 1), opacity 0.3s ease, scale 0.3s ease;
}

/* Dimmed state when user is in widget content - scale down 5% and slightly reduce opacity */
.focus-menu.dimmed {
  scale: 0.95;
  opacity: 0.85;
  transition: scale 0.3s ease, opacity 0.3s ease;
}

/* Menu Item */
.focus-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between; /* Push checkmark to right */
  gap: 12px;
  padding: 12px 0;
  margin: 0 -12px; /* Extend to edges of container */
  padding-left: 12px;
  padding-right: 12px;
  border-radius: 0; /* Square edges for full-width highlighting */
  background: transparent;
  color: var(--text-primary, #fff);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  position: relative;
  pointer-events: auto; /* CRITICAL: Allow item to capture clicks */
}

/* Menu Item - Hover (mouse support) */
.focus-menu-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Menu Item - Selected/Highlighted (cursor position with d-pad) */
.focus-menu-item.selected {
  background: var(--bg-selected-fill); /* Shading for cursor selection */
  padding-left: 12px; /* No border compensation needed */
}

/* Menu Item - Active (current view/calendar) */
.focus-menu-item.active {
  background: transparent; /* No shading by default */
  font-weight: 600;
  border-left: 6px solid var(--outline-color-nav); /* Left border for active - 2x thickness */
  padding-left: 6px; /* Compensate for thicker border (12px - 6px) */
}

/* Active item that's also selected gets shading */
.focus-menu-item.active.selected {
  background: var(--bg-selected-fill); /* Add shading when cursor is on active item */
}

/* Menu Icon */
.menu-icon {
  font-size: 20px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
}

/* Menu Label Container */
.menu-label-container {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 2px;
}

/* Menu Label */
.menu-label {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
}

/* Menu Sublabel (secondary text below label) */
.menu-sublabel {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted, #888);
  line-height: 1.2;
}

/* Selected item gets bolder text */
.focus-menu-item.selected .menu-label,
.menu-action-button.selected .menu-label {
  font-weight: 600;
}

/* Smooth transitions for all interactive states */
.focus-menu-item,
.focus-menu {
  transition: all 0.2s ease;
}

/* ===== MENU SECTIONS ===== */

.menu-section {
  margin-bottom: 4px; /* Reduced from 16px to 4px for tighter spacing */
}

.menu-section:last-of-type {
  margin-bottom: 0;
}

.menu-section-header {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 4px 0;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.menu-divider {
  height: 1px;
  background: var(--text-muted);
  opacity: 0.2;
  margin: 4px 0; /* Reduced from 12px to 4px for tighter spacing */
}

/* ===== ACTION BUTTON (Go to Today) ===== */

.menu-action-button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin: 0 -12px;
  background: transparent;
  color: var(--text-primary);
  border-radius: 0; /* Square edges like other menu items */
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  font-weight: 500;
  border-left: 3px solid transparent;
  pointer-events: auto; /* CRITICAL: Allow button to capture clicks */
}

.menu-action-button:hover {
  background: rgba(255, 255, 255, 0.05); /* Match menu-item hover */
}

.menu-action-button.selected {
  background: var(--bg-selected-fill);
  border-left: 3px solid var(--outline-color-nav);
  padding-left: 9px;
}

.menu-action-button.active {
  background: var(--bg-active);
  font-weight: 600;
}

.menu-action-button .menu-icon {
  font-size: 18px;
}

/* ===== CONTROLS GUIDE ===== */
/* TEMPORARILY HIDDEN - Keep logic but hide visually */

.controls-guide {
  display: none; /* HIDDEN: Will handle controls differently */
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.control-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.control-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  flex-shrink: 0;
  font-size: 14px;
}

.control-label {
  flex-grow: 1;
  line-height: 1.3;
}

.control-label.empty {
  opacity: 0.3;
  font-style: italic;
}
