/* css/utilities.css */
/* Material Design 3 Enterprise - Utilities, Helpers, and Specialized UI */

/* ========================================================================
   PROFIT & LOSS BLACKBOARD (Specialized UI)
   ======================================================================== */
.pl-blackboard {
  background-color: #1F1F1F; /* Very dark surface for contrast */
  border-radius: var(--md-sys-shape-corner-card); /* 20px */
  border: 1px solid #444746;
  padding: var(--md-sys-spacing-6);
  color: #E3E3E3;
}

.pl-blackboard h3 {
  font: var(--md-sys-typescale-title-medium);
  color: #FFFFFF;
  margin-bottom: var(--md-sys-spacing-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pl-blackboard .margin-pct {
  color: var(--md-sys-color-warning); /* Highlighted margin percentage */
}

.pl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--md-sys-spacing-4);
  font-family: var(--md-sys-typescale-font-mono);
  font-size: 0.875rem;
  color: #C4C7C5;
  line-height: 1.8;
}

.pl-grid div > div {
  display: flex;
  justify-content: space-between;
}

.pl-grid .positive {
  color: #6DD58C; /* MD3 Dark mode green */
}

.pl-grid .negative {
  color: #F28B82; /* MD3 Dark mode red */
}

.pl-total-row {
  border-top: 1px dashed #444746;
  margin-top: var(--md-sys-spacing-4);
  padding-top: var(--md-sys-spacing-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pl-total-row span {
  font: var(--md-sys-typescale-title-medium);
  color: #FFFFFF;
}

.pl-total-row strong {
  font: var(--md-sys-typescale-headline-medium);
  color: #A8C7FA; /* MD3 Dark mode primary container text */
  font-family: var(--md-sys-typescale-font-mono);
}

/* ========================================================================
   FLOATING ACTION / SAVE INDICATORS
   ======================================================================== */
.floating-save-bar {
  position: sticky;
  bottom: 0;
  padding: var(--md-sys-spacing-4) var(--md-sys-spacing-8);
  background-color: rgba(31, 31, 31, 0.9); /* Translucent dark surface */
  backdrop-filter: blur(8px);
  border-top: 1px solid #444746;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--md-sys-spacing-3);
  margin-top: auto; /* Push to bottom of flex container */
  z-index: 10;
}

.floating-save-bar .save-indicator {
  font: var(--md-sys-typescale-label-medium);
  color: #6DD58C; /* Success green in dark mode */
}

/* ========================================================================
   HELP / HINT BLOCKS
   ======================================================================== */
.help-panel {
  background-color: var(--md-sys-color-info-container);
  color: var(--md-sys-color-on-info-container);
  border-radius: var(--md-sys-shape-corner-card);
  padding: var(--md-sys-spacing-5);
  margin-bottom: var(--md-sys-spacing-5);
}

.help-panel h3 {
  font: var(--md-sys-typescale-title-small);
  color: var(--md-sys-color-on-info-container);
  margin-bottom: var(--md-sys-spacing-3);
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--md-sys-spacing-2) var(--md-sys-spacing-5);
  font: var(--md-sys-typescale-body-small);
}

.help-grid strong {
  font-weight: 600;
}

@media (max-width: 1100px) {
  .help-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================================================
   TYPOGRAPHY HELPERS
   ======================================================================== */
.text-primary { color: var(--md-sys-color-primary) !important; }
.text-danger { color: var(--md-sys-color-danger) !important; }
.text-success { color: var(--md-sys-color-success) !important; }
.text-warning { color: var(--md-sys-color-warning) !important; }
.text-muted { color: var(--md-sys-color-on-surface-variant) !important; }

/* ========================================================================
   FLEX / LAYOUT HELPERS
   ======================================================================== */
.flex-1 { flex: 1; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--md-sys-spacing-2); }
.gap-3 { gap: var(--md-sys-spacing-3); }

/* ========================================================================
   SMART PASTE AREA (Special Input Layout)
   ======================================================================== */
.smart-paste-area {
  display: flex;
  flex-direction: column;
  gap: var(--md-sys-spacing-3);
}

.smart-paste-area textarea {
  background-color: var(--md-sys-color-surface);
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-input); /* 16px */
  padding: var(--md-sys-spacing-3) var(--md-sys-spacing-4);
  color: var(--md-sys-color-on-surface);
  font-family: var(--md-sys-typescale-font-mono);
  font-size: 0.875rem;
  resize: vertical;
  line-height: 1.5;
  width: 100%;
}

.smart-paste-area textarea:focus {
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 1px var(--md-sys-color-primary);
  outline: none;
}

.smart-paste-actions {
  display: flex;
  gap: var(--md-sys-spacing-2);
}

/* ========================================================================
   PRINT HELPERS (Screen View)
   ======================================================================== */
.print-only {
  display: none !important;
}