:root {
  --background: #ffffff;
  --foreground: #020817;

  --muted: #f1f5f9;
  --muted-foreground: #64748b;

  --card: #ffffff;
  --card-foreground: #020817;

  --border: #e2e8f0;
  --input: #e2e8f0;

  --primary: #0f172a;
  --primary-foreground: #ffffff;

  --ring: #0f172a;

  --radius: 0.375rem;

  --font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --primary-color: var(--primary);
  --text-color: var(--foreground);
  --bg-color: var(--background);
  --border-color: var(--border);
  --error-color: #ef4444;

  --header-bg: rgba(255, 255, 255, 0.95);
  --header-bg-blur: rgba(255, 255, 255, 0.6);
  --muted-30: rgba(241, 245, 249, 0.3);

  color-scheme: light;
}

.dark {
  --background: #020817;
  --foreground: #f8fafc;
  --muted: #1e293b;
  --muted-foreground: #94a3b8;
  --card: #020817;
  --card-foreground: #f8fafc;
  --border: #1e293b;
  --input: #1e293b;
  --primary: #f8fafc;
  --primary-foreground: #020817;
  --ring: #cbd5e1;

  --header-bg: rgba(2, 8, 23, 0.95);
  --header-bg-blur: rgba(2, 8, 23, 0.6);
  --muted-30: rgba(30, 41, 59, 0.3);

  color-scheme: dark;
}

*,
::before,
::after {
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--background);
  color: var(--foreground);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 15% 50%, rgba(124, 58, 237, 0.08), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(59, 130, 246, 0.08), transparent 25%);
  z-index: -1;
  pointer-events: none;
}

.body-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem 2rem;
  background: transparent;
  flex: 1;
}

@media (max-width: 768px) {
  .body-container {
    padding: 2rem 1rem;
  }
}

.content-wrapper {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  border-bottom: 1px solid var(--border);
  background-color: var(--header-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

@supports (backdrop-filter: blur(8px)) {
  header {
    background-color: var(--header-bg-blur);
  }
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  height: 4rem;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  flex: 1 0 0;
  display: flex;
  align-items: center;
}

.nav-center {
  display: flex;
  align-items: center;
  gap: 2rem;
  justify-content: center;
}

.nav-right {
  flex: 1 0 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

@media (max-width: 768px) {
  .header-container {
    padding: 0 1rem;
    height: auto;
    padding-top: 1rem;
    padding-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .header-brand {
    flex: 0 0 auto;
  }

  .nav-right {
    flex: 0 0 auto;
  }

  .nav-center {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 1rem;
  }

  .nav-link {
    font-size: 0.8rem;
  }
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav-link:hover {
  color: var(--foreground);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--foreground);
  transition: opacity 0.2s;
}

.logo:hover {
  opacity: 0.8;
}

.logo-icon {
  display: flex;
  height: 2.25rem;
  width: 2.25rem;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
}

.logo-icon img {
  height: 100%;
  width: 100%;
  object-fit: contain;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.75rem;
}

h1,
h2,
h3 {
  letter-spacing: -0.025em;
  color: var(--foreground);
}

.main-title {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

@media (max-width: 768px) {
  .main-title {
    font-size: 1.75rem;
  }
}

.main-subtitle {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  text-align: center;
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 768px) {
  .main-subtitle {
    font-size: 0.9rem;
    margin-bottom: 2rem;
  }
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
  color: var(--foreground);
  text-align: center;
}

@media (max-width: 768px) {
  .section-title {
    font-size: 1.25rem;
  }
}

.subtitle {
  color: var(--muted-foreground);
  font-size: 1.125rem;
  line-height: 1.75rem;
  margin-top: 1rem;
}

.upload_file_section,
.upload_point_section {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  padding: 24px;
  margin-bottom: 40px;
  text-align: center;
  max-width: 896px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 768px) {
  .upload_file_section,
  .upload_point_section {
    padding: 16px;
    margin-bottom: 24px;
  }
}

.content-section {
  margin-top: 64px;
  text-align: center;
}

.about-section {
  text-align: left;
}

.upload-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.button-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  width: 100%;
}

@media (max-width: 640px) {
  .button-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 400px) {
  .button-grid {
    grid-template-columns: 1fr;
  }
}

.action-card-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  height: auto;
  padding: 1.5rem 1rem;

  background-color: var(--background);
  border: 1px solid var(--input);
  border-radius: 0.375rem;

  color: var(--foreground);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: normal;
  text-align: center;

  cursor: pointer;
  transition:
    background-color 0.2s,
    color 0.15s;
}

@media (max-width: 640px) {
  .action-card-btn {
    padding: 1rem 0.5rem;
    gap: 0.5rem;
  }

  .action-card-btn svg {
    width: 2rem;
    height: 2rem;
  }
}

.action-card-btn:hover {
  background-color: var(--muted);
  color: var(--foreground);
}

.action-card-btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px var(--ring),
    0 0 0 4px var(--background);
}

.action-card-btn svg {
  width: 2.4rem;
  height: 2.4rem;
  pointer-events: none;
  flex-shrink: 0;
}

input[type="text"],
input[type="number"],
input[type="file"],
input[type="date"] {
  width: 100%;
  border: 1px solid var(--input);
  background-color: transparent;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--foreground);
  transition:
    box-shadow 0.15s,
    border-color 0.15s;
  outline: none;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus {
  border-color: var(--ring);
  box-shadow: 0 0 0 1px var(--ring);
}

input::placeholder {
  color: var(--muted-foreground);
  opacity: 0.7;
}

/* Hide number input spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

.submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  min-height: 2.5rem;
  height: auto;
  padding: 0.5rem 1rem;
  background-color: var(--primary);
  color: var(--primary-foreground);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  width: 100%;
  white-space: normal;
  text-align: center;
  line-height: 1.25;
}

.submit-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.submit-btn:active {
  transform: translateY(0);
}

.button-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  width: 100%;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  justify-content: center;
  padding: 4px;
  background-color: var(--muted);
  color: var(--muted-foreground);
  border-radius: 6px;
  border: none;
  margin: 0 auto 2rem auto;
  width: 100%;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: normal;
  text-align: center;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
  height: auto;
  line-height: 1.2;
}

@media (max-width: 480px) {
  .tab-btn {
    font-size: 0.75rem;
    padding: 4px 6px;
  }
}

.tab-btn:hover {
  color: var(--foreground);
  background: transparent;
}

.tab-btn.active {
  background-color: var(--background);
  color: var(--foreground);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  font-weight: 500;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active {
  display: contents;
}

.tab-content.active {
  display: block;
  width: 100%;
}

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

.nspd-container {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  width: 100%;
  align-items: center;
}

.nspd-container input {
  flex: 1;
}

.nspd-container button {
  width: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.nspd-button-group {
  display: flex;
  gap: 10px;
  width: 100%;
  align-items: stretch;
}

.nspd-button-group button {
  flex: 1;
}

@media (max-width: 640px) {
  .nspd-button-group {
    flex-direction: column;
  }
}

.nspd-container .submit-btn,
#uploadBtn_oopt,
.manual-upload-container .submit-btn {
  background-color: var(--background);
  color: var(--foreground);
  border: 1px solid var(--input);
}

.nspd-container .submit-btn:hover,
#uploadBtn_oopt:hover,
.manual-upload-container .submit-btn:hover {
  background-color: var(--muted);
}

.accordion {
  width: 100%;
  max-width: 48rem;
  margin: 2rem auto 0;
}

.accordion-item {
  border-bottom: 1px solid #e5e7eb;
  background: transparent;
  transition: all 0.2s;
}

.accordion-item:last-child {
  border-bottom: none;
}

.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  cursor: pointer;
  background: transparent;
  transition: all 0.2s;
  font-size: 1rem;
  font-weight: 500;
  text-align: left;
  width: 100%;
  border: none;
  color: var(--foreground);
}

@media (max-width: 768px) {
  .accordion-header {
    padding: 0.75rem 0;
    font-size: 0.9rem;
  }

  .accordion-title {
    font-size: 0.9rem;
  }
}

.accordion-header:hover {
  text-decoration: underline;
}

.accordion-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
}

.accordion-header-main {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.accordion-logo {
  height: 24px;
  width: auto;
  object-fit: contain;
}

.accordion-icon {
  width: 20px;
  height: 20px;
  color: var(--muted-foreground);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.accordion-icon.active {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.accordion-content.active {
  max-height: 1200px;
}

.accordion-body {
  padding-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.6;
  text-align: left;
}

.terminal-section {
  margin-top: 3rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.terminal {
  background-color: #0c0a09;
  border: 1px solid #292524;
  border-radius: var(--radius);
  padding: 1.5rem;
  color: #a8a29e;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.terminal-prompt {
  color: #f59e0b;
}

.terminal-time {
  color: #57534e;
  margin-right: 0.75rem;
}

.terminal-text {
  color: #e7e5e4;
}

.terminal-success .terminal-text {
  color: #22c55e;
}

.terminal-error .terminal-text {
  color: #ef4444;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 1rem;
  -webkit-overflow-scrolling: touch;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 500px;
}

@media (max-width: 640px) {
  .nspd-container {
    flex-direction: column;
  }

  .nspd-container button {
    width: 100%;
  }
}

.manual-upload-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.coords-row {
  display: flex;
  gap: 10px;
  width: 100%;
}

.coords-row input {
  flex: 1;
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  max-width: 100%;
  margin-top: 20px;
  border-radius: var(--radius);
  background: #000;
}

.video-wrapper iframe,
.video-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.video-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 48px;
  background-color: rgba(33, 33, 33, 0.8);
  border-radius: 12px;
  transition: background-color 0.2s;
}

.video-placeholder:hover .play-button {
  background-color: #ff0000;
}

.play-button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 55%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent #ffffff;
}

.text-xs {
  font-size: 0.75rem;
  line-height: 1rem;
}

.text-sm {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.text-lg {
  font-size: 1.125rem;
  line-height: 1.75rem;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.tracking-tight {
  letter-spacing: -0.025em;
}

.text-muted-foreground {
  color: var(--muted-foreground);
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.no-underline {
  text-decoration: none;
}

.hover\:underline:hover {
  text-decoration: underline;
}

.mb-1 {
  margin-bottom: 0.25rem;
}

.action-card-btn p {
  margin: 0;
}

.footer {
  width: 100%;
  height: 64px;
  margin-top: 4rem;
  display: flex;
  align-items: center;
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
}

@media (max-width: 768px) {
  .footer-container {
    padding: 0 1rem;
  }
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (min-width: 768px) {
  .footer-content {
    flex-direction: row;
  }
}

.copyright {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  margin: 0;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-link {
  color: var(--muted-foreground);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: colors 0.2s;
}

.nav-link:hover {
  color: var(--foreground);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.user-avatar-placeholder {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background-color: var(--muted);
  border: 1px solid var(--border);
}

.nav-link.btn-login,
.nav-link.btn-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 500;
  height: 2.25rem;
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  background-color: var(--background);
  color: var(--foreground);
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link.btn-login:hover,
.nav-link.btn-logout:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

.btn-login:focus-visible,
.btn-logout:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px var(--background),
    0 0 0 4px var(--ring);
}

.btn-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--border);
  background-color: var(--background);
  color: var(--foreground);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-theme-toggle:hover {
  background-color: var(--muted);
  color: var(--foreground);
}

.btn-theme-toggle:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px var(--background),
    0 0 0 4px var(--ring);
}

.footer-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--foreground);
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background-color: rgb(0 0 0 / 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.15s ease-out;
}

.auth-overlay.flex {
  display: flex;
}

.auth-overlay.hidden {
  display: none;
}

.auth-modal {
  position: relative;
  width: 90%;
  max-width: 28rem;
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow:
    0 10px 15px -3px rgb(0 0 0 / 0.1),
    0 4px 6px -4px rgb(0 0 0 / 0.1);
  display: grid;
  gap: 1rem;
  animation: zoomIn 0.15s ease-out;
}

@media (max-width: 480px) {
  .auth-modal {
    padding: 1rem;
    gap: 0.75rem;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.auth-close-btn {
  position: absolute;
  right: 1rem;
  top: 1rem;
  border-radius: 0.125rem;
  opacity: 0.7;
  transition: opacity 200ms cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--muted-foreground);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-close-btn:hover {
  opacity: 1;
}

.auth-close-btn:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow:
    0 0 0 2px var(--background),
    0 0 0 4px var(--ring);
}

.auth-close-btn svg {
  width: 1rem;
  height: 1rem;
}

.auth-header {
  display: flex;
  flex-direction: column;
  text-align: center;
  gap: 0.375rem;
}

.auth-icon-wrapper {
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1rem;
  display: flex;
  height: 3rem;
  width: 3rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background-color: var(--muted);
}

.auth-icon-wrapper svg {
  color: var(--muted-foreground);
}

.auth-title {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--foreground);
}

.auth-description {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  text-align: center;
  margin: 0;
  line-height: 1.25rem;
}

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.btn-login-popup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  height: 2.5rem;
  padding: 0.5rem 1rem;
  background-color: var(--primary);
  color: var(--primary-foreground);
  text-decoration: none;
  transition: background-color 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-login-popup:hover {
  opacity: 0.9;
}

.footer-link svg {
  width: 1rem;
  height: 1rem;
  opacity: 0.8;
}

.border-t {
  border-top: 1px solid var(--border);
}

.bg-muted-30 {
  background-color: var(--muted-30);
}

.delineator {
  border: none;
  border-top: 3px solid;
  width: 100%;
  margin: 70px 0;
}
