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

/* ===== Design Tokens ===== */
:root {
    /* Core palette — white with recycling green */
    --bg-primary: #ffffff;
    --bg-secondary: #f4f9f5;
    --bg-card: #ffffff;
    --bg-muted: #f0f7f2;

    --text-primary: #1a2e1e;
    --text-secondary: #4a6651;
    --text-muted: #7a9b82;

    --accent: #2e7d32;
    /* Recycling green */
    --accent-light: #4caf50;
    --accent-pale: #e8f5e9;
    --accent-glow: rgba(46, 125, 50, 0.15);
    --accent-hover: #1b5e20;

    /* Bin colours */
    --bin-blue: #1565c0;
    --bin-blue-bg: #e3f2fd;
    --bin-blue-border: #90caf9;
    --bin-green: #2e7d32;
    --bin-green-bg: #e8f5e9;
    --bin-green-border: #a5d6a7;
    --bin-purple: #6a1b9a;
    --bin-purple-bg: #f3e5f5;
    --bin-purple-border: #ce93d8;
    --bin-special: #e65100;
    --bin-special-bg: #fff3e0;
    --bin-special-border: #ffcc80;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2.5rem;
    --space-2xl: 4rem;

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-soft: 0 2px 16px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 6px 24px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: 0.2s var(--ease-out);
    --transition-med: 0.35s var(--ease-out);

    /* Typography */
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Space Grotesk', 'Inter', sans-serif;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--bg-secondary);
    line-height: 1.6;
    min-height: 100vh;
}

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

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* ===== Main Container (default for non-home pages) ===== */
.main-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    background: #ffffff;
    min-height: 100vh;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.04);
}

/* ===== Non-Home Page Legacy Styles ===== */
.header {
    text-align: center;
    padding: 2.5rem 0;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 2rem;
}

.header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.header p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

.search-section {
    margin-bottom: 2rem;
}

.search-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.search-section p {
    color: #7f8c8d;
    margin-bottom: 1.2rem;
}

.search-form {
    width: 100%;
}

.search-input-wrapper {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.search-input-wrapper input[type="text"] {
    flex: 1;
    min-width: 200px;
    font-size: 1.1rem;
    padding: 0.85rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    outline: none;
}

.search-input-wrapper input[type="text"]:focus {
    border-color: #27ae60;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.15);
}

.search-input-wrapper button {
    padding: 0.85rem 1.8rem;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: 10px;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.25s;
    white-space: nowrap;
}

.search-input-wrapper button:hover {
    background: linear-gradient(135deg, #229954, #27ae60);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
    transform: translateY(-1px);
}

.loading-spinner {
    text-align: center;
    padding: 2rem;
    color: #7f8c8d;
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #27ae60;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.bin-card {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
    padding: 1.5rem;
    border-radius: 15px;
    margin: 1.25rem 0;
    border-left: 6px solid #bdc3c7;
    background: #f8f9fa;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.06);
}

.bin-blue {
    border-color: #2196F3;
}

.bin-green {
    border-color: #4CAF50;
}

.bin-purple {
    border-color: #9C27B0;
}

.bin-special {
    border-color: #FF9800;
}

.info-box {
    background: #e8f4f8;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    margin: 1rem 0;
}

.warning-box {
    background: #fff3cd;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
    margin: 1rem 0;
}

.footer-info {
    text-align: center;
    color: #7f8c8d;
    padding: 1.5rem 0;
}

@media (max-width: 768px) {
    .main-container {
        padding: 1rem;
    }

    .search-input-wrapper {
        flex-direction: column;
    }

    .search-input-wrapper button {
        width: 100%;
    }
}


/* ================================================================
   HOME PAGE — "Clean White Eco" Theme
   ================================================================ */

.neo-main {
    max-width: 100%;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: none;
}

/* Subtle green ambient glow at top */
.eco-texture-overlay {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(ellipse 80% 30% at 50% 0%, rgba(46, 125, 50, 0.06) 0%, transparent 70%);
}

.neo-container {
    position: relative;
    z-index: 10;
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-lg);
}

/* ===== Green top bar accent ===== */
.neo-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light), var(--accent));
    z-index: 100;
}

/* ===== Hero Header ===== */
.neo-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--accent);
    line-height: 1.1;
    margin-bottom: var(--space-sm);
}

.hero-subtitle {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.hero-tagline {
    margin-top: var(--space-md);
    font-size: 1rem;
    color: var(--text-muted);
}

/* ===== Search Row ===== */
.neo-search-section {
    margin-bottom: var(--space-xl);
}

.neo-input-group {
    display: flex;
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-card);
    border: 2px solid #d4e8d6;
    box-shadow: var(--shadow-soft);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.neo-input-group:focus-within {
    border-color: var(--accent-light);
    box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow-soft);
}

.neo-input {
    flex: 1;
    padding: var(--space-md) var(--space-lg);
    font-size: 1.05rem;
    font-weight: 400;
    font-family: var(--font-body);
    background: transparent;
    color: var(--text-primary);
    border: none;
    outline: none;
}

.neo-input::placeholder {
    color: var(--text-muted);
}

.neo-button {
    padding: var(--space-md) var(--space-xl);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-heading);
    background: var(--accent);
    color: #ffffff;
    border: none;
    cursor: pointer;
    transition: background var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.neo-button:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.neo-button:active {
    transform: scale(0.97);
}

.neo-button.is-loading {
    opacity: 0.6;
    pointer-events: none;
    animation: pulse-btn 1s ease-in-out infinite;
}

@keyframes pulse-btn {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 0.35;
    }
}

/* ===== Results Area ===== */
.neo-results {
    margin-bottom: var(--space-xl);
}

.neo-query {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.neo-result-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

/* ===== Result Card ===== */
.neo-result-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border-left: 5px solid var(--accent);
    box-shadow: var(--shadow-soft);
    margin-bottom: var(--space-lg);
    overflow: hidden;
    animation: slideUpFade 0.4s var(--ease-out) both;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Colour variants */
.neo-result-card.blue {
    border-color: var(--bin-blue);
    background: var(--bin-blue-bg);
}

.neo-result-card.green {
    border-color: var(--bin-green);
    background: var(--bin-green-bg);
}

.neo-result-card.purple {
    border-color: var(--bin-purple);
    background: var(--bin-purple-bg);
}

.neo-result-card.special {
    border-color: var(--bin-special);
    background: var(--bin-special-bg);
}

/* Card inner layout — image + text side by side */
.neo-result-inner {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-lg) var(--space-xl);
}

.neo-result-bin-img {
    flex: 0 0 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.neo-result-bin-img img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.15));
}

.neo-result-bin-emoji {
    font-size: 4rem;
    line-height: 1;
}

.neo-result-body {
    flex: 1;
    min-width: 0;
}

.neo-result-card h3 {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.neo-result-card .neo-result-category {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.neo-result-card .bin-instructions {
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text-secondary);
}

/* ===== Info & Warning Boxes ===== */
.neo-info-box {
    background: var(--accent-pale);
    border: 1px solid #c8e6c9;
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    animation: slideUpFade 0.4s var(--ease-out) 0.1s both;
}

.neo-info-box strong {
    color: var(--accent-hover);
}

.neo-warning-box {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    font-size: 0.95rem;
    color: #5d4037;
    margin-bottom: var(--space-lg);
    animation: slideUpFade 0.4s var(--ease-out) 0.05s both;
}

.neo-warning-box strong {
    color: var(--bin-special);
}

.neo-warning-box .neo-link {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ===== AI Analysis ===== */
.neo-results .ai-analysis {
    margin-top: var(--space-md);
}

.neo-results .ai-analysis summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    padding: var(--space-sm) 0;
    font-size: 0.875rem;
    letter-spacing: 0.02em;
    transition: color var(--transition-fast);
    list-style: none;
}

.neo-results .ai-analysis summary:hover {
    color: var(--text-secondary);
}

.neo-results .ai-analysis p {
    padding: var(--space-md);
    background: var(--bg-muted);
    border: 1px solid #d4e8d6;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    line-height: 1.6;
    margin-top: var(--space-sm);
    font-size: 0.9rem;
}

/* ===== Loading Scanner ===== */
.neo-scanning {
    padding: var(--space-xl);
    background: var(--bg-card);
    border: 2px solid #c8e6c9;
    border-radius: var(--radius-lg);
    text-align: center;
    color: var(--accent);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
    box-shadow: var(--shadow-soft);
}

.scanner-box {
    width: 100%;
    height: 4px;
    background: #c8e6c9;
    border-radius: var(--radius-full);
    margin-bottom: var(--space-lg);
    overflow: hidden;
}

.scanner-line {
    width: 30%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    border-radius: var(--radius-full);
    animation: scan 1.2s infinite ease-in-out;
}

@keyframes scan {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(400%);
    }
}

/* Related items */
.neo-related {
    margin-top: var(--space-lg);
    animation: slideUpFade 0.4s var(--ease-out) 0.15s both;
}

.neo-related h3 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: var(--space-sm);
}

.neo-related .related-note {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: var(--space-md);
}

.neo-related .related-item-card {
    background: var(--bg-card);
    border: 1px solid #d4e8d6;
    border-left: 3px solid var(--accent-light);
    border-radius: var(--radius-sm);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
    box-shadow: var(--shadow-soft);
}

.neo-related .related-item-card summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.neo-related .related-item-card p {
    padding-top: var(--space-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* ===== Bin Guide Section ===== */
.neo-bin-guide {
    margin-top: var(--space-2xl);
    transition: opacity var(--transition-med), max-height var(--transition-med);
    overflow: hidden;
}

.neo-bin-guide.collapsed {
    opacity: 0;
    max-height: 0;
    margin-top: 0;
    pointer-events: none;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
}

.bin-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

/* Guide cards */
.neo-card {
    background: var(--bg-card);
    border: 1px solid #d4e8d6;
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-soft);
    transition: all var(--transition-med);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.neo-card.hover-lift:hover {
    transform: translateY(-3px);
    border-color: var(--accent-light);
    box-shadow: var(--shadow-hover);
}

.card-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-md);
}

/* Uniform bin image size in guide cards */
.bin-pixel-img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    display: block;
}

.custom-icon {
    width: 48px;
    height: 48px;
}

.blue-icon {
    color: var(--bin-blue);
}

.green-icon {
    color: var(--bin-green);
}

.purple-icon {
    color: var(--bin-purple);
}

.neo-card h3 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.neo-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ===== Footer ===== */
.neo-footer {
    margin-top: var(--space-2xl);
    padding-top: var(--space-lg);
    border-top: 1px solid #d4e8d6;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.neo-footer strong {
    color: var(--text-secondary);
}

.neo-link {
    color: var(--accent);
    font-weight: 600;
    transition: color var(--transition-fast);
}

.neo-link:hover {
    color: var(--accent-hover);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .neo-container {
        padding: var(--space-xl) var(--space-md);
    }

    .neo-input-group {
        flex-direction: column;
        border-radius: var(--radius-md);
    }

    .neo-input {
        padding: var(--space-md);
    }

    .neo-button {
        padding: var(--space-md);
        border-radius: 0 0 var(--radius-md) var(--radius-md);
    }

    .bin-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .neo-result-inner {
        flex-direction: column;
        align-items: flex-start;
        padding: var(--space-md);
    }

    .neo-result-bin-img {
        flex: none;
    }
}