/* ==========================================================================
   Game ID — Sync Modal & Drop Zone Styles
   Fluent 2 Design Language (Modal Elevation 16, Alpha plates, Token compliant)
   ========================================================================== */

/* Scrim / Backdrop */
.sync-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-fast) var(--ease-standard),
              visibility var(--t-fast) var(--ease-standard);
  padding: 24px;
}

.sync-scrim.active {
  opacity: 1;
  visibility: visible;
}

/* Modal Frame */
.sync-modal {
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  background: var(--bg-layer);
  border: 1px solid var(--stroke-default);
  border-radius: var(--r-xl);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.96) translateY(8px);
  transition: transform var(--t-normal) var(--ease-standard);
}

.sync-scrim.active .sync-modal {
  transform: scale(1) translateY(0);
}

/* Header */
.sync-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--stroke-divider);
}

.sync-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sync-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  background: var(--bg-chip);
  border: 1px solid var(--stroke-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-hover);
}

.sync-icon-badge svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sync-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--fg-primary);
  line-height: 1.2;
}

.sync-subtitle {
  font-size: 12px;
  color: var(--fg-secondary);
  margin-top: 2px;
}

.sync-close-btn {
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: var(--r-md);
  color: var(--fg-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast) var(--ease-standard);
}

.sync-close-btn:hover {
  background: var(--bg-layer-hover);
  color: var(--fg-primary);
}

.sync-close-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  fill: none;
}

/* Modal Body */
.sync-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Drop Zone */
.sync-dropzone {
  border: 2px dashed var(--stroke-control);
  border-radius: var(--r-lg);
  background: var(--bg-canvas);
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: all var(--t-normal) var(--ease-standard);
  position: relative;
}

.sync-dropzone:hover, .sync-dropzone.dragover {
  border-color: var(--brand-hover);
  background: var(--bg-nav-hover);
}

.sync-dropzone-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-circular);
  background: var(--bg-chip);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-hover);
  margin-bottom: 12px;
}

.sync-dropzone-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sync-dropzone-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg-primary);
  margin-bottom: 4px;
}

.sync-dropzone-desc {
  font-size: 13px;
  color: var(--fg-secondary);
  max-width: 480px;
  line-height: 1.5;
}

.sync-dropzone-hint {
  font-size: 11px;
  color: var(--fg-quaternary);
  margin-top: 10px;
}

.sync-file-input {
  display: none;
}

/* Extraction Progress */
.sync-progress {
  padding: 20px;
  background: var(--bg-canvas);
  border-radius: var(--r-lg);
  border: 1px solid var(--stroke-subtle);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sync-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-secondary);
}

.sync-progress-bar {
  height: 6px;
  background: var(--bg-subtle);
  border-radius: var(--r-circular);
  overflow: hidden;
  position: relative;
}

.sync-progress-fill {
  height: 100%;
  background: var(--brand-hover);
  border-radius: var(--r-circular);
  width: 30%;
  animation: pulseProgress 1.5s infinite ease-in-out;
}

@keyframes pulseProgress {
  0% { transform: translateX(-100%); width: 30%; }
  50% { width: 60%; }
  100% { transform: translateX(250%); width: 30%; }
}

/* Extraction Results Card */
.sync-results {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn var(--t-normal) var(--ease-standard);
}

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

.sync-success-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(94, 199, 94, 0.1);
  border: 1px solid var(--status-success-fg);
  border-radius: var(--r-md);
  color: var(--status-success-fg);
  font-size: 13px;
  font-weight: 500;
}

.sync-success-banner svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  flex-shrink: 0;
}

/* Account Info Card */
.sync-account-card {
  background: var(--bg-canvas);
  border: 1px solid var(--stroke-subtle);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sync-account-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sync-account-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--r-circular);
  background: var(--brand-rest);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
}

.sync-account-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--fg-primary);
}

.sync-account-sub {
  font-size: 12px;
  color: var(--fg-tertiary);
  margin-top: 2px;
}

.sync-account-details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--stroke-divider);
}

.sync-detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sync-detail-label {
  font-size: 11px;
  color: var(--fg-quaternary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sync-detail-val {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Connected Accounts List */
.sync-connected-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sync-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sync-connected-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}

.sync-connected-card {
  background: var(--bg-canvas);
  border: 1px solid var(--stroke-subtle);
  border-radius: var(--r-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sync-auth-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  background: var(--bg-chip);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.sync-auth-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sync-auth-type {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-primary);
  text-transform: capitalize;
}

.sync-auth-name {
  font-size: 11px;
  color: var(--fg-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Games list preview */
.sync-games-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sync-games-table-wrapper {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--stroke-subtle);
  border-radius: var(--r-md);
  background: var(--bg-canvas);
}

.sync-games-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.sync-games-table th {
  position: sticky;
  top: 0;
  background: var(--bg-subtle);
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--fg-secondary);
  border-bottom: 1px solid var(--stroke-divider);
}

.sync-games-table td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--stroke-divider);
  color: var(--fg-secondary);
}

.sync-games-table tr:last-child td {
  border-bottom: none;
}

/* Footer */
.sync-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--stroke-divider);
  background: var(--bg-canvas);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sync-footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-secondary {
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-primary);
  background: transparent;
  border: 1px solid var(--stroke-default);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-standard);
}

.btn-secondary:hover {
  background: var(--bg-layer-hover);
  border-color: var(--stroke-strong);
}

.btn-primary {
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  background: var(--brand-rest);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-standard);
}

.btn-primary:hover {
  background: var(--brand-hover);
}
