@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@200;400;600;800&display=swap');

/* === Root Variables === */
:root {
    --bg: #f6fbff;
    --panel: #ffffff;
    --accent: #007bff;
    --accent-2: #2bd3a4;
    --muted: #6b7280;
    --radius: 12px;
    --container-w: 1100px;
    --text: #0b1220;
}

.dark-mode {
    --bg: linear-gradient(180deg, #071022 0%, #031023 100%);
    --panel: #071226;
    --accent: #4f9cff;
    --accent-2: #39d99c;
    --muted: #94a3b8;
    --text: #e6eef8;
}

/* === Base Resets === */
*, ::before, ::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html, body {
    font-family: "Nunito Sans", sans-serif;
    font-optical-sizing: auto;
    background: var(--bg);
    color: var(--text);
}

.theme-toggle {
    appearance: none;
    border: 1px solid rgba(15, 23, 42, 0.06);
    background: var(--panel);
    color: var(--text);
    padding: 0.45rem 0.65rem;
    border-radius: 999px;
    cursor: pointer;
}

/* === Layout Utilities === */
.container {
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 1rem;
}

/* === Header / Navigation === */
.topbar {
    padding: 0.75rem 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    width: 80px;
    height: auto;
    transition: opacity 0.3s ease;
}

.logo-dark {
    display: none;
}

html.dark-mode .logo-light {
    display: none;
}

html.dark-mode .logo-dark {
    display: inline;
}

.brand-title a {
    display: grid;
    place-items: center;
}

.brand-title span {
    color: var(--text);
    font-weight: 600;
    font-size: 0.9rem;
}

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

.nav a {
    color: #334155;
    text-decoration: none;
}

/* === Hero Section === */
.hero {
    padding: 3rem 0;
}

.hero-inner {
    display: grid;
    grid-template-columns: 35% 65%;
    gap: 1rem;
    text-align: center;
    padding: 1.5rem;
}

.hroImage img {
    max-width: 100%;
}

.hero h1 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    font-weight: 800;
}

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

.hero-content h2 {
    width: 60%;
    margin: 0 auto;
}

.lead {
    color: var(--muted);
    max-width: 70%;
    margin: 0 auto 1.25rem;
}

.accent {
    color: var(--accent);
}

.cta {
    margin-top: 1rem;
}

.trial {
    display: inline-block;
    padding: 0.6rem 0.9rem;
    border-radius: 999px;
    background: #ecfff6;
    color: #006644;
    margin: 1rem auto;
}

/* === Refined Scan Form (Interactive + Responsive) === */
.scan-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin: 2rem auto;
    padding: 1.5rem 1rem;
    border-radius: var(--radius);
    /* background: rgba(255, 255, 255, 0.7); */
    /* backdrop-filter: blur(8px); */
    /* box-shadow: 0 8px 28px rgba(11, 18, 32, 0.06); */
    transition: all 0.3s ease-in-out;
}

/* .dark-mode .scan-bar {
    background: rgba(10, 15, 25, 0.6);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
} */

/* === Input Fields and Dropdowns === */
.scan-bar input,
.scan-bar select,
#regionSelect {
    width: 70%;
    max-width: 600px;
    padding: 0.9rem 1.2rem;
    border-radius: 999px;
    border: 1px solid rgba(230, 238, 248, 0.8);
    background: linear-gradient(180deg, var(--panel) 0%, rgba(255, 255, 255, 0.96) 100%);
    color: var(--text);
    font-size: 1rem;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(11, 18, 32, 0.05);
    outline: none;
    transition: all 0.25s ease;
}

.dark-mode .scan-bar input,
.dark-mode .scan-bar select,
.dark-mode #regionSelect {
    background: linear-gradient(180deg, #0e1628 0%, #0b1220 100%);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Hover and Focus */
.scan-bar input:hover,
.scan-bar select:hover,
#regionSelect:hover {
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.15);
}

.scan-bar input:focus,
.scan-bar select:focus,
#regionSelect:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.15);
    transform: scale(1.01);
}

/* Placeholder styling */
.scan-bar input::placeholder,
.scan-bar select::placeholder {
    color: var(--muted);
    opacity: 0.8;
    font-weight: 400;
}

/* === Region Dropdown Wrapper === */
.region-wrapper {
    position: relative;
    width: 70%;
    max-width: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .region-wrapper {
        width: 100%;
    }
}

/* Dropdown appearance */
#regionSelect {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    flex: 1;
    padding: 0.9rem 3rem 0.9rem 1.2rem;
    border-radius: 999px;
    border: 1px solid rgba(230, 238, 248, 0.8);
    background: linear-gradient(180deg, var(--panel) 0%, rgba(255, 255, 255, 0.96) 100%);
    color: var(--text);
    font-size: 1rem;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(11, 18, 32, 0.05);
    transition: all 0.25s ease;
    cursor: pointer;
}

/* Arrow icon */
.region-wrapper .arrow {
    position: absolute;
    top: 50%;
    right: 1.2rem;
    width: 0.7rem;
    height: 0.7rem;
    border-right: 2px solid #666;
    border-bottom: 2px solid #666;
    transform: translateY(-50%) rotate(45deg);
    transition: transform 0.3s ease, border-color 0.3s ease;
    pointer-events: none;
}

/* Hover and focus effects */
#regionSelect:focus+.arrow,
#regionSelect:hover+.arrow {
    border-color: #007bff;
}

#regionSelect:focus+.arrow {
    transform: translateY(-50%) rotate(225deg);
}

/* Option color differentiation */
#regionSelect option[value="global"] {
    color: #007bff;
    font-weight: 600;
}

#regionSelect option[value="regional"] {
    color: #10b981;
}

#regionSelect option[value="local"] {
    color: #f97316;
}

/* === Area Input (Dynamic Visibility) === */
#areaInput {
    display: none;
    transition: all 0.3s ease-in-out;
}

/* Visible state */
#areaInput.visible {
    display: block !important;
    pointer-events: auto;
    opacity: 1;
    transform: translateY(0);
    animation: fadeSlideIn 0.25s ease forwards;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

a.btn {
    color: #0b1220
}

.btn {
    display: inline-block;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    border: none;
    background: #edf2ff;
    color: var(--text);
    cursor: pointer;
    text-decoration: none;
    font-weight: 700
}

/* === Primary Button === */
.btn.primary {
    background: linear-gradient(90deg, var(--accent), #00b4ff);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0.95rem 2rem;
    width: 50%;
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 123, 255, 0.25);
    transition: all 0.25s ease;
}

.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 123, 255, 0.35);
}

.btn.primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 14px rgba(0, 123, 255, 0.25);
}

/* === Responsive Layout === */
@media (max-width: 768px) {

    .scan-bar input,
    .scan-bar select,
    #regionSelect,
    .btn.primary {
        width: 100%;
    }
}

/* === Dark Mode Support === */
@media (prefers-color-scheme: dark) {
    #regionSelect {
        color: #eee;
        border-color: #222;
        background: linear-gradient(180deg, #111 0%, #0a0f1b 100%);
    }

    .region-wrapper .arrow {
        border-color: #aaa;
    }

    #regionSelect:hover {
        border-color: #4a90e2;
    }

    .btn.primary {
        box-shadow: 0 6px 18px rgba(79, 156, 255, 0.35);
    }
}



/* === Hints / Footer === */
.hints, .last-run {
    color: var(--muted);
    font-size: 1rem;
    margin-top: 0.75rem;
}

/* === Dashboard === */
.dashboard {
    padding: 2rem 1rem;
}

.empty {
    text-align: center;
    padding: 3rem;
}

.page-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.meta {
    color: var(--muted);
}

/* === Metric Grid === */
.grid {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card.metric {
    background: var(--panel);
    border-radius: var(--radius);
    padding: 1.1rem;
    box-shadow: 0 6px 22px rgba(12, 36, 64, 0.06);
}

/* Metric title tooltip */
.metric-title {
    position: relative;
    font-size: 1rem;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: default;
}

.metric-title svg {
    width: 5px;
    fill: currentColor;
}

/* Tooltip */
.metric-title[data-tool]::before,
.metric-title[data-tool]::after {
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.metric-title[data-tool]::before {
    content: attr(data-tool);
    position: absolute;
    bottom: calc(100% + 8px);
    background: var(--accent);
    color: #fff;
    border-radius: 6px;
    padding: 0.6rem 1rem;
    white-space: normal;
    text-align: center;
    z-index: 999;
    opacity: 0;
    transform: translateY(60%) scale(0.95);
    font-size: 1rem;
    width: 20rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.metric-title[data-tool]::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid var(--accent);
    opacity: 0;
    transform: translateY(60%) scale(0.95);
}

.metric-title[data-tool]:hover::before,
.metric-title[data-tool]:hover::after,
.metric-title[data-tool]:focus::before,
.metric-title[data-tool]:focus::after {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Metric Values */
.metric-value {
    font-size: 1.75rem;
    font-weight: 800;
    margin-top: 0.25rem;
    color: var(--accent);
}

.metric-sub {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 0.4rem;
}

/* === Panels / Prompts === */
.panel {
    background: var(--panel);
    padding: 1rem;
    border-radius: var(--radius);
    margin-top: 1rem;
    box-shadow: 0 6px 22px rgba(12, 36, 64, 0.04);
}

/* Top Prompts Grid */
.top-prompts-grid {
    display: grid;
    gap: 1.5rem;
    margin-top: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.prompt-panel {
    border-radius: 1rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    padding: 1.2rem 1.4rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.prompt-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.prompt-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.engine-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    flex-shrink: 0;
    color: #fff;
    background-color: black;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.engine-badge img,
.engine-badge svg {
    width: 1.2rem;
    height: 1.2rem;
    filter: invert(1);
}

.engine-header-text h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.engine-metrics {
    font-size: 0.9rem;
    color: var(--muted);
    display: flex;
    margin-left: 1rem;
    gap: 3rem;
}

.prompt-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding: 0.8rem 0;
}

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

.prompt-text {
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: var(--text)
}

.prompt-meta, .prompt-example {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 0.4rem;
}

.prompt-example {
    margin-top: 4px;
}

/* === Responsive === */
@media(max-width:980px) {
    .hero {
        padding: 0;
    }

    .scan-bar {
        width: 100%;
    }

    .grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hroImage img {
        max-width: 70%;
    }

    .hero-inner {
        grid-template-columns: 1fr;
    }

    .free-db-img div img:nth-child(1) {
        flex-direction: column;
        align-items: center;
        display: none;
    }
}

@media(max-width:800px) {
    /* .scan-bar input, .scan-bar select, #regionSelect {
        width: 70%;
    } */

    .hero h2 {
        display: none;
    }

    .btn.primary {
        width: 64%;
    }
}

@media(max-width:640px) {
    .scan-bar input, .scan-bar select, #regionSelect {
        width: 100%;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .lead {
        max-width: 100%;
    }
}

@media(max-width:575px) {
    .page-header {
        flex-direction: column;
        gap: 1rem;
    }

    .btn.primary {
        width: 90%;
        padding: 0.75rem;
        box-shadow: none;
    }
}

.region-wrapper {
    position: relative;
    width: 70%;
    max-width: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .region-wrapper {
        width: 100%;
    }
}


#regionSelect {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    padding: 0.9rem 3rem 0.9rem 1.2rem;
    border-radius: 999px;
    border: 1px solid rgba(230, 238, 248, 0.8);
    background: linear-gradient(180deg, var(--panel) 0%, rgba(255, 255, 255, 0.96) 100%);
    color: var(--text);
    font-size: 1rem;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(11, 18, 32, 0.05);
    outline: none;
    transition: all 0.25s ease;
    cursor: pointer;
    flex: 1;
}


/* Hover & focus feedback */
#regionSelect:hover {
    border-color: #4a90e2;
}

#regionSelect:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
    outline: none;
}

/* Dropdown arrow */
.region-wrapper .arrow {
    position: absolute;
    top: 50%;
    right: 1.2rem;
    width: 0.7rem;
    height: 0.7rem;
    border-right: 2px solid #666;
    border-bottom: 2px solid #666;
    transform: translateY(-50%) rotate(45deg);
    transition: transform 0.3s ease, border-color 0.3s ease;
    pointer-events: none;
}


/* Arrow active state */
#regionSelect:focus+.arrow,
#regionSelect:hover+.arrow {
    border-color: #007bff;
}

#regionSelect:focus+.arrow {
    transform: translateY(-50%) rotate(225deg);
}

/* Option color differentiation */
#regionSelect option[value="global"] {
    color: #007bff;
    /* Blue */
    font-weight: 600;
}

#regionSelect option[value="regional"] {
    color: #10b981;
    /* Green */
}

#regionSelect option[value="local"] {
    color: #f97316;
    /* Orange */
}

/* Animate area input visibility (already present but enhanced) */
#areaInput {
    transition: all 0.3s ease-in-out;
}

/* Hidden state */
#areaInput.hidden {
    display: none !important;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
}

/* Dark-mode support */
@media (prefers-color-scheme: dark) {
    #regionSelect {
        /* background: #111; */
        color: var(--muted);
    }

    .region-wrapper .arrow {
        border-color: #aaa;
    }

    #regionSelect:hover {
        border-color: #4a90e2;
    }
}

.free-db-img {
    gap: 1rem;
}

.mw-f {
    width: 100%;
    height: auto;
    border-radius: 0.9rem;
}

ul#suggestions {
    list-style: none;
    padding: 0px;
    margin: 0px;
    position: absolute;
    /* background: white; */
    /* width: 100%; */
    max-height: 150px;
    overflow-y: auto;
    /* border: 1px solid rgb(204, 204, 204); */
    z-index: 1000;
    display: block;
    text-align: left;
    bottom: -3rem;
    border-radius: 0.8rem;
    padding: 0.5rem;
    /* padding-bottom: 0.5rem; */
    color: var(--muted);
}