/* TrueCoffee — Cozy Coffee Aesthetic */

html { scroll-behavior: smooth; }

/* ── Grain Texture Overlay ────────────────────────── */
.grain-overlay {
    position: fixed; inset: 0; z-index: 50; pointer-events: none; opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat; background-size: 256px 256px;
}

/* ── Custom Scrollbar ─────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #FFF8F0; }
::-webkit-scrollbar-thumb { background: #D4A574; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #B8834A; }

/* ── Navigation ───────────────────────────────────── */
.nav-bar { background: linear-gradient(180deg, #3A2212 0%, #2A180D 100%); box-shadow: 0 2px 12px rgba(42,24,13,0.3); position: relative; z-index: 40; }
.nav-link { display: inline-block; padding: 0.5rem 0.875rem; border-radius: 0.5rem; font-size: 0.875rem; font-weight: 500; color: #E8C9A4; transition: all 0.2s ease; }
.nav-link:hover { background: rgba(232,201,164,0.12); color: #FFF8F0; }

/* ── Footer ───────────────────────────────────────── */
.footer-bar { background: linear-gradient(180deg, #2A180D 0%, #1E110A 100%); }

/* ── Cards ────────────────────────────────────────── */
.coffee-card {
    background: #FFFCF7; border: 1px solid #F5E6D3; border-radius: 1rem;
    overflow: hidden; transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    position: relative;
}
.coffee-card:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(74,44,23,0.1); border-color: #E8C9A4; }

/* ── Card Image — Fixed 1:1 square, crops to fill ── */
.coffee-card-image {
    position: relative; width: 100%;
    padding-top: 100%; /* forces 1:1 aspect ratio */
    overflow: hidden; background: #FCECD8;
}
.coffee-card-image img,
.coffee-card-image .coffee-card-placeholder {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.coffee-card-image img { transition: transform 0.3s ease; }
.coffee-card:hover .coffee-card-image img { transform: scale(1.03); }
.coffee-card-placeholder {
    object-fit: initial; display: flex; align-items: center; justify-content: center;
}

/* ── Card Seal Overlay ─────────────────────────────── */
.coffee-card-image .seal-overlay {
    position: absolute; bottom: 0; left: 0; z-index: 10;
    display: flex !important; align-items: center; gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    background: #2D6A4F !important;
    color: #fff !important;
    font-size: 0.65rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
    font-family: 'DM Sans', system-ui, sans-serif;
    white-space: nowrap;
    box-shadow: 0 -1px 6px rgba(0,0,0,0.15);
}
.coffee-card-image .seal-overlay-gold {
    background: linear-gradient(135deg, #D97706 0%, #F59E0B 40%, #FBBF24 60%, #F59E0B 100%) !important;
}

/* ── Inline Seal Badges (detail page, standard page) ── */
.seal-badge {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.35rem 0.75rem; border-radius: 0.5rem;
    font-size: 0.75rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
    font-family: 'Inter', system-ui, sans-serif;
    white-space: nowrap;
}
.seal-badge svg { width: 14px; height: 14px; flex-shrink: 0; }
.seal-gold {
    background: linear-gradient(135deg, #D97706 0%, #F59E0B 40%, #FBBF24 60%, #F59E0B 100%);
    color: #fff;
}
.seal-standard {
    background: #2D6A4F;
    color: #fff;
}

/* ── Hero Section ─────────────────────────────────── */
.hero-section {
    background: linear-gradient(145deg, #3A2212 0%, #4A2C17 35%, #6B4423 70%, #8B5E34 100%);
    position: relative; overflow: hidden;
}
.hero-section::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(ellipse 80% 60% at 70% 40%, rgba(184,131,74,0.15), transparent),
                radial-gradient(ellipse 50% 80% at 20% 80%, rgba(74,44,23,0.3), transparent);
    pointer-events: none;
}
.hero-search input { font-size: 1.125rem; }

/* ── Seal Toggle Buttons ─────────────────────────── */
.seal-toggle {
    display: inline-block; padding: 0.375rem 0.75rem; border-radius: 9999px;
    font-size: 0.75rem; font-weight: 600; cursor: pointer;
    border: 1.5px solid #E8C9A4; background: #FFFCF7; color: #8B5E34;
    transition: all 0.15s ease; user-select: none;
}
.seal-toggle:hover { border-color: #D4A574; background: #FDF8F3; }
.seal-toggle.active { background: #6B4423; color: #FFF8F0; border-color: #6B4423; }
.seal-toggle-gold.active { background: linear-gradient(135deg, #D97706, #F59E0B); color: #451A03; border-color: #D97706; }
.seal-toggle-standard.active { background: #5C8A6A; color: #F0FFF4; border-color: #5C8A6A; }
.seal-toggle-sealed.active { background: #4A2C17; color: #E8C9A4; border-color: #4A2C17; }

/* ── Stat Cards ───────────────────────────────────── */
.stat-card {
    background: #FFFCF7; border: 1px solid #F5E6D3; border-radius: 1rem;
    padding: 1.5rem; text-align: center; transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(74,44,23,0.08); }

/* ── Badges ───────────────────────────────────────── */
.badge-na { background-color: #FEF3C7; color: #92400E; border: 1px solid #FCD34D; }
.badge-match { background-color: #D1FAE5; color: #065F46; }
.badge-diff { background-color: #FEE2E2; color: #991B1B; }
.badge-sca { background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%); color: #065F46; }

/* ── Transparency Panel ─────────────────────────────── */
.transparency-row {
    display: flex; align-items: flex-start; gap: 0.75rem;
    padding: 0.875rem 1rem; border-radius: 0.75rem; border: 1px solid transparent;
}
.transparency-provided { background: #F0FFF4; border-color: #BBF7D0; }
.transparency-hidden { background: #FEF2F2; border-color: #FECACA; }
.transparency-bonus { background: #F9FAFB; border-color: #E5E7EB; }

/* ── Glossary Tooltips ─────────────────────────────── */
.glossary-term { border-bottom: 1px dashed #B8834A; cursor: help; text-decoration: none; color: inherit; }
.glossary-term:hover { color: #8B5E34; }
.glossary-tooltip {
    position: fixed; z-index: 9999; max-width: 280px;
    padding: 0.625rem 0.875rem; background: #3A2212; color: #FFF8F0;
    font-size: 0.8125rem; line-height: 1.5; border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(42,24,13,0.3); pointer-events: none;
    font-family: 'DM Sans', system-ui, sans-serif;
}

/* ── Form Elements ────────────────────────────────── */
.input-field {
    width: 100%; border: 1px solid #E8C9A4; border-radius: 0.625rem;
    padding: 0.625rem 0.875rem; background: #FFFCF7;
    font-family: 'DM Sans', system-ui, sans-serif;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input-field:focus { outline: none; border-color: #B8834A; box-shadow: 0 0 0 3px rgba(184,131,74,0.15); }
.btn-primary {
    background: linear-gradient(135deg, #6B4423 0%, #8B5E34 100%); color: #FFF8F0;
    padding: 0.625rem 1.5rem; border-radius: 0.625rem; font-weight: 600;
    font-family: 'DM Sans', system-ui, sans-serif;
    transition: all 0.2s ease; border: none; cursor: pointer;
}
.btn-primary:hover { background: linear-gradient(135deg, #4A2C17 0%, #6B4423 100%); box-shadow: 0 4px 12px rgba(74,44,23,0.2); transform: translateY(-1px); }
.btn-secondary {
    background: #F5E6D3; color: #4A2C17; padding: 0.5rem 1.25rem;
    border-radius: 0.625rem; font-weight: 500;
    font-family: 'DM Sans', system-ui, sans-serif;
    transition: all 0.2s ease; border: 1px solid #E8C9A4;
}
.btn-secondary:hover { background: #E8C9A4; border-color: #D4A574; }

/* ── Animations ───────────────────────────────────── */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.fade-in-up { animation: fadeInUp 0.5s ease-out both; }
.fade-in { animation: fadeIn 0.4s ease-out both; }
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }

/* ── Loading Spinner ──────────────────────────────── */
.spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid #F5E6D3; border-top-color: #8B5E34; border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ────────────────────────────────────────── */
.toast {
    position: fixed; bottom: 20px; right: 20px; background: #4A2C17; color: #FFF8F0;
    padding: 0.75rem 1.5rem; border-radius: 0.75rem; box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    z-index: 1000; animation: fadeInUp 0.3s ease-out;
    font-family: 'DM Sans', system-ui, sans-serif; font-size: 0.875rem;
}

/* ── Info Page ────────────────────────────────────── */
.info-section { scroll-margin-top: 5rem; }
.process-card { background: #FFFCF7; border: 1px solid #F5E6D3; border-radius: 1rem; padding: 2rem; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.process-card:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(74,44,23,0.08); }
.process-icon { width: 64px; height: 64px; border-radius: 1rem; display: flex; align-items: center; justify-content: center; font-size: 1.75rem; margin-bottom: 1rem; }

/* ── Section Dividers ─────────────────────────────── */
.section-divider { width: 64px; height: 3px; background: linear-gradient(90deg, #B8834A, #D4A574); border-radius: 2px; margin: 0 auto; }

/* ── Filter sidebar mobile toggle ─────────────────── */
@media (max-width: 1023px) {
    #filter-form.hidden { display: none; }
}