/* === Auto Theme Variables (Red Variant) === */
:root {
  --bg: #0a0a0a;
  --fg: #eee;
  --accent: #ff4d4d;         /* Warning Light Red */
  --accent-hover: #ff6666;   /* Hover Red */
  --font: monospace;
}

/* === Layout Reset === */
html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  height: auto !important;
  min-height: 100vh;
  overflow-y: auto !important;
}

body.tool-page {
  position: relative;
  background: var(--bg);
  padding: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255,77,77,0.05), transparent 80%);
  z-index: -1;
  pointer-events: none;
  mix-blend-mode: screen;
}

/* === Background Canvas === */
#cortex-auto {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  pointer-events: none;
}

/* === Main Container === */
main {
  max-width: 800px;
  margin: 4rem auto;
  padding: 2rem;
  background: linear-gradient(to bottom, rgba(255, 77, 77, 0.05), rgba(0, 0, 0, 0.4));
  backdrop-filter: blur(8px) saturate(120%);
  border: 1px solid rgba(255, 77, 77, 0.15);
  border-radius: 10px;
  mix-blend-mode: screen;
  box-shadow: inset 0 0 60px rgba(255,77,77,0.02);
  animation: fadeIn 0.6s ease forwards;
  opacity: 0;
}

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

/* === Headline === */
main h1 {
  font-size: 1.75rem;
  font-weight: bold;
  color: var(--accent);
  text-align: center;
  text-shadow:
    0 0 4px rgba(255,77,77,0.3),
    0 0 12px rgba(255,77,77,0.2);
  letter-spacing: 0.03em;
  margin-bottom: 1.5rem;
  mix-blend-mode: screen;
}

/* === Textarea === */
textarea {
  width: 100%;
  min-height: 160px;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.65);
  color: var(--accent);
  border: 1px solid rgba(255, 77, 77, 0.3);
  border-radius: 6px;
  font-family: var(--font);
  backdrop-filter: blur(4px);
  mix-blend-mode: screen;
  transition: border 0.2s ease, box-shadow 0.3s ease;
}

textarea:focus {
  outline: none;
  border-color: var(--accent-hover);
  box-shadow: 0 0 14px rgba(255,77,77,0.25);
}

/* === Button Styles === */
button {
  margin: 1.5rem auto;
  display: block;
  padding: 0.8rem 1.6rem;
  font-family: var(--font);
  font-weight: bold;
  font-size: 1rem;
  color: #000;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
  mix-blend-mode: screen;
}

button:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 14px var(--accent-hover);
}

button:active {
  transform: scale(0.98);
  box-shadow: 0 0 10px var(--accent);
}

/* === File Upload === */
/* Style defined below with pro-mode look */

/* === Output Layout === */
.output-area {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* === Audit Card === */
.audit-card {
  background: linear-gradient(to bottom, rgba(255, 77, 77, 0.04), rgba(0, 0, 0, 0.5));
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 77, 77, 0.1);
  border-radius: 8px;
  mix-blend-mode: screen;
  padding: 1rem;
  box-shadow: 0 0 10px rgba(255,77,77,0.05);
  animation: popIn 0.3s ease;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.audit-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(255,77,77,0.15);
}

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

.audit-card .category {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--accent);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.audit-card .item,
.audit-card .price,
.audit-card .flagged {
  color: #ccc;
  font-size: 0.95rem;
  margin: 0.3rem 0;
}

.audit-card .flagged {
  color: #f55;
}

.audit-card .flagged.good {
  color: #999;
  font-style: italic;
}

.flagged.soft {
  color: #ffd966;
  font-weight: bold;
}

.details {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #aaa;
  line-height: 1.4;
  mix-blend-mode: screen;
}

/* === Loading Animation === */
.loading {
  color: var(--accent);
  text-align: center;
  animation: pulse 1s infinite;
  mix-blend-mode: screen;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1;   }
}

/* === Footer === */
footer.site-footer {
  width: 100%;
  margin: 0;
  padding: 1rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  background: #000;
  color: #888;
  font-size: 0.85rem;
  text-align: center;
}

footer.site-footer a {
  color: inherit;
  text-decoration: underline;
}

/* ----- Mobile footer behavior ----- */
@media (max-width:600px){
  body.tool-page{
    display:flex;
    flex-direction:column;
    min-height:100vh;
  }
  main{
    flex:1 0 auto;
  }
  footer.site-footer{
    position:static;
    margin-top:auto;
  }
}

/* === Inline Styles Moved to CSS === */
.accent-text { color: var(--accent); }

.metro-label { display: block; margin-bottom: 0.5rem; }

/* Pro-style metro dropdown */
#metro {
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.6rem;
  background: #000;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  font-family: var(--font);
  font-size: 0.9rem;
  mix-blend-mode: screen;
}

/* Pro-style file input */
input[type="file"] {
  display: block;
  width: 100%;
  margin: 1rem 0;
  padding: 0.6rem;
  background: #000;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  font-family: var(--font);
  font-size: 0.9rem;
  mix-blend-mode: screen;
}

input[type="file"]::file-selector-button {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font);
  font-weight: bold;
  margin-right: 0.8rem;
}

input[type="file"]::file-selector-button:hover {
  background: var(--accent-hover);
}

.legal-disclaimer {
  margin-top: 2rem;
  font-size: 0.9rem;
  color: #888;
  text-align: center;
  line-height: 1.4;
}

.privacy-note {
  color: #aaa;
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: 1rem;
}
.preframe-note {
  margin-top: 0.3rem;
  font-size: 0.85rem;
  color: #888;
  text-align: center;
}

#pro-modal {
  position: fixed;
  top: 10vh;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.95);
  border: 1px solid var(--accent);
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  z-index: 999;
  border-radius: 8px;
  color: var(--fg);
  font-family: var(--font);
  backdrop-filter: blur(8px);
  box-shadow: 0 0 40px rgba(0,255,255,0.1);
  text-align: center;
}

#pro-modal .modal-form { margin-top: 1rem; }
#pro-modal .modal-input {
  padding: 0.7rem;
  width: 80%;
  margin-bottom: 0.8rem;
  border-radius: 4px;
  border: 1px solid var(--accent);
  background: #000;
  color: var(--accent);
  font-family: var(--font);
}

#pro-modal .modal-submit {
  background: var(--accent);
  color: #000;
  font-weight: bold;
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font);
  display: inline-block;
  text-decoration: none;
}

#pro-modal .close-btn {
  margin-top: 1.5rem;
  background: none;
  border: none;
  color: var(--accent-hover);
  cursor: pointer;
  font-family: var(--font);
}

.modal-msg { margin: 1rem 0 1.5rem; }
.modal-note { font-size: 0.95rem; }
.modal-prompt { margin-top: 1rem; }

/* Terms & Privacy Modal */
#legalModal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.95);
  color: var(--fg);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 2rem;
  max-width: 26rem;
  z-index: 999;
  text-align: center;
  box-shadow: 0 0 40px rgba(0,255,255,0.1);
  opacity: 0;
  transition: opacity 0.3s ease;
}
#legalModal.fade-in { opacity: 1; }
.legal-check { display: block; margin: 1rem 0; }
.legal-actions { display: flex; justify-content: center; gap: 1rem; }
.legal-title { margin-top: 0; }
.legal-footer {
  font-size: 0.85rem;
  color: #888;
  margin-top: 0.5rem;
}

/* Privacy TL;DR bullet list */
.privacy-tldr-list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  text-align: left;
  line-height: 1.4;
}

.privacy-tldr-list li::before {
  content: "\2022"; /* bullet */
  margin-right: 0.5rem;
}

/* ---------- Global Scrollbar Styling --------- */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 77, 77, 0.04);
}

::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: content-box;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: limegreen;
}

/* Firefox support */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--accent) rgba(255, 77, 77, 0.05);
}
