/* Pika Search — main stylesheet
   Brand: #FFDE34 (Pika Yellow) | Accent Light: #FFF700
*/

/* ===== Fonts (loaded via <link> in HTML for non-blocking) ===== */

/* ===== Custom Properties (Dark default) ===== */
:root {
    color-scheme: dark;

    --pika: #FFDE34;
    --pika-bright: #FFF700;
    --pika-dim: #c4a82e;
    --pika-glow: rgba(255, 222, 52, 0.18);
    --pika-muted: rgba(255, 222, 52, 0.07);

    --bg: #111111;
    --bg-raised: #191919;
    --bg-surface: #1f1f1f;
    --bg-input: #151515;
    --bg-hover: #282828;

    --text: #e5e5e5;
    --text-2: #999999;
    --text-3: #8a8a8a;

    --link: var(--pika);
    --link-visited: #c9ab2a;
    --link-hover: var(--pika-bright);
    --url: #5cb85c;

    --warning-bg: rgba(255, 160, 40, 0.07);
    --warning-border: rgba(255, 160, 40, 0.25);
    --warning-text: #ffaa33;

    --border: #272727;
    --border-subtle: #1e1e1e;

    --r-sm: 6px;
    --r: 10px;
    --r-lg: 14px;
    --r-pill: 100px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 20px var(--pika-glow);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-brand: 'Quicksand', var(--font);

    --max-w: 740px;
    --max-w-wide: 1100px;
    --header-h: 56px;

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --t-fast: 0.12s var(--ease);
    --t: 0.2s var(--ease);
}

/* ===== Light Mode ===== */
@media (prefers-color-scheme: light) {
    :root {
        color-scheme: light;

        --bg: #f5f5f5;
        --bg-raised: #ffffff;
        --bg-surface: #fafafa;
        --bg-input: #efefef;
        --bg-hover: #e8e8e8;

        --text: #1a1a1a;
        --text-2: #555555;
        --text-3: #666666;

        --link: #b8960a;
        --link-visited: #7a6510;
        --link-hover: #9a7d00;
        --url: #2a7a2a;

        --warning-bg: rgba(255, 160, 40, 0.06);
        --warning-border: rgba(255, 160, 40, 0.2);
        --warning-text: #b06e00;

        --border: #dddddd;
        --border-subtle: #eeeeee;

        --pika-glow: rgba(255, 222, 52, 0.3);
        --pika-muted: rgba(255, 222, 52, 0.08);

        --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
        --shadow: 0 3px 12px rgba(0, 0, 0, 0.07);
        --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.1);
        --shadow-glow: 0 0 20px var(--pika-glow);
    }
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--link);
    text-decoration: none;
    transition: color var(--t-fast);
}

a:visited { color: var(--link-visited); }
a:hover { color: var(--link-hover); }

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===== Accessibility ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

:focus-visible {
    outline: 2px solid var(--pika);
    outline-offset: 2px;
}

/* ===== Shared Search Box ===== */
.search-box {
    width: 100%;
    padding: 0.7rem 1rem;
    font-size: 1rem;
    font-family: var(--font);
    background: var(--bg-input);
    color: var(--text);
    border: 2px solid var(--border);
    border-radius: var(--r);
    outline: none;
    transition: border-color var(--t), box-shadow var(--t);
}

.search-box:focus {
    border-color: var(--pika);
    box-shadow: 0 0 0 3px var(--pika-glow);
}

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

/* ===== Buttons ===== */
.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.5rem;
    font-size: 0.92rem;
    font-family: var(--font);
    font-weight: 600;
    border: none;
    border-radius: var(--r);
    cursor: pointer;
    transition: background var(--t), transform 0.1s ease, box-shadow var(--t);
}

.btn-primary {
    background: var(--pika);
    color: #1a1400;
}

.btn-primary:hover {
    background: var(--pika-bright);
    box-shadow: var(--shadow-glow);
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-secondary {
    background: transparent;
    color: var(--text-2);
    border: 1.5px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text);
}

/* ========================================================================
   HOME PAGE
   ======================================================================== */
.view-home {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1.25rem;
}

.view-home .container {
    text-align: center;
    max-width: 540px;
    width: 100%;
}

.hero-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.hero-brand .logo-icon {
    width: 72px;
    height: 72px;
    animation: fade-up 0.5s var(--ease-out) both;
}

.hero-brand .brand-text {
    font-family: var(--font-brand);
    font-size: clamp(2rem, 5vw, 2.5rem);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    animation: fade-up 0.5s var(--ease-out) 0.06s both;
}

.hero-brand .brand-text span {
    color: var(--pika);
}

.home-search-form {
    animation: fade-up 0.5s var(--ease-out) 0.12s both;
}

.home-search-form .search-input-wrapper {
    margin-bottom: 1rem;
}

.home-search-form .search-box {
    font-size: 1.1rem;
    padding: 0.85rem 1.4rem;
    border-radius: var(--r-pill);
}

.home-search-form .buttons {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    animation: fade-up 0.5s var(--ease-out) 0.18s both;
}

.home-search-form .buttons .btn-primary,
.home-search-form .buttons .btn-secondary {
    border-radius: var(--r-pill);
    padding: 0.55rem 1.5rem;
}

/* ========================================================================
   RESULTS HEADER
   ======================================================================== */
.results-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: var(--max-w-wide);
    margin: 0 auto;
    padding: 0.5rem 2rem;
    height: var(--header-h);
}

.logo-sm {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-sm:hover { text-decoration: none; }

.logo-sm .logo-icon {
    width: 28px;
    height: 28px;
}

.logo-sm .brand-text {
    font-family: var(--font-brand);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.logo-sm .brand-text span {
    color: var(--pika);
}

.header-search {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
}

.header-search .search-box {
    padding: 0.45rem 2.5rem 0.45rem 0.75rem;
    font-size: 0.92rem;
    border-radius: var(--r);
}

.search-submit {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    border-radius: var(--r-sm);
    transition: color var(--t-fast);
}

.search-submit:hover {
    color: var(--pika);
}

/* ===== Nav Tabs ===== */
.nav-tabs {
    background: var(--bg-raised);
    border-bottom: 1px solid var(--border);
}

.nav-tabs ul {
    display: flex;
    list-style: none;
    max-width: var(--max-w-wide);
    margin: 0 auto;
    padding: 0 2rem;
}

.nav-tabs a {
    display: block;
    padding: 0.55rem 1.1rem;
    color: var(--text-2);
    font-size: 0.85rem;
    font-weight: 600;
    border-bottom: 2.5px solid transparent;
    transition: color var(--t-fast), border-color var(--t-fast);
    text-decoration: none;
}

.nav-tabs a:visited { color: var(--text-2); }
.nav-tabs a:hover { color: var(--text); text-decoration: none; }

.nav-tabs a.active {
    color: var(--pika);
    border-bottom-color: var(--pika);
}

/* ===== Engine Warnings ===== */
.engine-warnings {
    max-width: var(--max-w-wide);
    margin: 0.75rem auto 0;
    padding: 0 2rem;
}

.engine-warnings:empty { display: none; }

.engine-warning {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    border-radius: var(--r-sm);
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.4rem;
    font-size: 0.82rem;
    color: var(--warning-text);
    line-height: 1.5;
}

/* ========================================================================
   RESULTS LAYOUT
   ======================================================================== */
.results-view {
    min-height: 100vh;
}

.results-body {
    display: flex;
    gap: 2.5rem;
    max-width: var(--max-w-wide);
    margin: 0 auto;
    padding: 1rem 2rem 2rem;
}

.results-main {
    flex: 1;
    min-width: 0;
}

.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-2);
    font-size: 0.95rem;
}

/* ===== Result Item ===== */
.result-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.result-item:first-child {
    padding-top: 0.4rem;
}

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

.result-title {
    font-size: 1.12rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 0.2rem;
}

.result-title a {
    color: var(--link);
    text-decoration: none;
}

.result-title a:visited { color: var(--link-visited); }

.result-title a:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.result-url {
    font-size: 0.8rem;
    color: var(--url);
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.result-snippet {
    font-size: 0.88rem;
    color: var(--text-2);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.result-cached {
    display: inline-block;
    margin-top: 0.3rem;
    font-size: 0.72rem;
    color: var(--text-3);
    text-decoration: none;
    transition: color var(--t-fast);
}

.result-cached:hover {
    color: var(--text-2);
    text-decoration: underline;
}

/* ===== Infobox Sidebar ===== */
.infobox {
    width: 320px;
    flex-shrink: 0;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
    align-self: flex-start;
    position: sticky;
    top: calc(var(--header-h) + 52px);
}

.infobox-thumbnail {
    width: 100%;
    max-height: 180px;
    object-fit: contain;
    background: var(--bg-surface);
    padding: 0.75rem;
}

.infobox-thumbnail[src=""],
.infobox-thumbnail[src="/proxy/image?url="],
.infobox-thumbnail.img-error {
    display: none;
}

.infobox-link[href=""] {
    display: none;
}

.infobox-body {
    padding: 0.85rem 1rem;
}

.infobox h2 {
    font-family: var(--font-brand);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: var(--text);
    line-height: 1.3;
}

.infobox-extract {
    font-size: 0.82rem;
    color: var(--text-2);
    line-height: 1.6;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.infobox-link {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--pika-dim);
    transition: color var(--t-fast);
}

.infobox-link:hover {
    color: var(--pika);
}

.infobox-link:visited {
    color: var(--pika-dim);
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 1.75rem 0 1rem;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.1rem;
    height: 2.1rem;
    padding: 0 0.45rem;
    border-radius: var(--r-sm);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: background var(--t-fast);
}

.pagination a {
    color: var(--text);
    background: var(--bg-surface);
    border: 1px solid var(--border);
}

.pagination a:visited { color: var(--text); }

.pagination a:hover {
    background: var(--bg-hover);
    text-decoration: none;
}

.pagination .active {
    background: var(--pika);
    color: #1a1400;
    font-weight: 700;
    border: none;
}

.pagination .disabled {
    color: var(--text-3);
    pointer-events: none;
}

/* ========================================================================
   IMAGES GRID
   ======================================================================== */
.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem 1rem;
    max-width: var(--max-w-wide);
    margin: 1.5rem auto;
    padding: 0 1.5rem;
}

.image-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
    text-decoration: none;
    transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}

.image-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--text-3);
    text-decoration: none;
}

.image-card .image-thumb {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: linear-gradient(
        110deg,
        var(--bg-input) 30%,
        var(--bg-hover) 50%,
        var(--bg-input) 70%
    );
    background-size: 200% 100%;
    animation: shimmer 1.4s ease-in-out infinite;
    will-change: background-position;
    contain: strict;
}

.image-card .image-thumb.loaded {
    animation: none;
    background: var(--bg-input);
    will-change: auto;
    contain: none;
}

.image-card .image-details {
    padding: 0.55rem 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-height: 2.5rem;
}

.image-card .image-title {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.image-card .image-source {
    font-size: 0.7rem;
    color: var(--url);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

/* Images page pagination */
.images-view .pagination {
    max-width: var(--max-w-wide);
    margin: 0 auto;
    padding: 1rem 1.5rem 2rem;
}

/* ========================================================================
   ERROR PAGE
   ======================================================================== */
.error-view {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 2rem 1.25rem;
}

.error-inner {
    max-width: 400px;
}

.error-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 2rem;
    text-decoration: none;
}

.error-brand:hover { text-decoration: none; }

.error-brand .logo-icon {
    width: 52px;
    height: 52px;
}

.error-brand .brand-text {
    font-family: var(--font-brand);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
}

.error-brand .brand-text span {
    color: var(--pika);
}

.error-code {
    font-family: var(--font-brand);
    font-size: clamp(3.5rem, 10vw, 5.5rem);
    font-weight: 700;
    color: var(--pika);
    line-height: 1;
    margin-bottom: 0.4rem;
}

.error-message {
    font-size: 1rem;
    color: var(--text-2);
    margin-bottom: 2rem;
    line-height: 1.5;
}

.error-home {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1.5rem;
    background: var(--pika);
    color: #1a1400;
    border-radius: var(--r-pill);
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    transition: background var(--t), box-shadow var(--t);
}

.error-home:hover {
    background: var(--pika-bright);
    box-shadow: var(--shadow-glow);
    text-decoration: none;
}

.error-home:visited { color: #1a1400; }

/* ========================================================================
   ADMIN DASHBOARD
   ======================================================================== */
.admin-view {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 1.25rem 3rem;
}

/* Admin nav bar */
.admin-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.admin-nav .admin-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.admin-nav .admin-brand:hover { text-decoration: none; }

.admin-nav .admin-brand .logo-icon {
    width: 26px;
    height: 26px;
}

.admin-nav .admin-brand h1 {
    font-family: var(--font-brand);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}

.admin-nav .admin-brand h1 span {
    color: var(--pika);
    font-weight: 600;
}

.admin-nav .admin-back {
    font-size: 0.82rem;
    color: var(--text-3);
    text-decoration: none;
    transition: color var(--t-fast);
}

.admin-nav .admin-back:hover { color: var(--text); }

/* Admin login */
.admin-login {
    text-align: center;
    padding: 4rem 0;
    max-width: 340px;
    margin: 0 auto;
}

.admin-login p {
    color: var(--text-2);
    margin-bottom: 1.5rem;
    font-size: 0.92rem;
}

.admin-login-form {
    display: flex;
    gap: 0.5rem;
}

.admin-login input[type="password"] {
    flex: 1;
    padding: 0.55rem 0.85rem;
    font-size: 0.92rem;
    font-family: var(--font);
    border: 2px solid var(--border);
    border-radius: var(--r);
    background: var(--bg-input);
    color: var(--text);
    outline: none;
    transition: border-color var(--t);
}

.admin-login input[type="password"]:focus {
    border-color: var(--pika);
}

/* Overview stats row */
.admin-stats {
    display: flex;
    gap: 2.5rem;
    padding: 1.25rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.admin-stat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.admin-stat .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.admin-stat .stat-label {
    font-size: 0.72rem;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}

/* Section headings */
.admin-section {
    margin-bottom: 2rem;
}

.admin-section h2 {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.75rem;
    letter-spacing: 0.01em;
}

/* Engine table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    font-size: 0.85rem;
}

.admin-table th {
    color: var(--text-3);
    font-weight: 500;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border);
}

.admin-table td {
    border-bottom: 1px solid var(--border-subtle);
}

.admin-table tbody tr:hover td {
    background: var(--pika-muted);
}

.latency-bar {
    display: inline-block;
    height: 4px;
    background: var(--pika);
    border-radius: 2px;
    min-width: 3px;
    vertical-align: middle;
    margin-right: 0.4rem;
}

/* Cache row — simple inline stats */
.cache-stats {
    display: flex;
    gap: 2rem;
    align-items: baseline;
}

.cache-stat {
    font-size: 0.88rem;
    color: var(--text-2);
}

.cache-stat strong {
    color: var(--text);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Admin actions */
.admin-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
}

.admin-actions .btn-secondary {
    font-size: 0.8rem;
    padding: 0.4rem 1rem;
}

/* ========================================================================
   RESPONSIVE
   ======================================================================== */
@media (max-width: 768px) {
    .results-body {
        flex-direction: column-reverse;
    }

    .infobox {
        width: 100%;
        position: static;
    }

    .hero-brand .logo-icon {
        width: 60px;
        height: 60px;
    }

    .images-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1rem 0.75rem;
        padding: 0 1rem;
    }

    .admin-stats {
        flex-wrap: wrap;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .home-search-form .buttons {
        flex-direction: column;
    }

    .home-search-form .buttons .btn-primary,
    .home-search-form .buttons .btn-secondary {
        width: 100%;
    }

    .hero-brand .brand-text {
        font-size: 1.75rem;
    }

    .images-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem 0.5rem;
    }

    .logo-sm .brand-text {
        display: none;
    }

    .admin-login-form {
        flex-direction: column;
    }

    .admin-nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .admin-stats {
        gap: 1rem;
    }

    .cache-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ========================================================================
   LOADING STATES
   ======================================================================== */

/* --- Top progress bar (activates on navigation) --- */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--pika);
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-bar.active {
    opacity: 1;
    animation: progress-fill 1.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes progress-fill {
    0%   { width: 0; }
    15%  { width: 30%; }
    50%  { width: 60%; }
    80%  { width: 82%; }
    100% { width: 92%; }
}

/* --- Button loading state --- */
.btn-loading {
    position: relative;
    pointer-events: none;
    color: transparent !important;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    border: 2.5px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: btn-spin 0.55s linear infinite;
}

.btn-primary.btn-loading::after {
    border-top-color: #1a1400;
}

.btn-secondary.btn-loading::after {
    border-top-color: var(--text-2);
}

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

/* --- Search submit spinner (replaces icon) --- */
.search-submit.is-loading svg {
    display: none;
}

.search-submit.is-loading::after {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    border-top-color: var(--pika);
    border-radius: 50%;
    animation: btn-spin 0.55s linear infinite;
}

/* --- Image shimmer placeholder --- */
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ========================================================================
   ANIMATIONS
   ======================================================================== */
@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .progress-bar.active {
        width: 92%;
        animation: none;
    }
    .image-thumb {
        animation: none;
    }
}
