@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@100..900&display=swap');

:root {
    --bg: #0f172a;
    --panel: #111827;
    --muted: #94a3b8;
    --text: #e5e7eb;
    --accent: #22c55e;
    --accent-2: #60a5fa;
    --ring: #334155;
    --shadow: 0 20px 40px rgba(0, 0, 0, .35);
}

* {
    box-sizing: border-box
}

html {
    height: 100%
}

  body {
    margin: 0;
    font-family: "Outfit", sans-serif;
    background: #111827;
    color: #e5e7eb;
}

/* Light theme override */
body.light-theme {
    background: #f9fafb;
    color: #111827;
}

a {
    color: var(--text) !important;
  }

  body.light-theme a {
    color: #111827 !important;
  }

.app {
    width: min(960px, 100%);
    margin: 0 auto;
    background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .02));
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 24px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

header {
    background: #111827;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    display: flex;
    align-items: center;
    gap: 12px;
}

#main-header {
    position: sticky;
    top: -80px; /* Hide initially */
    width: 100%;
    z-index: 1030;
    transition: top 0.4s ease;
}

#main-header.sticky {
    top: 0;
}


body.light-theme header {
    background: #f9fafb;
    border-bottom: 1px solid rgb(15 23 42 / 50%);
}

header .logo {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #0b1224;
    border: 1px solid rgba(255, 255, 255, .12)
}

header h1 {
    font-size: 1.3rem;
    margin: 0
}

header p {
    margin: 0;
    font-size: .85rem;
}

main {
    padding: 20px 0px;
    display: grid;
    gap: 20px;
}

.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px
}

@media (min-width:720px) {
    .grid {
        grid-template-columns: 1fr 1fr
    }
}

.card {
    background: rgba(2, 6, 23, .35);
    border-radius: 18px;
    padding: 18px;
    backdrop-filter: blur(6px);
    border: 1px solid;
    color: unset;
}


body.light-theme  .card {
        background: var(--text);
}

label {
    display: block;
    font-size: .85rem;
    color: var(--muted);
    margin-bottom: 8px
}

body.light-theme label {
    color: var(--bg);
}

input,
select {
    width: 100%;
    background: #0b1224;
    color: var(--text);
    border: 1px solid var(--ring);
    border-radius: 12px;
    padding: 14px 12px;
    outline: none
}

body.light-theme  input, body.light-theme select {
    background: #F3F4F6;
    color: var(--bg);
}

input:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, .15)
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap
}

button {
    appearance: none;
    border: none;
    cursor: pointer;
    border-radius: 12px;
    padding: 12px 14px;
    font-weight: 600;
    background: linear-gradient(180deg, var(--accent), #16a34a);
    color: var(--text);
}

button.secondary {
    background: #0b1224;
    color: var(--text);
    border: 1px solid var(--ring)
}

.result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(2, 6, 23, .35);
    border: 1px solid;
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 1.1rem
}

body.light-theme .result  {
    background: var(--text);
}

.fine {
    font-size: .8rem;
    color: var(--muted)
}

body.light-theme .fine {
    color: var(--panel)
}

.presets {
    display: flex;
    flex-wrap: wrap;
    gap: 10px
}

.presets button {
    background: #1e293b;
    color: var(--text);
    border: 1px solid var(--ring);
    font-size: .85rem;
}

body.light-theme .presets button {
    background: var(--bg);
    color: var(--text);
}

.chart-range {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap
}

.chart-range button {
    background: #0b1224;
    color: var(--text);
    border: 1px solid var(--ring);
    font-size: .75rem;
    padding: 6px 10px;
    border-radius: 10px
}

.chart-range button.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .15) inset
}

canvas {
    width: 100% !important;
    max-height: 320px
}

footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: .8rem;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap
}

a {
    color: #9ae6b4
}

details#diagnostics {
    background: rgba(2, 6, 23, .25);
    border: 1px dashed rgba(255, 255, 255, .12);
    padding: 10px 12px;
    border-radius: 12px
}

.warn {
    color: #fca5a5
}

.faq-item {
  border-bottom: 1px solid #ddd;
}

.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font-size: 1.1rem;
  padding: 1rem;
  cursor: pointer;
  font-weight: bold;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 1rem;
}

.faq-item.active .faq-answer {
  max-height: 200px; /* adjust as needed */
  padding: 1rem;
}

.faq button.accordion-button {
    background: var(--bg);
    color: var(--text);
    box-shadow: none;
}

.faq button.accordion-button.collapsed {
    background: #0e1423;
    color: #e5e7eb;
}

body.light-theme .faq button.accordion-button {
    background: var(--text);
    color: var(--bg);
}

body.light-theme .faq button.accordion-button.collapsed {
    background: var(--text);
    color: var(--bg);
}

.accordion-button::after {
    filter: invert(1);
}

body.light-theme .accordion-button::after {
    filter: invert(0);
}


.accordion-item {
    border-color: var(--text);
}

body.light-theme .accordion-item {
    border-color: var(--bg);
}

.accordion-item:first-of-type>.accordion-header .accordion-button ,.accordion-item:first-of-type{
    border-top-left-radius: 20px !important;
    border-top-right-radius: 20px !important;
}

.accordion-item:last-of-type>.accordion-header .accordion-button.collapsed, .accordion-item:last-of-type{
    border-bottom-left-radius: 20px !important;
    border-bottom-right-radius: 20px !important;
}