/**
 * FILE: beat-add-0-styles.css
 * PURPOSE: Defines the visual identity and immediate feedback loops for the tracker.
 * 
 * DESIGN PHILOSOPHY:
 * 1. Cognitive Load Reduction: Uses zebra striping and high-contrast typography (Fira Sans) 
 *    to assist users with ADD in scanning dense data.
 * 2. Micro-Rewards: Implements the .total-updated class to provide a gold-flash pulse 
 *    whenever a calculation is successfully completed.
 * 3. Component Mobility: Flexbox containers allow the Alarm UI to move between the 
 *    sidebar and modal dialog without breaking the document flow.
 * 
 * KEY SELECTORS:
 * - #countdown-timer: Large monospace font for high-visibility focus tracking.
 * - [data-field] span: Styled to provide a hover-state cue that text is editable.
 */
/**
 * PURPOSE: Layout and Visual Feedback for the Beat ADD Tracker.
 * DESIGN DECISION: Flexbox is used for the main container to allow the 
 * 'alarm-clock-ui' component to move in and out of the layout without 
 * breaking the document flow.
 */
.container-clock-table {
  display: flex; /* Activates flexbox layout */
  justify-content: space-around; /* Distributes space between the items */
  gap: 20px; /* Adds space between the table and the div */
  align-items: flex-start; /* Aligns items to the top if they have different heights */
}

p,
label {
  font:
    1rem "Fira Sans",
    sans-serif;
}

button {
  margin-left: 10px;
}

input {
  margin: 0.4rem;
}

/**
 * PURPOSE: Data Visualization.
 * LOGIC: Uses collapse to ensure the 1px borders look sharp on 2026 high-DPI screens.
 */
table {
  border-collapse: collapse;
  border: 2px solid rgb(140 140 140);
  font-family: sans-serif;
  font-size: 0.8rem;
  letter-spacing: 1px;
}

caption {
  caption-side: top;
  padding: 10px;
  font-weight: bold;
}

thead,
tfoot {
  background-color: rgb(228 240 245);
}

th,
td {
  border: 1px solid rgb(160 160 160);
  padding: 8px 10px;
}

/**
 * LOGIC: Aligns the 'Actions' column buttons centrally for better mobile/touch targets.
 */
td:last-of-type {
  text-align: center;
}

/**
 * DESIGN DECISION: Zebra striping.
 * PURPOSE: Increases legibility when scanning long rows of time data, 
 * reducing the "visual noise" that can be distracting for ADD users.
 */
tbody > tr:nth-of-type(even) {
  background-color: rgb(237 238 242);
}

tfoot th {
  text-align: right;
}

/**
 * PURPOSE: Visual State Transitions.
 * DESIGN DECISION: We declare a transition on the base element so that 
 * when the .total-updated class is removed by JS, the color fades out 
 * smoothly rather than snapping instantly.
 */
tfoot td {
  font-weight: bold;
  transition: background-color 0.3s ease;
}

/**
 * CLASS: .total-updated
 * PURPOSE: Immediate Cognitive Feedback. 
 * DESIGN DECISION: Users with ADD benefit from clear "Micro-Rewards." 
 * LOGIC: The gold flash (#fff3cd) is triggered by updateRunningTotals() in JS.
 * It uses !important to override the default tfoot background during the pulse.
 */
.total-updated {
  background-color: #fff3cd !important; /* Soft highlight */
  transition: background-color 1s ease;
}

/**
 * SELECTOR: #countdown-timer (Optional Addition for your Alarm logic)
 * PURPOSE: Visual Anchor.
 * LOGIC: High-contrast red and monospace font ensure the time is readable 
 * at a glance while focusing on other tasks.
 */
#countdown-timer {
  font-size: 2rem;
  font-family: "Courier New", monospace;
  color: #ff4757;
  font-weight: bold;
}
.doc-container {
  margin-top: 40px;
  padding: 20px;
  background-color: #f4f7f6;
  border-left: 5px solid #2ed573;
  font-family: "Fira Sans", sans-serif;
  line-height: 1.6;
  max-width: 800px;
}

.doc-container h3 {
  color: #2f3542;
  margin-bottom: 10px;
  border-bottom: 1px solid #dcdde1;
  padding-bottom: 5px;
}

.doc-section {
  margin-bottom: 20px;
}

.doc-container strong {
  color: #2ed573;
}

.doc-container code {
  background-color: #e1e4e8;
  padding: 2px 5px;
  border-radius: 3px;
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
}
/* Color-coded documentation highlights */
.score-green {
  color: #2ed573;
  font-weight: bold;
}
.score-orange {
  color: #ffa502;
  font-weight: bold;
}
.score-red {
  color: #ff4757;
  font-weight: bold;
}

.focus-logic-box {
  border-left-color: #ffa502; /* Distinct color from the general docs */
  background-color: #fcfaf2;
  margin-top: 20px;
}

.focus-logic-box em {
  font-style: italic;
  color: #2f3542;
}
/* Visual cue that data is editable */
[data-field] span {
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 3px;
  transition: background-color 0.2s;
  display: block;
  width: 100%;
  box-sizing: border-box;
  line-height: 1.8;
  min-height: 2em; /* ← this is the fix */
}

td[data-field] {
  padding: 0;
}

[data-field] span:hover {
  background-color: #fff3cd; /* Same gold as your update flash */
  text-decoration: underline;
}
td input[type="time"] {
  max-width: 120px; /* Prevents column blowout */
  box-sizing: border-box;
  font-family: inherit;
  font-size: 0.8rem;
  padding: 0;
  margin: 0;
  border: 1px solid #2ed573;
}
/* Keeps the table calm until you need an action */
.btn-delete {
  opacity: 0.4;
  transition:
    opacity 0.2s,
    transform 0.1s;
}

.btn-delete:hover {
  opacity: 1;
  transform: scale(1.1); /* Subtle "pop" on hover */
}

.btn-delete svg {
  stroke: #7f8c8d; /* Default slate gray */
}

.btn-delete:hover svg {
  stroke: #c0392b; /* Muted deep red on hover only */
}
/* Targeted reduction for the delete column */
td[data-field="actions"] {
  padding: 2px 4px; /* Reduced from 8px 10px */
  width: 1%; /* Forces the column to shrink-wrap the icon */
  white-space: nowrap;
}

.btn-delete {
  padding: 0; /* Remove button internal padding */
  margin: 0;
  line-height: 0; /* Prevents button height from exceeding icon height */
  display: inline-block;
  vertical-align: middle;
}
.button-group {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 15px;
}

#snooze-btn {
  background-color: #f39c12; /* Warning orange to distinguish from 'OK' */
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 5px;
  cursor: pointer;
}

#snooze-btn:hover {
  background-color: #e67e22;
}

/* Countdown container: compact, centered, and responsive */
#countdown-container {
  display: none; /* already toggled by JS; keep hidden by default */
  font-weight: 700; /* keep bold but control size */
  text-align: center;
  margin-top: 10px;
}

/* Countdown number: smaller, consistent across viewports */
#countdown-timer {
  display: inline-block;
  font-size: 1.25rem; /* ~20px at default 16px root; adjust as needed */
  line-height: 1;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.04);
  color: #222;
  min-width: 3.5ch; /* keeps layout stable for mm:ss */
  font-variant-numeric: tabular-nums;
}

/* Status line: keep it compact and readable */
#statusLine {
  font-size: 0.95rem; /* slightly smaller than countdown */
  color: #333;
  margin-top: 6px;
}

/* Small screens: reduce countdown size to avoid visual dominance */
@media (max-width: 480px) {
  #countdown-timer {
    font-size: 1rem;
    padding: 4px 8px;
  }
  #statusLine {
    font-size: 0.9rem;
  }
}
