/*default mode*/
:root {
  --bg: #f5f5f5;
  --text: #222;
  --card: white;
  --border: #ddd;
}
/*dark mode*/
body.dark {
  --bg: #0f172a;
  --text: #e5e5e5;
  --card: #1e293b;
  --border: #334155;
}
/*dark mode button*/
.theme-btn {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}
.theme-btn:hover {
  opacity: 0.8;
}


/* base stuff */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 20px;
}

/*main container*/
.app {
  max-width: 800px;
  margin: 0 auto;
  background: var(--card);
  padding: 24px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

/*header h1*/
.app-header h1 {
  font-size: 1.8rem;
  margin-bottom: 6px;
}
/*header p*/
.app-header p {
  color: #555;
  font-size: 0.9rem;
  margin-bottom: 16px;
}
/*content*/
.app-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/*text area*/
#htmlInput {
  width: 100%;
  min-height: 180px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-family: monospace;
  font-size: 0.9rem;
  resize: vertical;
  line-height: 1.4;
}
#htmlInput::placeholder {
  color: #999;
}

/*analyze button*/
#analyzeBtn {
  align-self: flex-start;
  padding: 8px 16px;
  background: #0077ff;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
#analyzeBtn:hover {
  background: #005fcc;
}

/*clear button*/
.secondary-btn {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  color: var(--text);
}
.secondary-btn:hover {
  background: var(--border);
}


/*stats*/
#status {
  font-size: 0.8rem;
  color: #666;
}
/*for loading*/
.loading-dots::after {
  content: "…";
  animation: dots 1s steps(3, end) infinite;
}
@keyframes dots {
  0% { content: ""; }
  33% { content: "."; }
  66% { content: ".."; }
  100% { content: "..."; }
}


/*results*/
.results-header {
  font-size: 1.2rem;
  margin-top: 20px;
  margin-bottom: 6px;
  color: var(--text);
  font-weight: 600;
}
#results {
  margin-top: 10px;
  padding: 16px;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  min-height: 60px;
  font-size: 0.9rem;
}

/*status*/
#status {
  font-size: 0.85rem;
  margin-top: 4px;
}
#status.error {
  color: #c62828;
}
#status.success {
  color: #2e7d32;
}

/* code block styling for output */
.code-block {
  background: #1e1e1e;
  color: #e5e5e5;
  padding: 12px;
  border-radius: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid #333;
  margin-top: 8px;
}

/*footer*/
.footer {
  margin-top: 40px;
  text-align: center;
  font-size: 0.75rem;
  color: #777;
}
