/* PCB Module Specific Styles */

.pcb-module {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 36px;
  gap: 24px;
  overflow: hidden;
  background: transparent;
}

.pcb-module__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.pcb-module__content {
  flex: 1;
  display: grid;
  grid-template-columns: 1.2fr 480px;
  gap: 24px;
  min-height: 0;
  overflow: hidden;
}

.pcb-module__feed {
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(10px) saturate(150%);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  order: 1;
}

.pcb-module__feed-container {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#pcbWebcam {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  z-index: 0;
}

.pcb-mock-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  z-index: 1;
  transition: opacity 0.8s ease-in;
}

.detection-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* Scanning Line Animation - ALWAYS CENTERED */
.scanning-line {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 3px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(0, 242, 255, 0.8),
    rgba(57, 255, 20, 0.8),
    rgba(0, 242, 255, 0.8),
    transparent
  );
  box-shadow: 0 0 10px rgba(0, 242, 255, 0.6),
              0 0 20px rgba(57, 255, 20, 0.4);
  z-index: 5;
  opacity: 0;
  transition: opacity 0.3s ease;
  animation: none;
}

.scanning-line.active {
  opacity: 1;
  animation: scanLine 3s linear infinite;
}

@keyframes scanLine {
  0% {
    top: 0;
    opacity: 0;
  }
  5% {
    opacity: 1;
  }
  95% {
    opacity: 1;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}

/* HUD Scan Rings - ALWAYS CENTERED */
.pcb-module__feed .hud-scan {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
}

.pcb-module__sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  order: 2;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 242, 255, 0.4) transparent;
}

.pcb-module__sidebar::-webkit-scrollbar {
  width: 6px;
}

.pcb-module__sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.pcb-module__sidebar::-webkit-scrollbar-thumb {
  background: rgba(0, 242, 255, 0.4);
  border-radius: 3px;
}

.pcb-module__sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 242, 255, 0.6);
}

/* Status Indicator */
.status-indicator {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(15px) saturate(180%);
  -webkit-backdrop-filter: blur(15px) saturate(180%);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
  transition: var(--transition);
}

.status-indicator--pending {
  border-color: rgba(148, 163, 184, 0.3);
}

.status-indicator--pass {
  border-color: var(--accent-green);
  box-shadow: 0 0 30px rgba(57, 255, 20, 0.4);
  background: rgba(57, 255, 20, 0.05);
}

.status-indicator--fail {
  border-color: var(--danger);
  box-shadow: 0 0 30px rgba(255, 95, 109, 0.4);
  background: rgba(255, 95, 109, 0.05);
}

.status-indicator__icon {
  font-size: 64px;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 12px currentColor);
}

.status-indicator--pass .status-indicator__icon {
  color: var(--accent-green);
}

.status-indicator--fail .status-indicator__icon {
  color: var(--danger);
}

.status-indicator__text {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

.status-indicator--pass .status-indicator__text {
  color: var(--accent-green);
}

.status-indicator--fail .status-indicator__text {
  color: var(--danger);
}

/* Checklist Panel */
.checklist-panel {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid rgba(0, 242, 255, 0.25);
  box-shadow: var(--glow-soft);
}

.checklist-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.checklist-panel__header h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.component-checklist {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checklist-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
  cursor: pointer;
}

.checklist-item:hover {
  border-color: var(--accent-cyan);
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(4px);
}

.checklist-item--checked {
  border-color: var(--accent-green);
  background: rgba(74, 222, 128, 0.1);
}

.checklist-item--missing {
  border-color: var(--danger);
  background: rgba(255, 95, 109, 0.1);
  animation: pulseMissing 2s ease-in-out infinite;
}

@keyframes pulseMissing {
  0%, 100% {
    box-shadow: 0 0 0 rgba(255, 95, 109, 0);
  }
  50% {
    box-shadow: 0 0 12px rgba(255, 95, 109, 0.4);
  }
}

.checklist-item__checkbox {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(148, 163, 184, 0.4);
  border-radius: 6px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: var(--transition);
}

.checklist-item--checked .checklist-item__checkbox {
  border-color: var(--accent-green);
  background: var(--accent-green);
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.4);
}

.checklist-item__checkbox::after {
  content: "✓";
  color: var(--bg);
  font-weight: 700;
  font-size: 16px;
  opacity: 0;
  transition: var(--transition);
}

.checklist-item--checked .checklist-item__checkbox::after {
  opacity: 1;
}

.checklist-item__info {
  flex: 1;
}

.checklist-item__name {
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

.checklist-item__description {
  font-size: 13px;
  color: var(--muted);
}

.checklist-item__count {
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 12px;
}

.action-buttons .btn {
  flex: 1;
}

/* Reporting Panel */
.reporting-panel {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.reporting-panel__header {
  margin-bottom: 16px;
}

.reporting-panel__header h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reporting-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reporting-actions .btn {
  width: 100%;
  justify-content: flex-start;
}

/* Evidence Vault */
.modal__body--single {
  display: block !important;
  grid-template-columns: 1fr !important;
}

.modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modal__header .btn--icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: var(--muted);
  cursor: pointer;
  transition: var(--transition);
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}

.modal__header .btn--icon:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(255, 95, 109, 0.1);
}

.evidence-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  max-height: 600px;
  overflow-y: auto;
  padding: 16px;
  padding-right: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 242, 255, 0.4) transparent;
}

.evidence-gallery::-webkit-scrollbar {
  width: 6px;
}

.evidence-gallery::-webkit-scrollbar-track {
  background: transparent;
}

.evidence-gallery::-webkit-scrollbar-thumb {
  background: rgba(0, 242, 255, 0.4);
  border-radius: 3px;
}

.evidence-gallery::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 242, 255, 0.6);
}

.evidence-item {
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: var(--transition);
}

.evidence-item:hover {
  border-color: var(--danger);
  box-shadow: 0 0 12px rgba(255, 95, 109, 0.3);
}

.evidence-item__image {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 12px;
  background: var(--panel-strong);
}

.evidence-item__meta {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.evidence-item__reason {
  font-size: 14px;
  color: var(--danger);
  font-weight: 600;
  margin-bottom: 12px;
}

.evidence-item__actions {
  display: flex;
  gap: 8px;
}

.evidence-item__actions .btn {
  flex: 1;
  padding: 8px;
  font-size: 12px;
}

.no-evidence {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.form__help {
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0 0;
  line-height: 1.5;
}

.sync-status {
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
}

.sync-status--success {
  background: rgba(57, 255, 20, 0.1);
  border: 1px solid var(--accent-green);
  color: var(--accent-green);
}

.sync-status--error {
  background: rgba(255, 95, 109, 0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
}

.sync-status--loading {
  background: rgba(0, 242, 255, 0.1);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
}

/* =========================================
   RESPONSIVE - ALWAYS SIDE BY SIDE
   ========================================= */

/* Large Desktop */
@media (min-width: 1400px) {
  .pcb-module__content {
    grid-template-columns: 1.3fr 500px;
  }
}

/* Standard Desktop */
@media (min-width: 1200px) and (max-width: 1399px) {
  .pcb-module__content {
    grid-template-columns: 1.2fr 480px;
  }
}

/* Medium Desktop */
@media (min-width: 1024px) and (max-width: 1199px) {
  .pcb-module__content {
    grid-template-columns: 1fr 420px;
  }
}

/* Small Desktop / Large Tablet */
@media (min-width: 900px) and (max-width: 1023px) {
  .pcb-module__content {
    grid-template-columns: 1fr 380px;
  }
  
  .pcb-module {
    padding: 24px 30px;
  }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 899px) {
  .pcb-module__content {
    grid-template-columns: 1.1fr 340px;
    gap: 20px;
  }
  
  .pcb-module {
    padding: 20px 24px;
  }
  
  .pcb-module__feed-container {
    min-height: 400px;
  }
}

/* Large Mobile / Small Tablet */
@media (min-width: 600px) and (max-width: 767px) {
  .pcb-module__content {
    grid-template-columns: 1.2fr 300px;
    gap: 16px;
  }
  
  .pcb-module {
    padding: 16px 20px;
  }
  
  .pcb-module__feed-container {
    min-height: 350px;
  }
  
  .status-indicator {
    padding: 24px;
  }
  
  .status-indicator__icon {
    font-size: 48px;
  }
  
  .status-indicator__text {
    font-size: 18px;
  }
  
  .checklist-panel {
    padding: 16px;
  }
  
  .checklist-item {
    padding: 12px;
  }
}

/* Medium Mobile */
@media (min-width: 480px) and (max-width: 599px) {
  .pcb-module__content {
    grid-template-columns: 1fr 260px;
    gap: 12px;
  }
  
  .pcb-module {
    padding: 14px 16px;
  }
  
  .pcb-module__feed-container {
    min-height: 300px;
  }
  
  .status-indicator {
    padding: 20px;
  }
  
  .status-indicator__icon {
    font-size: 40px;
  }
  
  .status-indicator__text {
    font-size: 16px;
  }
  
  .checklist-panel {
    padding: 14px;
    font-size: 13px;
  }
  
  .checklist-panel__header h3 {
    font-size: 15px;
  }
  
  .checklist-item {
    padding: 10px;
  }
  
  .checklist-item__checkbox {
    width: 20px;
    height: 20px;
  }
  
  .checklist-item__name {
    font-size: 13px;
  }
  
  .checklist-item__description {
    font-size: 11px;
  }
}

/* Small Mobile */
@media (max-width: 479px) {
  .pcb-module__content {
    grid-template-columns: 1fr 220px;
    gap: 10px;
  }
  
  .pcb-module {
    padding: 12px 14px;
  }
  
  .pcb-module__feed-container {
    min-height: 280px;
  }
  
  .status-indicator {
    padding: 16px;
  }
  
  .status-indicator__icon {
    font-size: 36px;
    margin-bottom: 10px;
  }
  
  .status-indicator__text {
    font-size: 14px;
  }
  
  .checklist-panel {
    padding: 12px;
    font-size: 12px;
  }
  
  .checklist-panel__header h3 {
    font-size: 14px;
  }
  
  .checklist-item {
    padding: 8px;
  }
  
  .checklist-item__checkbox {
    width: 18px;
    height: 18px;
  }
  
  .checklist-item__checkbox::after {
    font-size: 12px;
  }
  
  .checklist-item__name {
    font-size: 12px;
  }
  
  .checklist-item__description {
    font-size: 10px;
  }
  
  .checklist-item__count {
    font-size: 11px;
  }
  
  .action-buttons {
    gap: 8px;
  }
  
  .action-buttons .btn {
    padding: 8px 10px;
    font-size: 11px;
  }
  
  .reporting-panel {
    padding: 12px;
  }
  
  .reporting-panel__header h3 {
    font-size: 14px;
  }
  
  .reporting-actions .btn {
    padding: 8px 10px;
    font-size: 11px;
  }
}

/* Extra Small Mobile */
@media (max-width: 380px) {
  .pcb-module__content {
    grid-template-columns: 1fr 180px;
    gap: 8px;
  }
  
  .pcb-module {
    padding: 10px 12px;
  }
  
  .status-indicator {
    padding: 14px;
  }
  
  .checklist-panel {
    padding: 10px;
  }
}

/* KIOSK MODE – 800x480 */
@media (min-width: 480px) and (max-width: 800px) and (min-height: 320px) and (max-height: 480px) {
  html, body {
    width: 100vw;
    height: 100vh;
    margin: 0;
    overflow: hidden;
    font-size: 12px;
  }

  .pcb-module {
    padding: 12px 16px;
    gap: 12px;
    height: 100vh;
  }

  .pcb-module__header {
    padding-bottom: 8px;
  }

  .pcb-module__content {
    grid-template-columns: 1.2fr 0.8fr;
    gap: 12px;
    height: calc(100vh - 80px);
  }

  .pcb-module__feed {
    border-radius: 14px;
    order: 1;
  }

  .pcb-module__feed-container {
    min-height: auto;
    height: 100%;
  }

  .hud-status {
    font-size: 8px;
    padding: 4px 8px;
    bottom: 8px;
    left: 8px;
  }

  .scanning-line {
    height: 2px;
  }

  .hud-scan__ring {
    width: 200px;
    height: 200px;
  }

  .hud-scan__ring--inner {
    width: 120px;
    height: 120px;
  }

  .pcb-module__sidebar {
    gap: 10px;
    padding-right: 2px;
    max-height: none;
    overflow-y: auto;
    order: 2;
  }

  .status-indicator {
    padding: 20px;
    border-radius: 14px;
  }

  .status-indicator__icon {
    font-size: 48px;
    margin-bottom: 12px;
  }

  .status-indicator__text {
    font-size: 18px;
  }

  .checklist-panel {
    padding: 12px;
    border-radius: 14px;
  }

  .checklist-panel__header {
    margin-bottom: 10px;
  }

  .checklist-panel__header h3 {
    font-size: 13px;
  }

  .component-checklist {
    gap: 8px;
  }

  .checklist-item {
    padding: 10px;
    border-radius: 10px;
  }

  .checklist-item__checkbox {
    width: 20px;
    height: 20px;
  }

  .checklist-item__checkbox::after {
    font-size: 14px;
  }

  .checklist-item__name {
    font-size: 12px;
    margin-bottom: 2px;
  }

  .checklist-item__description {
    font-size: 10px;
  }

  .checklist-item__count {
    font-size: 11px;
  }

  .action-buttons {
    gap: 8px;
  }

  .action-buttons .btn {
    padding: 10px 12px;
    font-size: 11px;
  }

  .reporting-panel {
    padding: 12px;
    border-radius: 14px;
  }

  .reporting-panel__header h3 {
    font-size: 13px;
    margin-bottom: 10px;
  }

  .reporting-actions {
    gap: 6px;
  }

  .reporting-actions .btn {
    padding: 10px 12px;
    font-size: 11px;
  }

  .modal--large {
    width: 92vw;
    max-height: 88vh;
  }

  .modal__header h2 {
    font-size: 14px;
  }

  .modal__header .btn--icon {
    width: 28px;
    height: 28px;
    font-size: 18px;
  }

  .evidence-gallery {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    max-height: 400px;
    padding: 12px;
  }

  .evidence-item {
    padding: 12px;
    border-radius: 10px;
  }

  .evidence-item__image {
    margin-bottom: 8px;
    border-radius: 6px;
  }

  .evidence-item__meta {
    font-size: 10px;
    margin-bottom: 6px;
  }

  .evidence-item__reason {
    font-size: 11px;
    margin-bottom: 8px;
  }

  .evidence-item__actions {
    gap: 6px;
  }

  .evidence-item__actions .btn {
    padding: 6px;
    font-size: 10px;
  }

  .no-evidence {
    padding: 40px 16px;
    font-size: 12px;
  }

  .form__help {
    font-size: 11px;
  }

  .sync-status {
    margin-top: 12px;
    padding: 10px;
    font-size: 11px;
  }
}

/* Landscape Mode - Keep side by side */
@media (max-height: 600px) and (orientation: landscape) {
  .pcb-module {
    padding: 12px 16px;
  }
  
  .pcb-module__content {
    grid-template-columns: 1.3fr 320px;
    gap: 16px;
  }
  
  .pcb-module__feed-container {
    min-height: 250px;
  }
}

/* Very Short Screens */
@media (max-height: 500px) {
  .pcb-module {
    padding: 10px 14px;
  }
  
  .pcb-module__content {
    grid-template-columns: 1.4fr 280px;
  }
  
  .pcb-module__feed-container {
    min-height: 200px;
  }
  
  .status-indicator {
    padding: 16px;
  }
  
  .checklist-panel {
    padding: 12px;
  }
}

/* HUD Scan Ring Scaling */
@media (max-width: 768px) {
  .hud-scan__ring {
    width: 280px;
    height: 280px;
  }
  
  .hud-scan__ring--inner {
    width: 170px;
    height: 170px;
  }
}

@media (max-width: 600px) {
  .hud-scan__ring {
    width: 220px;
    height: 220px;
  }
  
  .hud-scan__ring--inner {
    width: 130px;
    height: 130px;
  }
}

@media (max-width: 480px) {
  .hud-scan__ring {
    width: 180px;
    height: 180px;
  }
  
  .hud-scan__ring--inner {
    width: 110px;
    height: 110px;
  }
}

@media (max-width: 380px) {
  .hud-scan__ring {
    width: 150px;
    height: 150px;
  }
  
  .hud-scan__ring--inner {
    width: 90px;
    height: 90px;
  }
}

/* Scrollbar refinements for small screens */
@media (max-width: 768px) {
  .pcb-module__sidebar::-webkit-scrollbar,
  .evidence-gallery::-webkit-scrollbar {
    width: 4px;
  }
}


/* body {
    cursor: none;
} * {
    cursor: none !important;
} html {
    touch-action: manipulation; 
    -ms-touch-action: manipulation;
} */