/**
 * Tesseract Compact Mode CSS
 * 
 * Domain-isolated styles for the compact 2-column Tesseract layout.
 * Loaded conditionally when tesseractMode === 'compact'.
 * 
 * Design principles:
 * - 8-point grid spacing (6px, 8px, 12px, 16px, 20px)
 * - CSS variables for all colors
 * - Max 300 lines per file
 * - BEM naming convention
 */

/* =========================================================================
   COMPACT MODAL CONTAINER
   ========================================================================= */

.ballistics-modal--compact .ballistics-modal-content {
  max-width: 800px;
  min-width: 600px;
}

/* =========================================================================
   2-COLUMN GRID BODY
   ========================================================================= */

.ballistics-compact-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 20px;
}

.ballistics-compact-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* =========================================================================
   SECTION CARDS
   ========================================================================= */

.ballistics-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 14px;
}

.ballistics-section h3 {
  margin: 0 0 12px 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-cyan, #00d4ff);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* =========================================================================
   INPUT ROWS
   ========================================================================= */

.ballistics-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.ballistics-input-row:last-child {
  margin-bottom: 0;
}

.ballistics-input-row label {
  flex: 0 0 60px;
  font-size: 12px;
  color: var(--text-secondary, rgba(255, 255, 255, 0.7));
}

.ballistics-input-row input,
.ballistics-input-row select {
  flex: 1;
  padding: 6px 10px;
  font-size: 13px;
  background: var(--dark-bg-2, rgba(0, 0, 0, 0.3));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text-primary, #fff);
}

.ballistics-input-row input:focus,
.ballistics-input-row select:focus {
  outline: none;
  border-color: var(--accent-cyan, #00d4ff);
}

/* =========================================================================
   MULTI-COLUMN ROWS
   ========================================================================= */

.ballistics-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ballistics-row-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.ballistics-row-2col .ballistics-input-row,
.ballistics-row-3col .ballistics-input-row {
  margin-bottom: 0;
}

.ballistics-row-2col .ballistics-input-row label,
.ballistics-row-3col .ballistics-input-row label {
  flex: 0 0 auto;
  min-width: 40px;
}

/* =========================================================================
   COLLAPSIBLE SUBSECTIONS
   ========================================================================= */

.ballistics-subsection {
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}

.ballistics-subsection summary {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary, rgba(255, 255, 255, 0.6));
  cursor: pointer;
  user-select: none;
}

.ballistics-subsection summary:hover {
  color: var(--text-primary, #fff);
}

.ballistics-subsection-content {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* =========================================================================
   ACTION BUTTONS
   ========================================================================= */

.ballistics-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ballistics-action-grid .btn {
  padding: 8px 12px;
  font-size: 12px;
}

/* =========================================================================
   RESULTS TABLE BAR
   ========================================================================= */

.ballistics-results-section,
.ballistics-profiles-section {
  margin: 0 20px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.ballistics-table-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, rgba(255, 255, 255, 0.7));
  cursor: pointer;
}

.ballistics-table-bar .badge {
  background: var(--accent-cyan, #00d4ff);
  color: var(--dark-bg-1, #0a0f14);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */

@media (max-width: 700px) {
  .ballistics-compact-body {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .ballistics-modal--compact .ballistics-modal-content {
    min-width: auto;
    max-width: 100%;
  }
}

/* =========================================================================
   TARZAN FOLDER (Left Column Permanent Workspace)
   ========================================================================= */

.tarzan-folder {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  margin-bottom: 8px;
}

.tarzan-folder .folder-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary, #e0e0e0);
  cursor: pointer;
}

.tarzan-folder .folder-icon {
  font-size: 14px;
}

.tarzan-folder .folder-name {
  flex: 1;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.tarzan-folder .profile-count {
  font-size: 11px;
  opacity: 0.6;
}

.tarzan-profile-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px 8px 8px;
}

.tarzan-profile-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
}

.tarzan-profile-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.tarzan-profile-item.on-deck {
  background: rgba(0, 212, 255, 0.08);
  border-color: rgba(0, 212, 255, 0.2);
}

.tarzan-profile-item .profile-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary, #e0e0e0);
}

.tarzan-profile-item .profile-meta {
  font-size: 11px;
  opacity: 0.5;
}

/* =========================================================================
   ORACLE HIGHLIGHT - Visual guidance from Oracle agent
   ========================================================================= */

.oracle-highlight {
  animation: oracle-pulse 0.6s ease-in-out 3;
  box-shadow: 0 0 0 3px var(--gt-active, #00ff88) !important;
  position: relative;
}

@keyframes oracle-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px var(--gt-active, #00ff88);
  }
  50% {
    box-shadow: 0 0 12px 6px var(--gt-active, #00ff88);
  }
}

/* Subtle glow ring for input fields */
input.oracle-highlight,
select.oracle-highlight {
  border-color: var(--gt-active, #00ff88) !important;
}

/* Button highlight with scale */
button.oracle-highlight,
.folder-action-btn.oracle-highlight {
  transform: scale(1.05);
  transition: transform 0.2s ease;
}

/* =========================================================================
   COLLAPSIBLE SUBSECTIONS (Zeroing Conditions, G2 Secondary Rifle)
   ========================================================================= */

.profile-subsection {
  margin-top: 8px;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.15);
}

.profile-subsection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-muted, #8899aa);
  cursor: pointer;
  transition: color 0.15s ease;
}

.profile-subsection-header:hover {
  color: var(--accent-cyan, #00d4ff);
}

.profile-subsection-content {
  padding: 8px 10px 10px;
  border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
}

/* Zeroing status indicator */
.zeroing-status {
  font-size: 10px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  margin-left: auto;
  padding-left: 8px;
}

/* ICAO defaults = muted, Recorded = green */
.zeroing-conditions .zeroing-status {
  color: var(--text-muted, #667788);
}

.zeroing-conditions[open] .zeroing-status,
.zeroing-conditions:has(input:not([value='']):not([value='59']):not([value='0'])) .zeroing-status {
  color: var(--gt-active, #00ff88);
}

/* =========================================================================
   PRD-27: DELTA PANEL - Current Conditions & Deltas
   ========================================================================= */

.delta-conditions {
  margin-top: 8px;
  border-color: var(--cyan-30, rgba(0, 200, 255, 0.3));
  background: rgba(0, 100, 150, 0.08);
}

.delta-panel__header {
  gap: 8px;
}

.delta-panel__icon {
  font-size: 14px;
  font-weight: 700;
  color: var(--cyan, #00c8ff);
}

.delta-panel__title {
  flex: 1;
}

.delta-panel__source-badge {
  font-size: 10px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 200, 255, 0.15);
  color: var(--cyan, #00c8ff);
}

.delta-panel__source-badge--weather_api { background: rgba(0, 255, 150, 0.15); color: #00ff96; }
.delta-panel__source-badge--ios_shortcut { background: rgba(150, 100, 255, 0.15); color: #a080ff; }
.delta-panel__source-badge--cached { background: rgba(255, 200, 0, 0.15); color: #ffcc00; }
.delta-panel__source-badge--manual { background: rgba(255, 100, 100, 0.15); color: #ff8080; }

.delta-panel__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.delta-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.delta-cell__label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted, #667788);
  margin-bottom: 2px;
}

.delta-cell__value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #fff);
}

.delta-cell__badge {
  font-size: 11px;
  font-weight: 500;
  padding: 1px 4px;
  border-radius: 3px;
  margin-top: 2px;
}

.delta-cell__badge--positive {
  background: rgba(255, 100, 100, 0.2);
  color: #ff8888;
}

.delta-cell__badge--negative {
  background: rgba(100, 150, 255, 0.2);
  color: #88aaff;
}

.delta-cell__badge--neutral {
  background: rgba(128, 128, 128, 0.2);
  color: #888;
}

.delta-cell--input input {
  width: 100%;
  padding: 4px 6px;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 200, 255, 0.3);
  border-radius: 4px;
  color: #fff;
  text-align: center;
}

.delta-panel__actions {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.delta-panel__btn {
  flex: 1;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.delta-panel__btn--refresh {
  background: rgba(0, 200, 255, 0.15);
  border: 1px solid rgba(0, 200, 255, 0.3);
  color: var(--cyan, #00c8ff);
}

.delta-panel__btn--refresh:hover {
  background: rgba(0, 200, 255, 0.25);
}

.delta-panel__btn--manual {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-secondary, #aaa);
}

.delta-panel__btn--manual:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.delta-panel__summary {
  font-size: 11px;
  color: var(--text-muted, #667788);
  font-style: italic;
  text-align: center;
  display: none;
}

.delta-panel--manual .delta-panel__btn--manual {
  background: rgba(0, 255, 150, 0.2);
  border-color: rgba(0, 255, 150, 0.4);
  color: #00ff96;
}
