/* World Cup 2026 Pool - Shared Styles */

/* Color scheme */
:root {
  color-scheme: light;
}

/* Typography - Space Grotesk font applied via HTML link */
body {
  font-family: "Space Grotesk", sans-serif;
}

/* Drag and drop animations for grid view */
table tbody tr {
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

table tbody tr.dragging {
  transform: scale(1.02);
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.18);
  background-color: #ffffff;
}

table tbody tr.dragging td {
  background-color: #ffffff;
}

table tbody.drag-active tr.drag-over {
  transform: translateY(4px);
}

table tbody tr.drag-over td {
  background-color: #f8fafc;
}

/* Print styles for card and grid views */
@media print {
  body {
    background: white !important;
    color: #0f172a;
  }

  header,
  section,
  article {
    box-shadow: none !important;
  }

  .no-print {
    display: none !important;
  }

  .sticky {
    position: static !important;
  }

  main {
    padding: 0 !important;
  }

  table {
    font-size: 10px;
  }

  th,
  td {
    padding: 4px 6px !important;
  }
}

/* ========================================
   Print Pool Page Specific Styles
   ======================================== */

.print-page * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.print-page body {
  font-family: 'Arial', sans-serif;
  font-size: 8px;
  line-height: 1.3;
  background: white;
  color: #000;
  padding: 0.5in 0.4in;
}

/* Header */
.print-page .header {
  margin-bottom: 16px;
  border-bottom: 2px solid #000;
  padding-bottom: 8px;
}

.print-page .header h1 {
  font-size: 18px;
  margin-bottom: 4px;
  font-weight: bold;
}

.print-page .header .meta {
  font-size: 8px;
  color: #444;
}

/* Group Matches Section */
.print-page .section-title {
  font-size: 13px;
  font-weight: bold;
  margin: 12px 0 6px 0;
  border-bottom: 1px solid #666;
  padding-bottom: 2px;
}

.print-page .groups-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.print-page .group-section {
  border: 1px solid #ccc;
  padding: 4px;
  page-break-inside: avoid;
}

.print-page .group-title {
  font-size: 10px;
  font-weight: bold;
  margin-bottom: 3px;
  padding: 2px 4px;
  background: #f0f0f0;
}

.print-page .group-matches-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 6.5px;
}

.print-page .group-matches-table th {
  background: #e8e8e8;
  padding: 1px 2px;
  text-align: left;
  font-weight: bold;
  border: 1px solid #ccc;
}

.print-page .group-matches-table th:last-child {
  text-align: center;
}

.print-page .group-matches-table td {
  padding: 1px 2px;
  border: 1px solid #ddd;
}

.print-page .group-matches-table td:nth-child(2) {
  text-align: center;
}

.print-page .group-matches-table .pick-cell {
  text-align: center;
  font-weight: bold;
}

.print-page .group-matches-table .pick-home { background: #d4f4dd; }
.print-page .group-matches-table .pick-draw { background: #fff4d4; }
.print-page .group-matches-table .pick-away { background: #ffd4d4; }

.print-page .team-name {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.print-page .flag {
  width: 10px;
  height: 7px;
  object-fit: cover;
  border: 0.5px solid #ddd;
}

/* Standings Grid */
.print-page .standings-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}

.print-page .standing-box {
  border: 1px solid #ccc;
  padding: 3px;
  page-break-inside: avoid;
}

.print-page .standing-title {
  font-size: 9px;
  font-weight: bold;
  margin-bottom: 2px;
  padding: 2px;
  background: #e8e8e8;
  text-align: center;
}

.print-page .standing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 6px;
}

.print-page .standing-table th {
  background: #f5f5f5;
  padding: 1px 2px;
  text-align: center;
  font-weight: bold;
  border: 0.5px solid #ddd;
}

.print-page .standing-table th:first-child {
  text-align: left;
}

.print-page .standing-table td {
  padding: 1px 2px;
  border: 0.5px solid #ddd;
  text-align: center;
}

.print-page .standing-table td:first-child {
  text-align: left;
}

.print-page .standing-table .qualified { background: #d4f4dd; font-weight: bold; }
.print-page .standing-table .third { background: #fff4d4; font-style: italic; }

/* Knockout Bracket */
.print-page .bracket-container {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.print-page .bracket-round {
  flex: 1;
  min-width: 0;
}

.print-page .round-title {
  font-size: 9px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 4px;
  padding: 2px;
  background: #e8e8e8;
}

.print-page .bracket-match {
  border: 1px solid #ccc;
  margin-bottom: 4px;
  padding: 3px;
  font-size: 6.5px;
  page-break-inside: avoid;
}

.print-page .bracket-team {
  padding: 1px 2px;
  margin: 1px 0;
}

.print-page .bracket-team.winner {
  background: #d4f4dd;
  font-weight: bold;
}

.print-page .bracket-team.loser {
  color: #999;
}

/* Final Results */
.print-page .results-box {
  border: 2px solid #000;
  padding: 8px;
  margin-top: 16px;
  text-align: center;
}

.print-page .results-box .champion {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 6px;
}

.print-page .results-box .third-place {
  font-size: 11px;
  margin-top: 6px;
}

/* Page break control */
.print-page .page-break {
  page-break-after: always;
}

.print-page .no-break {
  page-break-inside: avoid;
}

/* Print-specific styles for print page */
@media print {
  .print-page {
    /* Page setup */
  }

  @page {
    size: letter portrait;
    margin: 0.5in 0.4in;
  }

  .print-page * {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .print-page body {
    padding: 0;
  }
}

@media screen {
  .print-page body {
    max-width: 8.5in;
    margin: 20px auto;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    padding: 0.5in 0.4in;
  }
}

/* ========================================
   Landing Page Specific Styles
   ======================================== */

/* Tab content transitions */
.tab-content {
  animation: fadeIn 200ms ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Dropzone drag state */
#dropzone.drag-active {
  border-color: #10b981;
  background-color: rgba(16, 185, 129, 0.05);
}

/* Camera scan overlay animation */
#scan-overlay::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #10b981, transparent);
  animation: scanLine 2s ease-in-out infinite;
}

@keyframes scanLine {
  0% {
    top: 0;
  }
  50% {
    top: calc(100% - 3px);
  }
  100% {
    top: 0;
  }
}

/* Video mirror effect for front camera */
#camera-preview.mirror {
  transform: scaleX(-1);
}

/* How It Works step cards hover effect */
.step-card {
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.step-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}
