/* ============================================================
   CYBABUDDY MAIN STYLESHEET
   ------------------------------------------------------------
   Site: search.cybabuddy.com
   Purpose:
   - Home page
   - Search results page
   - Policy/document pages
   - Light/dark colour scheme
   ============================================================ */


/* ============================================================
   1. COLOUR SYSTEM
   ------------------------------------------------------------
   Light mode is the default.
   Dark mode follows the CybaChat dark-grey visual style.
   ============================================================ */

:root {
    --bg-main: #ffffff;
    --bg-soft: #ffffff;

    --text-main: #111111;
    --text-muted: #555555;
    --text-soft: #777777;

    --cyan: #00aacc;
    --cyan-hover: #0088aa;

    --border-soft: #b8b8b8;

    --input-bg: #ffffff;
    --input-text: #111111;

    --footer-text: #888888;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-main: #1f1f1f;
        --bg-soft: #262626;

        --text-main: #f1f1f1;
        --text-muted: #d0d0d0;
        --text-soft: #a9a9a9;

        --cyan: #00b8e6;
        --cyan-hover: #12d6ff;

        --border-soft: #3a3a3d;

        --input-bg: #f5f5f5;
        --input-text: #111111;

        --footer-text: #9a9a9a;
    }
}


/* ============================================================
   2. BASE / GLOBAL
   ============================================================ */

body {
    margin: 0;
    min-height: 100vh;

    background: var(--bg-main);
    color: var(--text-main);

    font-family: Arial, sans-serif;
    font-optical-sizing: auto;
    font-style: normal;

    text-align: center;

    display: flex;
    justify-content: center;
    align-items: center;
}

button {
    width: 140px;
    padding: 12px 20px;
    margin-left: 10px;

    background: var(--cyan);
    color: #ffffff;

    border: 1px solid var(--cyan);
    border-radius: 6px;

    cursor: pointer;
}

button:hover {
    background: var(--cyan-hover);
    filter: brightness(1.05);
}


/* ============================================================
   3. HEADER / TOP LINKS
   ============================================================ */

.cybamail-header-logo {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

.cybamail-logo {
    width: 140px;
    height: auto;
    display: block;
}

.top-links {
    position: fixed;
    top: 20px;
    right: 28px;

    display: flex;
    gap: 18px;

    font-family: "Orbitron", sans-serif;
    font-size: 14px;
    font-weight: bolder;

    z-index: 10;
}

.top-links a {
    color: var(--cyan);
    text-decoration: none;
    font-weight: 700;
}

.top-links a:hover {
    text-decoration: underline;
}


/* ============================================================
   4. HOME PAGE
   ============================================================ */

.page {
    text-align: center;
}

.logo,
.logo-wrap {
    text-align: center;
}

.cybabuddy-logo {
    max-width: 380px;
    width: 100%;
    height: auto;
}

.mobile-logo-CB {
    display: none;
}

.tagline {
    color: var(--text-muted);
    margin-top: 30px;
    margin-bottom: 30px;
}

.search-form {
    display: block;
    max-width: 900px;
    margin: 0 auto;
}

.search-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
}

.search-box {
    width: 400px;
    max-width: 80%;

    padding: 12px;
    margin-left: 0;

    font-size: 16px;

    border-radius: 6px;
    border: 1px solid var(--border-soft);
    outline: none;

    background: var(--input-bg);
    color: var(--input-text);
}

.search-box:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
}

.privacy-first {
    margin-top: 50px;
    color: var(--text-soft);
    font-size: 0.9em;
}


/* ============================================================
   5. HONEYPOT FIELD
   ============================================================ */

.hp-field {
    position: absolute;
    left: -9999px;
    display: none;
}


/* ============================================================
   6. ENGINE MODE SWITCH
   ============================================================ */

.engine-mode-wrap {
    width: 100%;

    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;

    margin-bottom: 20px;

    color: var(--text-main);
}

.search-form .engine-mode-wrap {
    flex: 0 0 100%;
    width: 100%;
    margin-bottom: 20px;
}

.engine-label small {
    opacity: 0.75;
}

.deep-login-link {
    color: var(--cyan);
    text-decoration: none;
    font-weight: 600;

    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.deep-login-link:hover {
    color: var(--cyan);
    border-bottom: 1px solid var(--cyan);
}

.engine-switch {
    position: relative;
    display: inline-block;

    width: 58px;
    height: 30px;

    margin-bottom: 10px;
}

.engine-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.engine-slider {
    position: absolute;
    inset: 0;

    cursor: pointer;

    background: #c9c9c9;
    border-radius: 30px;

    transition: 0.25s;
}

.engine-slider::before {
    content: "";

    position: absolute;
    top: 3px;
    left: 3px;

    width: 24px;
    height: 24px;

    background: #ffffff;
    border-radius: 50%;

    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    transition: 0.25s;
}

.engine-switch input:checked + .engine-slider {
    background: var(--cyan);
}

.engine-switch input:checked + .engine-slider::before {
    transform: translateX(28px);
}


/* ============================================================
   7. FOOTER
   ============================================================ */

.site-footer {
    position: fixed;
    bottom: 20px;

    width: 100%;

    text-align: center;
    font-size: 13px;
    font-family: Arial, sans-serif;

    color: var(--footer-text);
}

.site-footer a {
    color: var(--footer-text);
    text-decoration: none;

    margin: 0 6px;

    transition: color 0.2s ease;
}

.site-footer a:hover {
    color: var(--cyan);
}

.footer-separator {
    color: var(--footer-text);
}


/* ============================================================
   8. POLICY / DOCUMENT PAGES
   ============================================================ */

body.doc-page {
    display: block;

    min-height: 100vh;

    padding: 0;

    text-align: center;
    align-items: unset;
    justify-content: unset;
}

.policy-page {
    max-width: 760px;

    margin: 0 auto;
    padding: 0 24px;

    font-family: Arial, sans-serif;
    line-height: 1.65;

    color: var(--text-main);
}

.policy-page h1 {
    margin-bottom: 20px;

    font-family: Orbitron, Arial, sans-serif;

    color: var(--cyan);
}

.policy-page h4 {
    margin-top: 32px;
    color: var(--text-main);
}

.policy-page p {
    text-align: left;
}

.policy-page a {
    color: var(--cyan);
    text-decoration: none;
}

.policy-page a:hover {
    text-decoration: underline;
}

.doc-logo-wrap {
    text-align: center;
    margin: 60px auto 30px;
}

.doc-logo-wrap img {
    width: 320px;
    max-width: 90%;
    height: auto;

    display: inline-block;
}

.doc-back-link {
    text-align: center;
    margin: 50px auto 60px;
}

.doc-back-link a {
    color: var(--text-soft);
    text-decoration: none;
    font-size: 14px;
    font-family: Arial, sans-serif;
}

.doc-back-link a:hover {
    color: var(--cyan);
}


/* ============================================================
   9. SEARCH RESULTS PAGE LAYOUT
   ============================================================ */

body.results-page {
    display: block;
    text-align: left;
}

.search-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;

    padding: 15px 30px;

    background: transparent;
    border-bottom: 1px solid var(--cyan);
}

.search-header > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mini-logo,
.mini-logo:visited,
.mini-logo:hover,
.mini-logo:active {
    font-size: 1.6rem;
    font-weight: bold;

    color: var(--cyan);
    text-decoration: none;
    white-space: nowrap;
}

.mini-logo-CB {
    height: 40px;
}

.search-bar-top {
    display: flex;
    align-items: center;
    gap: 10px;

    width: 100%;
    max-width: 450px;
}

.search-box-top {
    flex: 1;

    padding: 10px;

    font-size: 16px;

    border-radius: 6px;
    border: 1px solid var(--border-soft);
    outline: none;

    background: var(--input-bg);
    color: var(--input-text);
}

.search-box-top:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
}

.search-bar-top button {
    width: 140px;

    padding: 10px 15px;
    margin-left: 8px;

    background: var(--cyan);
    color: #ffffff;

    border: 1px solid var(--cyan);
    border-radius: 6px;

    cursor: pointer;
}

.search-bar-top button:hover {
    background: var(--cyan-hover);
}


/* ============================================================
   10. DEEP MODE STATUS BOX
   ============================================================ */

.deep-mode-status {
    max-width: 800px;

    margin: 20px 0 10px 120px;
    padding: 12px 16px;

    border-radius: 8px;
    border: 1px solid rgba(0, 212, 255, 0.3);

    background: rgba(0, 212, 255, 0.08);
    color: var(--text-main);

    font-size: 0.9rem;
}


/* ============================================================
   11. SEARCH BUTTON SPINNER
   ============================================================ */

button[type="submit"] {
    position: relative;
}

.spinner {
    width: 14px;
    height: 14px;

    display: inline-block;

    margin-right: 8px;

    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;

    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}


/* ============================================================
   12. SEARCH RESULTS
   ============================================================ */

.ai-answer-box {
    max-width: 800px;

    margin: 30px 0 10px 120px;
    padding: 18px 20px;

    border: 1px solid var(--cyan);
    border-radius: 10px;

    background: rgba(0, 188, 212, 0.06);
    color: var(--text-main);

    line-height: 1.5;
}

.ai-answer-box strong {
    color: var(--cyan);
    font-size: 1.05rem;
}

.ai-answer-box p {
    margin: 10px 0 0;
}

.results {
    max-width: 800px;
    margin: 30px 0 30px 120px;
}

.result-item {
    margin-bottom: 28px;
    padding-bottom: 18px;

    text-align: left;
}

.result-title {
    display: inline-block;

    font-size: 1.25rem;

    color: var(--cyan);
    text-decoration: none;
}

.result-title:hover {
    text-decoration: underline;
}

.result-url {
    margin-top: 5px;

    color: #008d1f;
    font-size: 0.9rem;
}

.result-snippet {
    margin-top: 8px;

    color: var(--text-main);

    font-size: 15px;
    line-height: 1.5;
}


/* ============================================================
   13. PAGINATION
   ============================================================ */

.pagination {
    display: flex;
    align-items: center;
    gap: 18px;

    margin: 30px 0;
}

.pagination a {
    color: var(--cyan);
    text-decoration: none;
    font-weight: bold;
}

.pagination a:hover {
    text-decoration: underline;
}

.page-btn,
.page-current {
    background: var(--cyan);
    color: #ffffff;
}

.page-number {
    color: var(--cyan);
}

.page-number:hover {
    text-decoration: underline;
}


/* ============================================================
   14. DARK MODE FINE TUNING
   ============================================================ */

@media (prefers-color-scheme: dark) {
    button,
    .search-bar-top button {
        color: #001018;
    }

    .search-header {
        border-bottom: 1px solid rgba(0, 212, 255, 0.22);
    }

    .mini-logo,
    .mini-logo:visited,
    .mini-logo:hover,
    .mini-logo:active {
        color: var(--cyan);
        text-shadow: 0 0 8px rgba(0, 212, 255, 0.35);
    }

    .result-url {
        color: #00cc70;
    }

    .ai-answer-box,
    .deep-mode-status {
        background: rgba(0, 212, 255, 0.08);
        border-color: rgba(0, 212, 255, 0.35);
    }

    .page-btn,
    .page-current {
        color: #001018;
        box-shadow: 0 0 8px rgba(0, 212, 255, 0.35);
    }
}


/* ============================================================
   15. MOBILE RESPONSIVE
   ============================================================ */

@media (max-width: 700px) {
    body {
        margin: 0;
        min-height: 100vh;

        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;

        padding: 0;

        background: var(--bg-main);
    }

    .cybamail-header-logo {
        position: absolute !important;
        top: 18px;
        left: 18px;

        margin: 0;
    }

    .cybamail-logo {
        width: 120px;
    }

    .top-links {
        position: absolute !important;
        top: 18px;
        right: 18px;

        display: flex;
        justify-content: flex-end;
        gap: 14px;

        width: auto;
        margin: 0;

        font-size: 12px;

        z-index: 1000;
    }

    .page {
        flex: 1;

        display: flex;
        flex-direction: column;
        justify-content: center;

        width: 100%;
        max-width: 420px;

        margin: 0 auto;
        padding: 20px;

        box-sizing: border-box;

        background: var(--bg-main);
        text-align: center;
    }

    .logo img,
    .logo-wrap img {
        width: 70%;
        max-width: 180px;
        height: auto;
    }

    .tagline {
        max-width: 280px;

        margin: 14px auto 22px;

        font-size: 0.95rem;
        line-height: 1.35;
    }

    .engine-mode-wrap {
        flex-direction: column;
        gap: 8px;

        margin-top: 12px;
    }

    .engine-label {
        font-size: 0.9rem;
        line-height: 1.3;
    }

    .search-form {
        width: 100%;
        max-width: 320px;

        display: flex;
        flex-direction: column;
        gap: 10px;

        margin: 18px auto 0;
    }

    .search-row {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }

    .search-box,
    .search-row .search-box {
        width: 100%;
        max-width: 100%;

        margin-left: 0;

        box-sizing: border-box;

        font-size: 16px;
    }

    button,
    .search-form button,
    .search-row button {
        width: 100%;
        margin-left: 0;

        box-sizing: border-box;
    }

    .site-footer {
        position: static;

        margin-top: 28px;
        padding-bottom: 20px;

        font-size: 0.82rem;
    }

    body.results-page {
        padding: 0;
    }

    body.results-page .page {
        padding-top: 0;
    }

    .search-header {
        flex-direction: column;
        align-items: stretch;

        padding: 16px;
        gap: 12px;
    }

    .mini-logo {
        text-align: center;
        font-size: 1.4rem;
    }

    .mini-logo-CB {
        display: none;
    }

    .search-bar-top {
        width: 100%;
        max-width: 100%;
    }

    .search-box-top {
        width: 100%;
        box-sizing: border-box;
    }

    .search-bar-top button {
        width: auto;
        margin-left: 8px;
    }

    .deep-mode-status,
    .ai-answer-box {
        max-width: 100%;
        margin: 20px 16px 10px;
    }

    .results {
        max-width: 100%;
        margin: 24px 16px;
    }

    .result-title {
        font-size: 1.05rem;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 10px;
    }
}