/* Default: dark theme */
:root {
    --bg: #0f1720;
    --card: #0b1220;
    --muted: #9aa4b2;
    --accent: #4ea1ff;
    --text: #e6eef8;
    --radius: 12px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .6), 0 1px 3px rgba(0, 0, 0, .6);
}

* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    font-family: Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

.site-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 24px 16px;
}

.logo {
    font-weight: 500;
    font-size: 28px;
    margin: 0 12px 0 0;
    display: inline-flex;
    gap: 6px;
    align-items: baseline;
}

.logo .logo-main {
    color: var(--text);
    font-weight: 600
}

.logo .logo-small {
    color: var(--muted);
    font-size: 14px;
    align-self: flex-end;
    margin-bottom: 3px
}

.searchbox {
    display: flex;
    align-items: center;
    width: min(760px, calc(100% - 48px));
    background: var(--card);
    border-radius: 999px;
    padding: 8px 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(60, 64, 67, 0.08);
}

.theme-toggle {
    display: none;
}

.searchbox input[type="search"] {
    flex: 1;
    border: 0;
    outline: 0;
    padding: 12px 16px;
    font-size: 16px;
    border-radius: 999px;
    background: transparent;
    color: var(--text);
}

.searchbox .search-btn {
    border: 0;
    background: transparent;
    padding: 8px 12px;
    font-size: 18px;
    cursor: pointer;
}

.content {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 24px 12px 80px;
}

#results {
    width: 100%;
}

#results-column {
    flex: 1 1 60%;
}

#sidebar {
    width: 320px;
    max-width: 40%;
}

.searchinfo {
    color: var(--muted);
    margin: 0 0 12px 6px;
    font-size: 14px;
}

.result {
    background: var(--card);
    border-radius: 12px;
    padding: 16px 18px;
    margin: 10px 0;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(60, 64, 67, 0.06);
}

.rtitle {
    display: block;
    color: var(--accent);
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 6px;
}

.snippet {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
    font-size: 15px;
}

.infobox {
    background: var(--card);
    border-radius: 12px;
    padding: 16px;
    margin: 10px 0;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.infobox-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: var(--text);
}

.infobox-id {
    color: var(--accent);
    font-size: 13px;
    margin-bottom: 8px;
    display: inline-block
}

.infobox-img {
    max-width: 160px;
    height: auto;
    float: right;
    margin-left: 12px;
    border-radius: 8px
}

/* Light theme variables (kept for reference)
:root.light {
    --bg: #f8f9fa;
    --card: #ffffff;
    --muted: #5f6368;
    --accent: #1a73e8;
    --text: #202124;
    --shadow-sm: 0 1px 2px rgba(60, 64, 67, .08), 0 1px 3px rgba(60, 64, 67, .12);
}
*/

.infobox-content {
    margin-top: 6px;
    line-height: 1.5;
    color: var(--muted)
}

.infobox-urls {
    margin: 8px 0 0 0;
    padding-left: 18px
}

.infobox-urls a {
    color: var(--accent);
    text-decoration: none
}

.infobox-attributes dt {
    font-weight: 600;
    margin-top: 8px
}

.infobox-attributes dd {
    margin: 0 0 6px 12px
}

/* Answers (rendered from API 'answers' / 'answer') */
.answer-box {
    background: linear-gradient(180deg, rgba(78, 161, 255, 0.08), rgba(78, 161, 255, 0.03));
    border-radius: 14px;
    padding: 18px 20px;
    margin: 10px 0 16px 0;
    box-shadow: 0 6px 18px rgba(78, 161, 255, 0.08);
    border: 1px solid rgba(78, 161, 255, 0.18);
}

.answer-meta {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
}

.answer-content {
    margin: 0 0 8px 0;
    color: var(--text);
    line-height: 1.2;
    font-size: 20px;
    font-weight: 700;
}

.answer-url {
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
}

/* Responsive tweaks */
@media (max-width:640px) {
    .logo {
        font-size: 22px
    }

    .searchbox {
        width: calc(100% - 32px)
    }

    .infobox-img {
        display: none
    }
}

/* search button icon styling */
.search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    color: var(--text);
}

.search-btn .material-icons {
    font-size: 20px;
    color: var(--muted);
}

/* Result card additions */
.result-thumb {
    max-width: 120px;
    max-height: 80px;
    float: right;
    margin-left: 12px;
    border-radius: 8px;
    object-fit: cover;
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
}

.r-engine {
    color: var(--muted);
}

.r-domain,
.r-origin {
    color: var(--accent);
    text-decoration: none;
}

.r-smallmeta {
    color: var(--muted);
    font-size: 12px;
}

.r-url {
    display: flex;
    flex-direction: column;
}

.r-origin {
    font-weight: 500;
}

.r-path {
    color: var(--muted);
    font-size: 13px;
    margin-top: 2px;
}

.r-pathseg {
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
    margin-right: 6px;
}

.r-origin-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.copy-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--muted);
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.copy-btn .material-icons {
    font-size: 16px;
}

@media (max-width:900px) {
    .content {
        flex-direction: column;
        gap: 12px;
    }

    #sidebar {
        width: 100%;
    }
}