*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --green:   #22c55e;
    --green2:  #16a34a;
    --teal:    #10b981;
    --gold:    #fbbf24;
    --bg:      #0f172a;
    --surface: #1e293b;
    --card:    rgba(30,41,59,0.85);
    --border:  rgba(255,255,255,0.08);
    --txt:     #f1f5f9;
    --txt2:    #94a3b8;
    --blue-link: #60a5fa;
}

body {
    font-family: 'Noto Sans Bengali', sans-serif;
    background: var(--bg);
    color: var(--txt);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── PAGES ──────────────────────────────────────────────────────────────── */
.page { width: 100%; min-height: 100vh; }
.hidden { display: none !important; }

/* ── HOME PAGE ──────────────────────────────────────────────────────────── */
.home-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px 20px;
    background: radial-gradient(ellipse at 20% 80%, rgba(34,197,94,0.06) 0%, transparent 55%),
                radial-gradient(ellipse at 80% 20%, rgba(251,191,36,0.06) 0%, transparent 55%),
                var(--bg);
}

.home-wrap {
    width: 100%;
    max-width: 650px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    flex: 1;
    justify-content: center;
    padding: 40px 0 20px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 16px;
}
.leaf {
    font-size: 2.4rem;
    animation: bob 3s ease-in-out infinite;
    display: inline-block;
}
.leaf:last-child { animation-delay: 1.5s; }
@keyframes bob {
    0%,100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-10px) rotate(12deg); }
}
.logo-text {
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: 6px;
    background: linear-gradient(135deg, var(--green), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.tagline { color: var(--txt2); font-size: 1.1rem; text-align: center; }

/* Search box (home) */
.search-box {
    width: 100%;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 50px rgba(0,0,0,.3);
}
.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.search-icon {
    position: absolute;
    left: 16px;
    font-size: 1.1rem;
    pointer-events: none;
}
.search-box input,
.top-search-wrap .input-wrap input {
    width: 100%;
    padding: 16px 20px 16px 48px;
    font-size: 1.15rem;
    font-family: inherit;
    background: rgba(15,23,42,.8);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--txt);
    transition: border .25s, box-shadow .25s;
}
.search-box input:focus,
.top-search-wrap .input-wrap input:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 18px rgba(34,197,94,.2);
}
input::placeholder { color: var(--txt2); }
.search-buttons {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
    justify-content: center;
}
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 26px;
    font-size: 1.05rem;
    font-family: inherit;
    font-weight: 600;
    border: none;
    border-radius: 11px;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
}
.btn.primary  { background: linear-gradient(135deg, var(--green), var(--teal)); color: #fff; }
.btn.secondary{ background: linear-gradient(135deg, #f59e0b, #d97706);           color: #fff; }
.btn.primary:hover  { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(34,197,94,.4); }
.btn.secondary:hover{ transform: translateY(-2px); box-shadow: 0 8px 25px rgba(245,158,11,.4); }

/* Trending */
.trending-section {
    width: 100%;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px;
    backdrop-filter: blur(8px);
}
.trending-section h3 { color: var(--gold); margin-bottom: 16px; font-size: 1.1rem; }
.fake-tag { font-size: .78rem; color: var(--txt2); font-weight: 400; }
.trending-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
    background: rgba(34,197,94,.12);
    color: var(--green);
    border: 1px solid rgba(34,197,94,.25);
    padding: 9px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-size: .9rem;
    transition: background .2s, transform .2s;
}
.tag:hover { background: rgba(34,197,94,.25); transform: scale(1.04); }

/* Home footer */
.home-footer {
    text-align: center;
    padding: 20px 0 10px;
    color: var(--txt2);
    font-size: .85rem;
    line-height: 1.9;
}
.home-footer a { color: var(--green); text-decoration: none; font-weight: 600; }
.home-footer a:hover { text-decoration: underline; }
.disclaimer { opacity: .65; }
.author { }

/* ── RESULTS PAGE ───────────────────────────────────────────────────────── */
.results-page {
    display: flex;
    flex-direction: column;
}

/* Top bar */
.results-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 24px;
    background: rgba(15,23,42,.95);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px);
}
.top-logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--green);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}
.top-logo:hover { color: var(--gold); }
.top-search-wrap {
    flex: 1;
    max-width: 700px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.top-search-wrap .input-wrap { flex: 1; }
.top-search-wrap .input-wrap input {
    padding: 11px 16px 11px 44px;
    font-size: 1rem;
    border-radius: 999px;
}
.top-search-btn {
    padding: 11px 22px;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-family: inherit;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
    white-space: nowrap;
}
.top-search-btn:hover { background: var(--green2); }

/* Results body */
.results-body {
    max-width: 760px;
    width: 100%;
    margin: 0 auto;
    padding: 20px 20px 40px;
    flex: 1;
}

.results-meta {
    font-size: .85rem;
    color: var(--txt2);
    margin-bottom: 18px;
}

/* ── RESULT CARDS (unified AI + Web) ───────────────────────────────────── */
.web-results { display: flex; flex-direction: column; }

.result-card {
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
    animation: fadeUp .35s ease both;
}
.result-card:last-child { border-bottom: none; }

/* AI card has a subtle left accent */
.result-card-ai {
    border-left: 3px solid rgba(34,197,94,.4);
    padding-left: 14px;
}

.result-site {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

/* Badges */
.badge {
    font-size: .7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    flex-shrink: 0;
}
.badge-ai  { background: rgba(34,197,94,.18); color: var(--green); border: 1px solid rgba(34,197,94,.3); }
.badge-web { background: rgba(96,165,250,.15); color: #93c5fd;     border: 1px solid rgba(96,165,250,.25); }

.result-favicon {
    width: 16px; height: 16px;
    border-radius: 3px;
    object-fit: cover;
    flex-shrink: 0;
}
.result-domain { font-size: .82rem; color: var(--txt2); }

/* Titles */
.result-title {
    font-size: 1.12rem;
    font-weight: 600;
    color: var(--blue-link);
    text-decoration: none;
    display: block;
    margin-bottom: 5px;
    line-height: 1.4;
    transition: color .15s;
}
.result-title:hover { color: #93c5fd; text-decoration: underline; }

/* AI title — not a link, green tint */
.result-title-ai {
    font-size: 1.08rem;
    font-weight: 600;
    color: #86efac;
    display: block;
    margin-bottom: 5px;
    line-height: 1.4;
}

.result-snippet { font-size: .9rem; color: var(--txt2); line-height: 1.65; }

/* No results */
.no-results {
    text-align: center;
    padding: 50px 20px;
    font-size: 1.1rem;
    color: var(--txt2);
    line-height: 2;
}

/* Results footer */
.results-footer {
    text-align: center;
    padding: 20px;
    border-top: 1px solid var(--border);
    font-size: .82rem;
    color: var(--txt2);
}
.results-footer a { color: var(--green); text-decoration: none; }
.results-footer a:hover { text-decoration: underline; }

/* ── LOADING ────────────────────────────────────────────────────────────── */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.88);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    backdrop-filter: blur(6px);
}
.loading-content { text-align: center; }
.spinner {
    width: 52px; height: 52px;
    border: 4px solid rgba(34,197,94,.25);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-content p { font-size: 1.1rem; color: var(--txt); }

/* ── ANIMATIONS ─────────────────────────────────────────────────────────── */
@keyframes fadeUp {
    from { opacity:0; transform: translateY(14px); }
    to   { opacity:1; transform: translateY(0); }
}

/* Stagger result cards */
.result-card:nth-child(1)  { animation-delay: .02s; }
.result-card:nth-child(2)  { animation-delay: .07s; }
.result-card:nth-child(3)  { animation-delay: .12s; }
.result-card:nth-child(4)  { animation-delay: .17s; }
.result-card:nth-child(5)  { animation-delay: .22s; }
.result-card:nth-child(6)  { animation-delay: .27s; }
.result-card:nth-child(7)  { animation-delay: .32s; }
.result-card:nth-child(8)  { animation-delay: .37s; }

/* ── RESPONSIVE ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .logo-text { font-size: 2.8rem; }
    .leaf      { font-size: 1.9rem; }
    .tagline   { font-size: .95rem; }
    .search-box { padding: 18px; }
    .btn { width: 100%; justify-content: center; }
    .search-buttons { flex-direction: column; }

    .results-topbar { padding: 10px 14px; gap: 10px; }
    .top-logo { font-size: 1.2rem; }
    .top-search-btn { padding: 10px 14px; font-size: .85rem; }
    .results-body { padding: 14px 14px 30px; }
    .result-title { font-size: 1rem; }
}
