/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 *


 */

/* Drag-to-reorder (SortableJS) — shared by queue and arena views */
.sortable-ghost { opacity: 0.4; background: #e0e7ff; border-radius: 0.75rem; }
.drag-handle:active { cursor: grabbing; }

/* ── Responsive show/hide for check-in views ── */
@media (min-width: 1024px) { .mobile-checkin { display: none !important; } }
@media (max-width: 1023px) { .desktop-checkin { display: none !important; } }

/* ── Competition card responsive padding ── */
@media (max-width: 639px) {
  .comp-card-section { padding-left: 1rem !important; padding-right: 1rem !important; }
}

/* ── Mobile nav drawer ── */
@media (max-width: 1023px) {
  #main-nav {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 50;
    width: 14rem;
    transform: translateX(-100%);
    transition: transform 0.2s ease-in-out;
  }
  #main-nav.nav-open { transform: translateX(0); }
}

/* ── Mobile check-in card components ── */
.m-card-row      { display: flex; align-items: center; gap: 0.75rem; }
.m-card-checkbox  { width: 1.25rem; height: 1.25rem; flex-shrink: 0; cursor: pointer; accent-color: #2563eb; }
.m-card-info      { flex: 1; min-width: 0; }
.m-card-name      { font-size: 0.875rem; font-weight: 600; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-card-meta      { font-size: 0.75rem; color: #6b7280; margin-top: 0.1rem; }
/* ── Mobile overflow menu ── */
.m-overflow-wrap    { position: relative; flex-shrink: 0; }
.m-overflow-btn     { font-size: 1.1rem; font-weight: 700; color: #9ca3af; line-height: 1; padding: 0.125rem 0.375rem; cursor: pointer; background: none; border: none; letter-spacing: 0.05em; }
.m-overflow-menu    { display: none; position: absolute; right: 0; top: 2rem; z-index: 50; background: white; border: 1px solid #e5e7eb; border-radius: 0.5rem; box-shadow: 0 4px 12px rgba(0,0,0,0.12); padding: 0.625rem 0.875rem; min-width: 185px; }
.m-overflow-row     { display: flex; align-items: center; gap: 0.5rem; }
.m-overflow-row + .m-overflow-row { margin-top: 0.5rem; }
.m-overflow-label   { font-size: 0.7rem; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.05em; width: 2.5rem; flex-shrink: 0; }

/* ── Mobile card sub-rows ── */
.m-card-notes       { margin-top: 0.5rem; margin-left: 2rem; }

/* ── Queue components ── */
.queue-pill-tag {
  width: 6.5rem;
  padding: 0.125rem 0.5rem;
}
.queue-needed-badge {
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
}
.queue-row-meta {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.75rem 0.5rem 3rem;
}
.queue-row-meta-text { font-size: 0.75rem; color: #9ca3af; }
.queue-row-meta-btn {
  font-size: 0.75rem;
  font-weight: 500;
  color: #374151;
  background: white;
  border: 1px solid #9ca3af;
  border-radius: 0.375rem;
  padding: 0.125rem 0.625rem;
  cursor: pointer;
}
.queue-row-meta-btn:hover { background: #f9fafb; }

/* ── Queue responsive ── */
@media (max-width: 639px) {
  .queue-pill { display: none !important; }
  .queue-row-meta { display: flex !important; }
  .queue-zoom-btns { display: none !important; }
  .queue-btn-desktop { display: none !important; }
}

/* ── Tooltip ── */
.setup-tooltip {
  visibility: hidden;
  position: absolute;
  left: 1.25rem;
  top: -0.25rem;
  z-index: 50;
  width: 15rem;
  background: #111827;
  color: white;
  font-size: 0.75rem;
  line-height: 1.6;
  border-radius: 0.25rem;
  padding: 0.5rem 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.15);
}

/* ── Inspection page ── */
.inspection-section { padding-left: 1.25rem; padding-right: 1.25rem; }

.inspection-badge {
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9999px;
  white-space: nowrap;
}
.inspection-badge--in-progress { background: #fef9c3; color: #854d0e; }
.inspection-badge--passed      { background: #f0fdf4; color: #16a34a; }
.inspection-badge--failed      { background: #fef2f2; color: #dc2626; }

.inspection-result-btn {
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  background: white;
  color: #6b7280;
}
.inspection-item-label { width: 120px; flex-shrink: 0; }

.inspection-result-value { font-weight: 600; min-width: 2.5rem; }
.inspection-result-value--pass { color: #16a34a; }
.inspection-result-value--fail { color: #dc2626; }
.inspection-result-value--na   { color: #6b7280; }

.inspection-btn-fail { background: #dc2626; }
.inspection-btn-pass { background: #16a34a; }

/* ── Inspection button group ── */
.insp-btn-group {
  display: inline-flex;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  overflow: hidden;
  font-size: 0.75rem;
  line-height: 1;
}
.insp-btn-state {
  padding: 0.3rem 0.5rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  border-right: 1px solid #d1d5db;
}
.insp-btn-state:hover { background: #f9fafb; }

.insp-state--not-started { color: #6b7280; background: #f9fafb; }
.insp-state--in-progress { color: #92400e; background: #fefce8; }
.insp-state--failed      { color: #991b1b; background: #fef2f2; }
.insp-state--passed      { color: #166534; background: #f0fdf4; }

.insp-btn-pass {
  padding: 0.3rem 0.5rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  line-height: 1;
}
.insp-pass--off {
  color: #9ca3af;
  background: #f9fafb;
}
.insp-pass--off:hover { background: #f0fdf4; color: #16a34a; }
.insp-pass--on {
  color: white;
  background: #16a34a;
}
.insp-pass--on:hover { background: #15803d; }

/* ── Auto-save border flash ── */
.input-saved {
  border-color: #22c55e !important;
  transition: border-color 0.15s ease-in;
}
.input-saved-fade {
  border-color: #d1d5db !important;
  transition: border-color 1s ease-out;
}

/* ── Destructive confirm modal ── */
.dc-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.dc-dialog {
  background: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  width: 100%;
  max-width: 24rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.dc-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.5rem;
}
.dc-message {
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.5;
  margin-bottom: 1rem;
}
.dc-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.375rem;
}
.dc-input {
  width: 100%;
  font-size: 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
  box-sizing: border-box;
}
.dc-input:focus {
  outline: none;
  border-color: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}
.dc-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}
.dc-cancel {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  cursor: pointer;
}
.dc-cancel:hover { background: #f9fafb; }
.dc-submit {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: white;
  background: #d1d5db;
  border: none;
  border-radius: 0.375rem;
  cursor: not-allowed;
}
.dc-submit--enabled {
  background: #dc2626;
  cursor: pointer;
}
.dc-submit--enabled:hover { background: #b91c1c; }

/* ── Timer color shifts ── */
.timer-warning  { color: #f59e0b; }
.timer-critical { color: #ef4444; }
.timer-zero     { color: #ef4444; animation: timer-pulse 1s ease-in-out infinite; }
@keyframes timer-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}

/* ── Arena view components ── */
.arena-page {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}
.arena-panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.arena-panel.hidden {
  display: none;
}
.arena-match-container {
  flex: 1;
  min-height: 0;
  max-width: 24rem;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  overflow: hidden;
}
.arena-action-btn {
  padding-top: 2rem !important;
  padding-bottom: 2rem !important;
  flex-shrink: 0 !important;
}
.arena-robot-name {
  font-size: 1.875rem;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.arena-robot-name--shrink {
  font-size: 1.5rem;
}
