/* src/styles.css */
:root {
  color: #eef2f5;
  font-synthesis: none;
  background: #0f1115;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Noto Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;
  line-height: 1.6;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
}

button, input {
  font: inherit;
}

a {
  color: inherit;
}

.shell {
  background: radial-gradient(at top, #3b82f626, #0000 50%), radial-gradient(at 100% 100%, #8bc4cf1a, #0000 50%), #0f1115;
  min-height: 100vh;
  padding: 32px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items:  center;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto 32px;
}

.eyebrow {
  color: #60a5fa;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin: 0 0 6px;
  font-size: .75rem;
  font-weight: 600;
}

h1 {
  letter-spacing: -.02em;
  background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
  -webkit-text-fill-color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
}

.timer {
  backdrop-filter: blur(10px);
  text-align: right;
  background: #ffffff0d;
  border: 1px solid #ffffff1a;
  border-radius: 12px;
  min-width: 160px;
  padding: 16px 20px;
  box-shadow: 0 4px 6px -1px #0000001a, 0 2px 4px -1px #0000000f;
}

.timer span {
  display: block;
  font-variant-numeric: tabular-nums;
  color: #f0f9ff;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.timer small {
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: .75rem;
  font-weight: 500;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.primary, .sidePanel {
  min-width: 0;
}

.primary {
  position: relative;
}

.startPanel, .uploadProgressPanel {
  display: grid;
  backdrop-filter: blur(20px);
  background: #ffffff08;
  border: 1px solid #ffffff14;
  border-radius: 16px;
  align-content:  center;
  min-height: 580px;
  padding: 48px;
  box-shadow: 0 8px 32px #0000004d;
}

.uploadProgressContent {
  text-align: center;
}

.uploadSpinner {
  animation: spin 2s linear infinite;
  margin-bottom: 24px;
  font-size: 4rem;
}

@keyframes spin {
  from {
    transform: rotate(0);
  }

  to {
    transform: rotate(360deg);
  }
}

.uploadProgressContent h2 {
  color: #f0f9ff;
  margin: 0 0 16px;
  font-size: 2rem;
  font-weight: 700;
}

.uploadProgressContent .warning {
  color: #fbbf24;
  background: #fbbf241a;
  border: 1px solid #fbbf2433;
  border-radius: 8px;
  margin: 0 0 16px;
  padding: 12px 16px;
  font-size: 1.1rem;
  font-weight: 600;
}

.uploadProgressContent .uploadStatus {
  color: #94a3b8;
  margin: 0;
  font-size: 1rem;
}

.completionPanel {
  display: grid;
  backdrop-filter: blur(20px);
  background: #ffffff08;
  border: 1px solid #ffffff14;
  border-radius: 16px;
  align-content:  center;
  min-height: 580px;
  padding: 48px;
  box-shadow: 0 8px 32px #0000004d;
}

.completionContent {
  text-align: center;
}

.completionIcon {
  animation: scaleIn .5s ease-out;
  margin-bottom: 24px;
  font-size: 5rem;
}

@keyframes scaleIn {
  from {
    transform: scale(0);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.completionContent h2 {
  color: #34d399;
  margin: 0 0 16px;
  font-size: 2.5rem;
  font-weight: 700;
}

.completionContent > p {
  color: #f0f9ff;
  margin: 0 0 12px;
  font-size: 1.3rem;
  font-weight: 500;
}

.completionContent .completionDetails {
  color: #94a3b8;
  background: #34d3991a;
  border: 1px solid #34d39933;
  border-radius: 8px;
  margin: 24px 0 0;
  padding: 16px;
  font-size: 1rem;
}

.startPanel label {
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 10px;
  font-size: .875rem;
  font-weight: 600;
}

.startRow {
  display: flex;
  gap: 12px;
}

.startRow input {
  color: #f0f9ff;
  outline: none;
  background: #0000004d;
  border: 1px solid #ffffff1a;
  border-radius: 10px;
  width: min(520px, 100%);
  min-height: 52px;
  padding: 0 18px;
  transition: all .2s;
  font-size: 1rem;
}

.startRow input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px #60a5fa1a;
}

.startRow input::placeholder {
  color: #64748b;
}

.startRow button, .downloadButton, .endButton {
  color: #0f172a;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  white-space: nowrap;
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  border: 0;
  border-radius: 10px;
  justify-content: center;
  align-items:  center;
  min-height: 52px;
  padding: 0 24px;
  transition: all .2s;
  font-size: 1rem;
  font-weight: 600;
  box-shadow: 0 4px 12px #3b82f64d;
}

.startRow button:hover:not(:disabled), .downloadButton:hover:not(:disabled), .endButton:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px #3b82f666;
}

.startRow button:active:not(:disabled), .downloadButton:active:not(:disabled), .endButton:active:not(:disabled) {
  transform: translateY(0);
}

.startRow button:disabled, .endButton:disabled {
  cursor: not-allowed;
  opacity: .5;
  box-shadow: none;
  transform: none;
}

.error {
  color: #f87171;
  background: #f871711a;
  border: 1px solid #f8717133;
  border-radius: 8px;
  margin: 16px 0 0;
  padding: 12px 16px;
  font-weight: 500;
}

.recordingPanel {
  display: grid;
  gap: 16px;
}

.codeUploadPanel {
  display: grid;
  backdrop-filter: blur(10px);
  background: #ffffff08;
  border: 1px solid #ffffff14;
  border-radius: 12px;
  gap: 16px;
  margin-top: 20px;
  padding: 28px;
}

.codeUploadPanel label {
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: .875rem;
  font-weight: 600;
}

.fileRow {
  display: flex;
  align-items:  center;
  gap: 12px;
}

.fileRow input {
  color: #f0f9ff;
  background: #0000004d;
  border: 1px solid #ffffff1a;
  border-radius: 10px;
  flex: 1;
  min-width: 0;
  min-height: 52px;
  padding: 12px 16px;
  transition: all .2s;
  font-size: .95rem;
}

.fileRow input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px #60a5fa1a;
}

.fileRow button {
  color: #0f172a;
  cursor: pointer;
  white-space: nowrap;
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  border: 0;
  border-radius: 10px;
  min-height: 52px;
  padding: 0 24px;
  transition: all .2s;
  font-size: 1rem;
  font-weight: 600;
  box-shadow: 0 4px 12px #3b82f64d;
}

.fileRow button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px #3b82f666;
}

.fileRow button:active:not(:disabled) {
  transform: translateY(0);
}

.fileRow button:disabled {
  cursor: not-allowed;
  opacity: .5;
  box-shadow: none;
  transform: none;
}

.hint, .success {
  color: #94a3b8;
  margin: 0;
  font-size: .95rem;
}

.success {
  color: #34d399;
  font-weight: 500;
}

.previewCanvas {
  display: block;
  aspect-ratio: 16 / 9;
  background: #0f172a;
  border: 1px solid #ffffff14;
  border-radius: 12px;
  width: 100%;
  box-shadow: 0 4px 12px #0003;
}

.hiddenCanvas {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.endButton {
  color: #fff7f2;
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
  box-shadow: 0 4px 12px #ef44444d;
}

.endButton:hover:not(:disabled) {
  box-shadow: 0 6px 16px #ef444466;
}

.sidePanel {
  display: grid;
  align-content:  start;
  gap: 20px;
}

.hiddenVideo {
  position: fixed;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.statusList {
  display: grid;
  overflow: hidden;
  background: #ffffff0d;
  border: 1px solid #ffffff14;
  border-radius: 12px;
  gap: 1px;
  margin: 0;
}

.statusList div {
  background: #ffffff05;
  padding: 16px;
  transition: background .2s;
}

.statusList div:hover {
  background: #ffffff0a;
}

.statusList dt {
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 4px;
  font-size: .75rem;
  font-weight: 600;
}

.statusList dd {
  overflow-wrap: anywhere;
  color: #e2e8f0;
  margin: 0;
  font-size: .95rem;
}

@media (max-width: 820px) {
  .shell {
    padding: 20px;
  }

  .topbar, .workspace {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
  }

  .timer {
    text-align: left;
    min-width: auto;
  }

  .startPanel, .uploadProgressPanel, .completionPanel {
    min-height: 420px;
    padding: 32px;
  }

  .startRow, .fileRow, .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .startRow button, .fileRow button, .downloadButton, .endButton {
    width: 100%;
  }
}
