@import url("https://fonts.googleapis.com/css2?family=Google+Sans&display=swap");

html,
body {
  margin: 0 !important;
  padding: 0;
  overflow: hidden;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
}

@font-face {
  font-family: "DingoFont";
  src: url("/public/assets/fonts/EngraversGothicRegular.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

#splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #f1f1ea;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#splash-screen img {
  height: 120px;
  margin-bottom: 24px;
  opacity: 0.95;
}

#splash-screen .loading-text {
  color: #c280d3;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 1px;
  opacity: 0.8;
}

#splash-screen .spinner {
  width: 40px;
  height: 40px;
  margin-top: 16px;
  border: 3px solid rgba(104, 66, 241, 0.8);
  border-top: 3px solid #f1f1ea;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#seo-info-widget {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#seo-info-card {
  width: min(320px, calc(100vw - 32px));
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(87, 93, 182, 0.18);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 48px rgba(26, 26, 46, 0.18);
  color: #22222a;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

#seo-info-card.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#seo-info-card h1 {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 600;
}

#seo-info-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #55556a;
}

#seo-info-card a {
  color: #575db6;
}

#seo-info-button {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 999px;
  color: #575db6;
  background-color: #ffffff;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
}

#seo-info-button:hover {
  background: #aaaaaa;
}

/* ── CAD Theme SEO Modal ── */

.cad-theme-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 18, 20, 0.15);
  animation: seoFadeIn 0.2s ease both;
  font-family:
    "Google Sans",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
}

.cad-theme-overlay.closing {
  animation: seoFadeOut 0.2s ease both;
}

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

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

.cad-theme-modal {
  width: 90%;
  max-width: 900px;
  height: 85vh;
  background: #1e1e1e;
  border: 1px solid #3a3a3a;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #d4d4d4;
  /* subtle inner shine like native windows */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 24px 64px rgba(0, 0, 0, 0.6);
}

/* Header / Title Bar */
.cad-modal-header {
  height: 36px;
  background: #2d2d2d;
  border-bottom: 1px solid #111;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  user-select: none;
}

.cad-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: monospace;
  font-size: 13px;
  color: #9cdcfe; /* typical vs code light blue or cad secondary color */
}

#seo-modal-close {
  background: transparent;
  border: none;
  color: #858585;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
}

#seo-modal-close:hover {
  background: #c42b1c;
  color: white;
}

/* Layout */
.cad-modal-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.cad-sidebar {
  width: 320px;
  background: #252526;
  border-right: 1px solid #333;
  display: flex;
  flex-direction: column;
  padding: 24px 20px;
  gap: 20px;
  overflow-y: auto;
}

.cad-main-viewport {
  flex: 1;
  position: relative;
  background: #1e1e1e;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Technical grid background for the 'viewport' */
.cad-viewport-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: center top;
  pointer-events: none;
  z-index: 0;
}

.cad-scrollable-content {
  position: relative;
  z-index: 1;
  padding: 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

/* Panels */
.cad-panel {
  background: rgba(30, 30, 30, 0.85);
  border: 1px solid #3a3a3a;
  padding: 20px;
  position: relative;
}

.cad-panel-header {
  position: absolute;
  top: -10px;
  left: 12px;
  background: #1e1e1e;
  padding: 0 6px;
  font-family: monospace;
  font-size: 11px;
  color: #ce9178; /* orange/brown string color */
  letter-spacing: 0.5px;
}

.cad-sidebar .cad-panel {
  background: transparent;
  border: none;
  padding: 0;
}

.cad-sidebar .cad-panel.cad-comparison-panel {
  background: rgba(45, 45, 45, 0.3);
  border: 1px solid #3a3a3a;
  padding: 20px;
  margin-top: auto;
}

.cad-sidebar .cad-panel-header {
  background: #252526;
  color: #4ec9b0;
}

/* Typography & Badges */
.cad-status-bar {
  margin-bottom: 20px;
}

.seo-badge {
  font-family: monospace;
  font-size: 11px;
  color: #4ec9b0;
  background: rgba(78, 201, 176, 0.1);
  border: 1px solid rgba(78, 201, 176, 0.4);
  padding: 4px 8px;
  display: inline-block;
}

.cad-sidebar h1 {
  margin: 0 0 16px;
  font-size: 32px;
  font-weight: 500;
  line-height: 1.15;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.seo-subtitle {
  font-size: 14px;
  line-height: 1.6;
  color: #cccccc;
  margin: 0 0 24px;
}

/* Primary Button */
.cad-primary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: #007acc;
  color: #ffffff;
  border: 1px solid #005a9e;
  padding: 12px 16px;
  font-family: "Google Sans", sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
}

.cad-primary-btn:hover {
  background: #0098ff;
  border-color: #007acc;
}

.cad-primary-btn .btn-icon {
  display: flex;
}

.cad-primary-btn:disabled {
  background: #3a3a3a;
  border-color: #333;
  cursor: default;
  color: #888;
}

.cad-primary-btn:disabled:hover {
  background: #3a3a3a;
  border-color: #333;
}

.cad-primary-btn .btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #888;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.cad-primary-btn.ready {
  background: #007acc;
  border-color: #005a9e;
  cursor: pointer;
  color: #ffffff;
}

.cad-primary-btn.ready:hover {
  background: #0098ff;
  border-color: #007acc;
}

/* Features inside main viewport */
.seo-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 8px;
}

.seo-feature-card {
  display: flex;
  gap: 14px;
  background: rgba(37, 37, 38, 0.6);
  border: 1px solid #3c3c3c;
  padding: 18px;
  transition:
    border-color 0.2s,
    background 0.2s;
}

.seo-feature-card:hover {
  border-color: #5a5a5a;
  background: rgba(45, 45, 45, 0.8);
}

.seo-feature-icon {
  color: #4fc1ff; /* Accent blue */
  flex-shrink: 0;
  margin-top: 2px;
}

.seo-feature-text h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 500;
  color: #eeeeee;
}

.seo-feature-text p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: #a6a6a6;
}

/* Use cases */
.seo-usecases {
  margin-top: 8px;
}

.seo-usecases h2,
.seo-comparison h2 {
  font-size: 15px;
  font-weight: 500;
  color: #eeeeee;
  margin: 0 0 16px;
}

.seo-usecase-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.seo-usecase-tags span {
  font-family: monospace;
  font-size: 12px;
  color: #dcdcaa; /* pale yellow/green */
  background: rgba(45, 45, 45, 0.6);
  border: 1px solid #444;
  padding: 4px 10px;
  transition:
    border-color 0.15s,
    background 0.15s;
}

.seo-usecase-tags span:hover {
  border-color: #dcdcaa;
  background: rgba(45, 45, 45, 0.9);
}

.seo-comparison p {
  font-size: 13px;
  line-height: 1.55;
  color: #a6a6a6;
  margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .cad-theme-modal {
    width: 96%;
    height: 96vh;
    border-radius: 6px;
  }
  .cad-modal-body {
    flex-direction: column;
    overflow-y: auto;
  }
  .cad-sidebar {
    width: auto;
    border-right: none;
    border-bottom: 1px solid #333;
    overflow: visible;
  }
  .cad-main-viewport {
    overflow: visible;
  }
  .seo-features {
    grid-template-columns: 1fr;
  }
}
