/* ============================================================================
   SZYMDOWS SEARCH - style.css
   ============================================================================ */

/* -- Variables -------------------------------------------------------------- */

:root {
    --c-bg:          #ffffff;
    --c-surface:     #ffffff;
    --c-raised:      #f8f9fa;
    --c-hover:       #f1f3f4;
    --c-active:      #e8eaed;

    --c-text:        #202124;
    --c-text-2:      #5f6368;
    --c-text-3:      #9aa0a6;
    --c-link:        #1558d6;
    --c-visited:     #681da8;
    --c-url:         #0d652d;

    --c-accent:      #1a73e8;
    --c-accent-d:    #1558d6;
    --c-accent-bg:   #e8f0fe;

    --c-border:      #dfe1e5;
    --c-ring:        #4285f4;

    --c-mark-bg:     #fef08a;   /* highlight colour */
    --c-mark-text:   #1a1a1a;

    --sh-box:        0 2px 8px rgba(32,33,36,.18), 0 1px 3px rgba(32,33,36,.10);
    --sh-raise:      0 6px 20px rgba(32,33,36,.16), 0 2px 6px rgba(32,33,36,.10);
    --sh-focus:      0 0 0 3px rgba(26,115,232,.18);

    --r-pill:        24px;
    --r-lg:          16px;
    --r-md:          10px;
    --r-sm:          8px;
    --r-xs:          6px;

    --f-body:        'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --f-display:     'DM Serif Display', Georgia, serif;

    --ease:          0.15s ease;
    --ease-spring:   0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="dark"] {
    --c-bg:          #202124;
    --c-surface:     #292a2d;
    --c-raised:      #35363a;
    --c-hover:       #3c4043;
    --c-active:      #4d5055;

    --c-text:        #e8eaed;
    --c-text-2:      #9aa0a6;
    --c-text-3:      #5f6368;
    --c-link:        #8ab4f8;
    --c-visited:     #c58af9;
    --c-url:         #81c995;

    --c-accent:      #8ab4f8;
    --c-accent-d:    #aecbfa;
    --c-accent-bg:   #1a3a5c;

    --c-border:      #3c4043;
    --c-ring:        #8ab4f8;

    --c-mark-bg:     #854d0e;
    --c-mark-text:   #fef9c3;

    --sh-box:        0 2px 10px rgba(0,0,0,.40), 0 1px 4px rgba(0,0,0,.25);
    --sh-raise:      0 6px 24px rgba(0,0,0,.50), 0 2px 8px rgba(0,0,0,.30);
    --sh-focus:      0 0 0 3px rgba(138,180,248,.22);
}

/* -- Reset ------------------------------------------------------------------ */

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--f-body);
    font-size: 14px;
    line-height: 1.6;
    background: var(--c-bg);
    color: var(--c-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.2s ease, color 0.2s ease;
}

/* -- Highlight marks -------------------------------------------------------- */

mark {
    background: var(--c-mark-bg);
    color: var(--c-mark-text);
    border-radius: 2px;
    padding: 0 1px;
    font-style: normal;
}

/* -- Search box (shared component) ----------------------------------------- */

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: 52px;
    padding: 0 8px 0 20px;
    background: var(--c-surface);
    border: 1.5px solid var(--c-border);
    border-radius: var(--r-pill);
    transition: box-shadow var(--ease), border-color var(--ease);
    cursor: text;
    z-index: 2;
}

.search-box:hover {
    box-shadow: var(--sh-box);
    border-color: rgba(0,0,0,0);
}

.search-box:focus-within {
    box-shadow: var(--sh-box), var(--sh-focus);
    border-color: var(--c-accent);
}

.search-box.compact {
    height: 46px;
    padding: 0 6px 0 18px;
}

.search-box-icon {
    font-size: 20px;
    color: var(--c-text-3);
    flex-shrink: 0;
    margin-right: 10px;
    pointer-events: none;
    user-select: none;
}

.search-box-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--f-body);
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0.01em;
    color: var(--c-text);
    caret-color: var(--c-accent);
}

.search-box-input::placeholder { color: var(--c-text-3); }

.search-box-clear {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-text-2);
    transition: background var(--ease);
}

.search-box-clear:hover { background: var(--c-hover); }
.search-box-clear .material-symbols-rounded { font-size: 18px; }

.search-box-divider {
    width: 1px;
    height: 22px;
    background: var(--c-border);
    flex-shrink: 0;
    margin: 0 2px;
}

.search-box-submit {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-accent);
    transition: background var(--ease);
}

.search-box-submit:hover { background: var(--c-hover); }
.search-box-submit .material-symbols-rounded { font-size: 22px; }

/* -- Theme button ----------------------------------------------------------- */

.theme-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: 1.5px solid var(--c-border);
    border-radius: 50%;
    background: var(--c-raised);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-text-2);
    transition: background var(--ease), border-color var(--ease), color var(--ease), box-shadow var(--ease), transform 0.1s ease;
}

.theme-btn:hover {
    background: var(--c-hover);
    border-color: var(--c-ring);
    color: var(--c-accent);
    box-shadow: 0 1px 6px rgba(32,33,36,.15);
}

.theme-btn:active { background: var(--c-active); transform: scale(0.93); }
.theme-btn .material-symbols-rounded { font-size: 20px; }

/* ============================================================================
   HOMEPAGE
   ============================================================================ */

.page-home {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
}

/* Subtle dot-grid background - purely decorative */
.page-home::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(circle, var(--c-border) 1px, transparent 1px);
    background-size: 28px 28px;
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

[data-theme="dark"] .page-home::before { opacity: 0.18; }

.home-header,
.home-main,
.home-footer { position: relative; z-index: 1; }

.home-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 16px 20px;
    gap: 8px;
}

.home-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 20px 72px;
}

/* -- Logo ------------------------------------------------------------------- */

.home-logo-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-bottom: 30px;
    animation: fadeUp 0.45s ease both;
}

.home-logo-svg {
    width: 88px;
    height: 88px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(26,115,232,.30));
    transition: transform var(--ease-spring), filter 0.2s ease;
    border-radius: 22px;
}

.home-logo-svg:hover {
    transform: scale(1.07);
    filter: drop-shadow(0 6px 16px rgba(26,115,232,.40));
}

.home-doodle {
    max-width: 560px;
    width: 92vw;
    height: auto;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
    -webkit-user-drag: none;
}

.home-doodle:hover { transform: scale(1.04); }

.home-title {
    font-family: var(--f-display);
    font-size: 52px;
    font-weight: 400;
    letter-spacing: -1px;
    line-height: 1;
    color: var(--c-text);
}

.home-title-accent { color: var(--c-accent); }

/* -- Home search form ------------------------------------------------------- */

.home-form {
    width: 100%;
    max-width: 584px;
    animation: fadeUp 0.45s 0.07s ease both;
    position: relative;
    z-index: 2;
}

/* -- Action buttons --------------------------------------------------------- */

.home-btns {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
}

.home-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    background: var(--c-raised);
    border: 1.5px solid var(--c-border);
    border-radius: var(--r-sm);
    font-family: var(--f-body);
    font-size: 14px;
    color: var(--c-text);
    cursor: pointer;
    white-space: nowrap;
    transition: box-shadow var(--ease), border-color var(--ease), background var(--ease), transform 0.1s ease;
}

.home-action-btn .material-symbols-rounded { font-size: 16px; }

.home-action-btn:hover {
    border-color: transparent;
    box-shadow: var(--sh-box);
}

.home-action-btn:active {
    background: var(--c-hover);
    transform: scale(0.97);
}

/* -- Submit a website - home page link ------------------------------------- */

.home-submit-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    background: var(--c-raised);
    border: 1px solid var(--c-border);
    border-radius: var(--r-xs);
    font-family: var(--f-body);
    font-size: 14px;
    color: var(--c-text);
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: box-shadow var(--ease), border-color var(--ease), background var(--ease);
    animation: fadeUp 0.45s 0.18s ease both;
}

.home-submit-link .material-symbols-rounded { font-size: 16px; }

.home-submit-link:hover {
    border-color: transparent;
    box-shadow: var(--sh-box);
}

.home-submit-link:active { background: var(--c-hover); }

/* -- Submit a website - results header button ------------------------------ */

.header-submit-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: 1.5px solid var(--c-border);
    border-radius: 50%;
    background: var(--c-raised);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-text-2);
    text-decoration: none;
    transition: background var(--ease), border-color var(--ease), color var(--ease), box-shadow var(--ease), transform 0.1s ease;
}

.header-submit-btn:hover {
    background: var(--c-hover);
    border-color: var(--c-ring);
    color: var(--c-accent);
    box-shadow: 0 1px 6px rgba(32,33,36,.15);
}

.header-submit-btn:active { background: var(--c-active); transform: scale(0.93); }
.header-submit-btn .material-symbols-rounded { font-size: 20px; }



.home-stats {
    position: relative;
    z-index: 1;
    margin-top: 28px;
    font-size: 13px;
    color: var(--c-text-2);
    animation: fadeUp 0.45s 0.14s ease both;
}

.stats-link {
    color: var(--c-text-2);
    text-decoration: none;
    transition: color var(--ease);
}

.stats-link:hover {
    color: var(--c-accent);
    text-decoration: underline;
}

/* -- Home footer ------------------------------------------------------------ */

.home-footer {
    padding: 14px 20px;
    text-align: center;
    font-size: 13px;
    color: var(--c-text-2);
    border-top: 1px solid var(--c-border);
    background: var(--c-raised);
    position: relative;
    z-index: 1;
}

/* ============================================================================
   RESULTS PAGE
   ============================================================================ */

.page-results {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
}

/* -- Results header --------------------------------------------------------- */

.results-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.results-header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 24px;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
}

.results-logo-link {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    flex-shrink: 0;
}

.results-logo-svg {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 7px;
    flex-shrink: 0;
}

.results-logo-text {
    font-family: var(--f-display);
    font-size: 22px;
    font-weight: 400;
    color: var(--c-text);
    white-space: nowrap;
    letter-spacing: -0.2px;
}

.results-search-form {
    flex: 1;
    min-width: 0;
    max-width: 600px;
}

/* -- Results main ----------------------------------------------------------- */

.results-main {
    padding: 0 24px 60px;
}

.results-content {
    max-width: 652px;
    padding-top: 20px;
    /* Align results under the search bar left edge */
    margin-left: max(24px, calc(50% - 476px));
}

/* -- Result count ----------------------------------------------------------- */

.results-count {
    font-size: 13px;
    color: var(--c-text-3);
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--c-border);
    letter-spacing: 0.01em;
}

/* -- Result list ------------------------------------------------------------ */

.results-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* -- Individual result ------------------------------------------------------ */

.result-item {
    display: flex;
    flex-direction: column;
    padding: 18px 44px 18px 0;
    border-bottom: 1px solid var(--c-border);
    position: relative;
    transition: background var(--ease);
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    overflow: visible;
}

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

/* Subtle left accent on hover */
.result-item::before {
    content: '';
    position: absolute;
    left: -14px;
    top: 20px;
    bottom: 20px;
    width: 3px;
    background: var(--c-accent);
    border-radius: 2px;
    opacity: 0;
    transform: scaleY(0.4);
    transition: opacity var(--ease), transform var(--ease);
}

.result-item:hover::before {
    opacity: 1;
    transform: scaleY(1);
}

/* Source line */
.result-source {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    min-width: 0;
    overflow: hidden;
}

.result-favicon {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    object-fit: contain;
    flex-shrink: 0;
}

.result-favicon-fallback {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    background: linear-gradient(135deg, var(--c-accent), var(--c-accent-d));
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.result-source-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 1px;
}

.result-domain {
    font-size: 14px;
    font-weight: 500;
    color: var(--c-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.result-url {
    font-size: 12px;
    color: var(--c-url);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* Title */
.result-title {
    font-size: 20px;
    line-height: 1.4;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.result-title a {
    color: var(--c-link);
    text-decoration: none;
    font-weight: 400;
    letter-spacing: -0.1px;
}

.result-title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.result-title a:visited { color: var(--c-visited); }

/* Description */
.result-desc {
    font-size: 14px;
    line-height: 1.7;
    color: var(--c-text-2);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-width: 0;
}

/* -- Result 3-dot menu ------------------------------------------------------ */

.result-menu-wrap {
    position: absolute;
    top: 14px;
    right: 0;
    opacity: 0;
    transition: opacity var(--ease);
}

.result-item:hover .result-menu-wrap,
.result-menu-wrap:focus-within {
    opacity: 1;
}

.result-menu-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--c-text-2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--ease), color var(--ease);
}

.result-menu-btn:hover {
    background: var(--c-hover);
    color: var(--c-text);
}

.result-menu-btn .material-symbols-rounded { font-size: 20px; }

.result-menu-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    box-shadow: var(--sh-raise);
    min-width: 176px;
    z-index: 500;
    animation: fadeIn 0.12s ease both;
    overflow: hidden;
}

.result-menu-item:first-child { border-radius: var(--r-md) var(--r-md) 0 0; }
.result-menu-item:last-child  { border-radius: 0 0 var(--r-md) var(--r-md); }
.result-menu-item:only-child  { border-radius: var(--r-md); }

.result-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: transparent;
    border: none;
    font-family: var(--f-body);
    font-size: 13px;
    color: var(--c-text);
    cursor: pointer;
    text-align: left;
    transition: background var(--ease);
}

.result-menu-item:hover { background: var(--c-hover); }
.result-menu-item .material-symbols-rounded { font-size: 17px; color: var(--c-text-2); }

/* -- About sidebar ---------------------------------------------------------- */

.about-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.25);
    z-index: 200;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.about-overlay.visible { opacity: 1; }

.about-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 340px;
    max-width: 92vw;
    background: var(--c-surface);
    border-left: 1px solid var(--c-border);
    box-shadow: -8px 0 32px rgba(0,0,0,.12);
    z-index: 201;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
    overflow-y: auto;
}

.about-sidebar.visible { transform: translateX(0); }

.about-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--c-border);
    position: sticky;
    top: 0;
    background: var(--c-surface);
    z-index: 1;
}

.about-sidebar-header h2 {
    font-family: var(--f-display);
    font-size: 18px;
    font-weight: 400;
    color: var(--c-text);
    margin: 0;
}

.about-sidebar-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--c-text-2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--ease);
}

.about-sidebar-close:hover { background: var(--c-hover); }
.about-sidebar-close .material-symbols-rounded { font-size: 20px; }

.about-sidebar-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.about-site-identity {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sidebar-favicon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-favicon-fallback {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--c-accent), var(--c-accent-d));
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.about-site-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--c-text);
    line-height: 1.3;
}

.about-site-url {
    font-size: 12px;
    color: var(--c-accent);
    text-decoration: none;
}

.about-site-url:hover { text-decoration: underline; }

.about-section {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.about-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--c-text-3, var(--c-text-2));
}

.about-value {
    font-size: 14px;
    color: var(--c-text-2);
    line-height: 1.55;
}

.about-report-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #e53935;
    text-decoration: none;
    font-weight: 500;
    margin-top: 4px;
}

.about-report-link:hover { text-decoration: underline; }
.about-report-link .material-symbols-rounded { font-size: 16px; }

/* -- Why this result sidebar ------------------------------------------------ */

.why-reasons-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.why-reason {
    display: flex;
    align-items: flex-start;
    gap: 11px;
}

.why-reason-icon {
    font-size: 18px;
    color: var(--c-accent);
    flex-shrink: 0;
    margin-top: 1px;
}

.why-reason-text {
    font-size: 14px;
    color: var(--c-text-2);
    line-height: 1.55;
}

/* Advanced separator */
.why-advanced-separator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0;
}

.why-advanced-line {
    flex: 1;
    height: 1px;
    background: var(--c-border);
}

.why-advanced-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--c-text-3, var(--c-text-2));
    white-space: nowrap;
}

/* Stat cards grid */
.why-advanced-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.why-stat-card {
    background: var(--c-hover);
    border: 1px solid var(--c-border);
    border-radius: var(--r-sm, 8px);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.why-stat-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--c-text);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.why-stat-label {
    font-size: 11px;
    color: var(--c-text-3, var(--c-text-2));
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* Advanced items */
.why-advanced-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Token table */
.why-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    color: var(--c-text-2);
    margin-top: 6px;
}

.why-table thead tr {
    border-bottom: 1px solid var(--c-border);
}

.why-table th {
    text-align: left;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--c-text-3, var(--c-text-2));
    padding: 0 8px 6px 0;
}

.why-table td {
    padding: 6px 8px 6px 0;
    vertical-align: middle;
    border-bottom: 1px solid var(--c-border);
}

.why-table tbody tr:last-child td {
    border-bottom: none;
}

.why-table-term {
    font-weight: 500;
}

.why-table-score {
    font-variant-numeric: tabular-nums;
    color: var(--c-text-2);
}

/* Inline code */
.why-code {
    font-family: 'DM Mono', 'Fira Mono', 'Courier New', monospace;
    font-size: 12px;
    background: var(--c-hover);
    border: 1px solid var(--c-border);
    border-radius: 4px;
    padding: 1px 6px;
    color: var(--c-text);
    word-break: break-all;
}

/* -- Search tabs ------------------------------------------------------------ */

.search-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--c-border);
}

.search-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 18px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-family: var(--f-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--c-text-2);
    cursor: pointer;
    transition: color var(--ease), border-color var(--ease);
    border-radius: var(--r-xs) var(--r-xs) 0 0;
    letter-spacing: 0.01em;
}

.search-tab .material-symbols-rounded { font-size: 17px; }
.search-tab:hover { color: var(--c-text); }
.search-tab.active { color: var(--c-accent); border-bottom-color: var(--c-accent); }

/* -- Widget picker ---------------------------------------------------------- */

.widget-picker { display: flex; flex-direction: column; gap: 0; }

.pick-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--c-border);
    cursor: pointer;
    position: relative;
    transition: background var(--ease);
    background: none;
    border-left: none;
    border-right: none;
    border-top: none;
    width: 100%;
    text-align: left;
    font-family: var(--f-body);
}

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

.pick-item::before {
    content: '';
    position: absolute;
    left: -14px; top: 20px; bottom: 20px;
    width: 3px;
    background: var(--c-accent);
    border-radius: 2px;
    opacity: 0;
    transform: scaleY(0.4);
    transition: opacity var(--ease), transform var(--ease);
}

.pick-item:hover::before { opacity: 1; transform: scaleY(1); }

.pick-icon {
    width: 40px; height: 40px;
    flex-shrink: 0;
    border-radius: 10px;
    background: var(--c-accent-bg);
    color: var(--c-accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pick-icon .material-symbols-rounded { font-size: 22px; }

.pick-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

.pick-name {
    font-size: 20px;
    font-weight: 400;
    color: var(--c-link);
    line-height: 1.35;
}

.pick-item:hover .pick-name { text-decoration: underline; }

.pick-desc { font-size: 14px; line-height: 1.65; color: var(--c-text-2); }

/* -- Widget view ------------------------------------------------------------ */

.widget-section { animation: fadeIn 0.3s ease both; }

.widget-back-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--c-border);
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px 5px 8px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-pill);
    background: var(--c-raised);
    font-family: var(--f-body);
    font-size: 13px;
    color: var(--c-text-2);
    cursor: pointer;
    transition: background var(--ease), border-color var(--ease), color var(--ease);
}

.back-btn .material-symbols-rounded { font-size: 16px; }
.back-btn:hover { background: var(--c-hover); color: var(--c-text); border-color: var(--c-ring); }

.widget-frame-title {
    font-size: 13px;
    color: var(--c-text-3);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.widget-frame-title .material-symbols-rounded { font-size: 15px; color: var(--c-accent); }

iframe#widget-iframe {
    display: block;
    width: 100%;
    border: none;
    min-height: 420px;
    transition: opacity 0.2s ease;
}


.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px;
    padding: 40px 0 20px;
}

.pg-btn {
    padding: 8px 14px;
    border: none;
    background: transparent;
    border-radius: var(--r-xs);
    font-family: var(--f-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--c-accent);
    cursor: pointer;
    transition: background var(--ease);
}

.pg-btn:hover:not(:disabled) { background: var(--c-accent-bg); }
.pg-btn:disabled { color: var(--c-text-3); cursor: default; }

.pg-num {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 500;
    color: var(--c-accent);
    cursor: pointer;
    transition: background var(--ease), transform 0.1s ease;
    user-select: none;
}

.pg-num:hover { background: var(--c-accent-bg); transform: scale(1.08); }
.pg-num.active { background: var(--c-accent); color: #fff; cursor: default; transform: none; }

/* -- No results ------------------------------------------------------------- */

.no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 64px 20px;
    text-align: center;
}

.no-results-icon-wrap {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--c-raised);
    border: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
}

.no-results-icon-wrap .material-symbols-rounded { font-size: 34px; color: var(--c-text-3); }
.no-results h2 { font-size: 20px; font-weight: 400; }
.no-results p  { font-size: 14px; color: var(--c-text-2); }

/* -- Results footer --------------------------------------------------------- */

.results-footer {
    padding: 14px 20px;
    text-align: center;
    font-size: 13px;
    color: var(--c-text-2);
    border-top: 1px solid var(--c-border);
    background: var(--c-raised);
}

/* -- Loading ---------------------------------------------------------------- */

.loading-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 24px 0;
    color: var(--c-text-2);
    font-size: 14px;
}

.loading-dots { display: flex; gap: 4px; }

.loading-dots span {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--c-accent);
    animation: ldBounce 1.1s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.11s; }
.loading-dots span:nth-child(3) { animation-delay: 0.22s; }

/* -- Animations ------------------------------------------------------------- */

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

/* -- Feeling Lucky carousel overlay ---------------------------------------- */

.lucky-overlay {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.lucky-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.lucky-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 20px;
    box-shadow: 0 32px 80px rgba(0,0,0,0.22);
    padding: 32px 48px 36px;
    text-align: center;
    min-width: 260px;
    transform: translateY(12px);
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

.lucky-overlay.visible .lucky-card {
    transform: translateY(0);
}

.lucky-label {
    font-size: 13px;
    color: var(--c-text-2);
    margin-bottom: 16px;
    letter-spacing: 0.02em;
}

.lucky-carousel-wrap {
    height: 52px;
    overflow: hidden;
    position: relative;
}

.lucky-carousel-wrap::before,
.lucky-carousel-wrap::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    height: 16px;
    z-index: 1;
    pointer-events: none;
}

.lucky-carousel-wrap::before {
    top: 0;
    background: linear-gradient(to bottom, var(--c-surface), transparent);
}

.lucky-carousel-wrap::after {
    bottom: 0;
    background: linear-gradient(to top, var(--c-surface), transparent);
}

.lucky-carousel {
    display: flex;
    flex-direction: column;
    will-change: transform;
}

.lucky-word {
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--f-display);
    font-size: 28px;
    font-weight: 400;
    color: var(--c-text);
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

.lucky-word-chosen {
    color: var(--c-accent);
}



.doodle-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.doodle-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.doodle-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.doodle-overlay-card {
    position: relative;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 20px;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.22);
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(14px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.doodle-overlay.visible .doodle-overlay-card {
    transform: translateY(0);
}

.doodle-overlay-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--c-raised);
    color: var(--c-text-2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--ease), color var(--ease);
    z-index: 1;
}

.doodle-overlay-close:hover {
    background: var(--c-hover);
    color: var(--c-text);
}

.doodle-overlay-close .material-symbols-rounded { font-size: 20px; }

.doodle-overlay-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
}

.doodle-overlay-body {
    padding: 24px 28px 28px;
}

.doodle-overlay-title {
    font-family: var(--f-display);
    font-size: 24px;
    font-weight: 400;
    color: var(--c-text);
    margin: 0 0 16px;
}

.doodle-overlay-text {
    font-size: 14.5px;
    color: var(--c-text-2);
    line-height: 1.75;
    margin-bottom: 12px;
}

.doodle-overlay-text:last-child { margin-bottom: 0; }

.doodle-overlay-text strong { color: var(--c-text); font-weight: 600; }

.doodle-overlay-text code {
    font-size: 13px;
    background: var(--c-raised);
    border: 1px solid var(--c-border);
    border-radius: 4px;
    padding: 1px 5px;
}



@keyframes ldBounce {
    0%, 80%, 100% { transform: scale(0.55); opacity: 0.4; }
    40%           { transform: scale(1);    opacity: 1; }
}

/* -- Mobile menu (hidden on desktop) ---------------------------------------- */

.mobile-menu-wrap { display: none; position: relative; flex-shrink: 0; }

.mobile-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    box-shadow: var(--sh-raise);
    z-index: 600;
    overflow: hidden;
    animation: fadeIn 0.12s ease both;
}

.mobile-menu-dropdown[hidden] { display: none; }

.mobile-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--c-border);
    font-family: var(--f-body);
    font-size: 15px;
    color: var(--c-text);
    text-decoration: none;
    text-align: left;
    cursor: pointer;
    transition: background var(--ease);
}

.mobile-menu-item:last-child { border-bottom: none; }
.mobile-menu-item:hover, .mobile-menu-item:active { background: var(--c-hover); }
.mobile-menu-item .material-symbols-rounded { font-size: 20px; color: var(--c-text-2); }

/* -- Responsive ------------------------------------------------------------- */

@media (max-width: 768px) {
    .home-title { font-size: 40px; }
    .home-btns  { flex-direction: column; align-items: stretch; }
    .home-action-btn { justify-content: center; }

    .results-content  { margin-left: auto; }
    .results-header-inner { gap: 10px; padding: 10px 16px; }
    .results-logo-text { font-size: 18px; }
    .result-title { font-size: 18px; }
    .result-item::before { display: none; } /* hide accent bar on mobile */
}

@media (max-width: 480px) {
    .home-title { font-size: 32px; }
    .home-logo  { width: 60px; height: 60px; }
    .result-title { font-size: 17px; }
    .results-logo-text { display: none; }
    .results-main { padding: 0 16px 40px; }
}

.home-header-spacer {
    flex: 1;
}

.header-doodles-btn {
    order: -1;
}

/* -- Easter eggs ------------------------------------------------------------ */

/* Barrel roll / flip */
.easter-shake {
    animation: easter-shake-kf 0.08s ease infinite;
}
@keyframes easter-shake-kf {
    0%,100% { transform: translateX(0); }
    25%     { transform: translateX(-8px) rotate(-1deg); }
    75%     { transform: translateX(8px)  rotate(1deg); }
}

/* Rainbow mode */
.easter-rainbow {
    animation: easter-rainbow-kf 0.8s linear infinite;
}
@keyframes easter-rainbow-kf {
    0%   { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* Easter egg result panel */
.easter-panel {
    padding: 40px 0 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: fadeUp 0.4s ease both;
}

.easter-panel-title {
    font-family: var(--f-display);
    font-size: 36px;
    font-weight: 400;
    color: var(--c-text);
    line-height: 1.2;
}

.easter-panel-body {
    font-size: 16px;
    color: var(--c-text-2);
    line-height: 1.7;
}

.easter-panel-extra {
    font-size: 28px;
    margin-top: 8px;
}
/* -- Instant search dropdown ------------------------------------------------ */

.instant-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 14px;
    box-shadow: var(--sh-raise);
    z-index: 9999;
    overflow: hidden;
    animation: fadeIn 0.12s ease both;
}

.instant-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background var(--ease);
    border-bottom: 1px solid var(--c-border);
}

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

.instant-item:hover,
.instant-item.active { background: var(--c-hover); }

.instant-favicon {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    object-fit: contain;
    flex-shrink: 0;
}

.instant-favicon-fallback {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    background: linear-gradient(135deg, var(--c-accent), var(--c-accent-d));
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.instant-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.instant-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--c-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.instant-url {
    font-size: 12px;
    color: var(--c-url);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.instant-arrow {
    font-size: 15px;
    color: var(--c-text-3);
    flex-shrink: 0;
    opacity: 0;
    transition: opacity var(--ease);
}

.instant-item:hover .instant-arrow,
.instant-item.active .instant-arrow { opacity: 1; }

/* -- Mobile layout for the results page ------------------------------------- */
@media (max-width: 768px) {
    html, body.page-results { overflow-x: hidden; max-width: 100%; }

    /* Stop long nowrap content from stretching the grid column past the screen */
    .page-results { grid-template-columns: minmax(0, 1fr); }

    /* Header: logo + search + one menu button */
    .results-header-inner { gap: 10px; padding: 10px 12px; }
    .results-search-form { max-width: none; }
    .page-results .desktop-only { display: none; }
    .page-results .mobile-menu-wrap { display: block; }

    /* Content fills the screen width instead of being offset like desktop */
    .results-main { padding: 0 16px 40px; }
    .results-content { max-width: 100%; width: 100%; margin: 0; padding-top: 8px; }

    .search-tabs { overflow-x: auto; scrollbar-width: none; }
    .search-tabs::-webkit-scrollbar { display: none; }
    .search-tab { padding: 12px 16px; flex-shrink: 0; }

    /* Taller, roomier results */
    .result-item { padding: 22px 36px 22px 0; }
    .result-source { margin-bottom: 8px; }
    .result-domain { font-size: 14px; }
    .result-title {
        font-size: 19px;
        line-height: 1.35;
        margin-bottom: 8px;
        white-space: normal;
        overflow: visible;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        overflow-wrap: anywhere;
    }
    .result-desc {
        font-size: 14.5px;
        line-height: 1.65;
        -webkit-line-clamp: 5;
        overflow-wrap: anywhere;
    }

    /* No hover on touch: keep the 3-dot menu visible */
    .result-menu-wrap { opacity: 1; top: 16px; }

    .pagination { padding: 28px 0 16px; }
    .widget-section iframe, .widget-picker { max-width: 100%; }
}

@media (max-width: 480px) {
    .results-logo-text { display: none; }
    .results-main { padding: 0 14px 32px; }
    .result-title { font-size: 18px; }
}

/* ============================================================================
   CUSTOMIZE PANEL + WALLPAPER
   ============================================================================ */

:root { --wp-scrim: rgba(255,255,255,0.18); --wp-panel: rgba(255,255,255,0.82); }
[data-theme="dark"] { --wp-scrim: rgba(0,0,0,0.38); --wp-panel: rgba(32,33,36,0.82); }

/* Wallpaper layer (created by wallpaper.js) */
#wpLayer {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
}

/* Homepage with a wallpaper: drop dot-grid, keep text readable */
.has-wallpaper.page-home::before { display: none; }
[data-theme="dark"] .has-wallpaper .home-title,
[data-theme="dark"] .has-wallpaper .home-stats,
[data-theme="dark"] .has-wallpaper .stats-link { text-shadow: 0 1px 8px rgba(0,0,0,.35); }
.has-wallpaper.page-home .home-title { color: var(--c-text); }
.has-wallpaper .home-footer {
    background: color-mix(in srgb, var(--c-raised) 80%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Results page with a wallpaper: rounded panel (opaque fading to transparent) behind results */
.has-wallpaper.page-results .results-header {
    background: color-mix(in srgb, var(--c-surface) 82%, transparent);
}
.has-wallpaper.page-results .results-content {
    margin-top: 20px;
    padding: 20px 28px 24px;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--c-surface) 97%, transparent),
        color-mix(in srgb, var(--c-surface) 50%, transparent));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--c-border);
    border-radius: 24px;
    box-shadow: var(--sh-raise);
}
@media (max-width: 768px) {
    .has-wallpaper.page-results .results-content { padding: 14px 16px 18px; border-radius: 18px; }
}

/* Open button (bottom right) + credit (bottom left) - reuse .theme-btn / .home-stats */
.wp-open-btn { position: fixed; right: 20px; bottom: var(--wp-bottom, calc(var(--footer-h, 52px) + 15px)); z-index: 20; }
.wp-credit {
    position: fixed; left: 20px; bottom: var(--wp-bottom, calc(var(--footer-h, 52px) + 15px)); z-index: 20; margin: 0; animation: none;
    max-width: calc(100vw - 100px);
    padding: 8px 14px;
    background: var(--c-raised);
    border: 1.5px solid var(--c-border);
    border-radius: var(--r-sm);
}
.wp-credit[hidden] { display: none; }

/* Customize sidebar extras (everything else uses the About sidebar styles) */
.wp-theme-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wp-theme-row .home-action-btn, .wp-actions .home-action-btn { justify-content: center; padding: 10px 14px; }
.wp-theme-row .home-action-btn.active { border-color: var(--c-accent); background: var(--c-accent-bg); color: var(--c-accent); }
.wp-actions { display: flex; flex-direction: column; gap: 8px; }
.wp-actions .home-action-btn:disabled { opacity: .5; cursor: default; }
.wp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wp-tile {
    aspect-ratio: 16 / 10; padding: 0;
    border: 2px solid transparent; border-radius: var(--r-sm);
    overflow: hidden; background: var(--c-raised); cursor: pointer;
    transition: border-color var(--ease), transform 0.1s ease;
}
.wp-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wp-tile:hover { transform: scale(1.04); }
.wp-tile.active { border-color: var(--c-accent); box-shadow: var(--sh-focus); }
.wp-msg { font-size: 13px; color: var(--c-text-2); min-height: 18px; }

/* Homepage: use the real visible height on mobile so the footer (and the fixed
   buttons above it) sit at the bottom of the screen instead of under the browser bar */
@supports (height: 100dvh) {
    .page-home { min-height: 100dvh; }
}