@import url("color_palette.css");

/* Right Drawer */
.drawer {
  position: fixed;
  top: var(--menu-bar-height, 50px);
  right: -450px;
  width: 450px;
  height: calc(100vh - var(--menu-bar-height, 50px));
  background: var(--bg-primary);
  box-shadow: var(--shadow-lg);
  transition: right 0.3s ease;
  z-index: 1000;
  border-left: 1px solid var(--border-medium);
  border-radius: 0;
}

.drawer.open {
  right: 0;
}

.drawer-content {
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.drawer-header {
  padding: 0 16px !important;
  height: 40px !important;
  min-height: 40px !important;
  background: linear-gradient(to bottom, #1a1f2e, #2a3142) !important;
  border-bottom: 2px solid #cc6600 !important;
  flex-shrink: 0;
  font-size: var(--font-size-xs) !important;
  font-weight: 600 !important;
  font-family: var(--gd-font-sans) !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  border-top-left-radius: 0 !important;
}

.drawer-header h3 {
  margin: 0 !important;
  color: var(--text-on-dark) !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  flex: 1;
}

.drawer-body {
  padding: var(--spacing-sm) !important;
  flex: 1;
  overflow-y: auto;
}

/* Drawer Tab Buttons — floating row, top-right */
.drawer-tab {
  position: fixed;
  top: calc(var(--menu-bar-height, 50px) + 8px);
  width: 32px;
  height: 32px;
  background: var(--gd-surface, #131a24);
  border: 1px solid var(--gd-rim, #212d3f);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
  z-index: 999;
}

.drawer-tab[data-drawer="general"] {
  right: 8px;
}

.drawer-tab[data-drawer="context"] {
  right: 46px;
}

.drawer-tab[data-drawer="watch"] {
  right: 46px;
}

/* Count on a drawer's edge tab (e.g. Watch: alerts awaiting acknowledgement) */
.drawer-tab-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 14px;
  padding: 0 3px;
  font-family: var(--gd-font-mono);
  font-size: var(--font-size-2xs);
  line-height: 14px;
  text-align: center;
  background: var(--red-alert);
  color: var(--color-white);
}

.drawer-tab:hover {
  background: var(--gd-elevated, #1a2333);
  border-color: rgba(224, 123, 0, 0.4);
}

.drawer-tab i {
  color: var(--gd-text-hi, #c8d2e0);
  font-size: 14px;
  transition: color 0.15s ease;
}

.drawer-tab:hover i {
  color: var(--gd-text-hi, #e8edf5);
}

.drawer-tab.active {
  background: var(--gd-elevated, #1a2333);
  border-color: rgba(224, 123, 0, 0.4);
}

.drawer-tab.active i {
  color: rgba(224, 123, 0, 0.8);
}

/* Scrollbar styling for drawer */
.drawer-body::-webkit-scrollbar {
  width: 8px;
}

.drawer-body::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}

.drawer-body::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 4px;
}

.drawer-body::-webkit-scrollbar-thumb:hover {
  background: var(--border-dark);
}

/* Context drawer items */
.context-section-badge {
  font-size: var(--font-size-xs);
  color: var(--text-muted, #6c7380);
  font-weight: 400;
}

.context-item {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-light, #e5e7eb);
  cursor: pointer;
  transition: background 0.15s;
}

.context-item:hover {
  background: rgba(204, 102, 0, 0.04);
}

.context-item.expanded {
  background: rgba(204, 102, 0, 0.06);
  border-left: 2px solid #cc6600;
}

.context-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.context-item-name {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-primary, #1e293b);
}

.context-item-meta {
  font-size: var(--font-size-xs);
  color: var(--text-muted, #6c7380);
  background: var(--bg-secondary, #f1f5f9);
  padding: 1px 6px;
  border-radius: 3px;
}

.context-item-desc {
  font-size: var(--font-size-xs);
  color: var(--text-muted, #6c7380);
  margin-top: 2px;
  line-height: 1.4;
}

.context-detail {
  padding: 6px 8px 8px 12px;
  background: var(--bg-secondary, #f8fafc);
  border-bottom: 1px solid var(--border-light, #e5e7eb);
  font-size: var(--font-size-xs);
}

.context-detail-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-muted, #6c7380);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 6px;
  margin-bottom: 2px;
}

.context-detail-label:first-child {
  margin-top: 0;
}

.context-detail-value {
  font-size: var(--font-size-xs);
  color: var(--text-primary, #374151);
  line-height: 1.5;
}

.context-detail-value code {
  font-size: var(--font-size-xs);
  background: rgba(204, 102, 0, 0.08);
  padding: 1px 4px;
  border-radius: 2px;
  color: #cc6600;
}

.context-example {
  font-size: var(--font-size-xs);
  color: var(--text-secondary, #475569);
  font-style: italic;
  padding: 1px 0;
}
