/* ============================================================
   AT Bible Study — Design System
   Complete CSS design system with dark mode, responsive layout,
   and Bible-specific components.
   ============================================================ */

/* ----- Alpine.js Utilities ----- */
[x-cloak] { display: none !important; }

/* ----- Font Imports ----- */
@font-face {
    font-family: 'New Order Bold';
    src: url('/fonts/NewOrderBold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ----- Design Tokens ----- */
:root {
    --color-paper: #F4EFE2;
    --color-evergreen: #121C0D;
    --color-spruce: #4B6755;
    --color-truth-gold: #8F5E2A;
    --color-firey-red: #C41800;
    --color-card: #F4EFE2;
    --color-border: color-mix(in srgb, var(--color-spruce) 15%, transparent);
    --color-spruce-mist: color-mix(in srgb, var(--color-spruce) 60%, transparent);
    --color-surface-alt: color-mix(in srgb, var(--color-spruce) 5%, transparent);
    --color-bg: var(--color-paper);
    --font-heading: 'New Order Bold', 'Arial Black', sans-serif;
    --font-body: 'Poppins', sans-serif;
    --sidebar-width: 220px;
    --bottom-nav-height: 64px;

    /* Bible category colors */
    --cat-pentateuch: #8F5E2A;
    --cat-historical: #4B6755;
    --cat-poetry: #6B5B7B;
    --cat-major-prophets: #7A4A3A;
    --cat-minor-prophets: #8B6E4E;
    --cat-gospels: #8F5E2A;
    --cat-history-nt: #4B6755;
    --cat-pauline: #3D5A80;
    --cat-general: #6B5B7B;
    --cat-prophecy: #7A4A3A;
}

.dark {
    --color-paper: #1C2420;
    --color-evergreen: #E8E3D6;
    --color-spruce: #7FA08C;
    --color-truth-gold: #D4A04A;
    --color-firey-red: #FF4433;
    --color-card: #243029;
}

/* Dark mode button overrides for WCAG AA contrast */
.dark .btn-primary {
    background: #B8862A;
    color: #fff;
}
.dark .bottom-nav-item {
    opacity: 0.8;
}
/* Dark mode input focus outline for high-contrast mode support */
.dark .input:focus {
    outline: 2px solid var(--color-truth-gold);
    outline-offset: 1px;
}
/* Dark mode translation select arrow visibility */
.dark #translation-select {
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%237FA08C' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

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

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

a {
    color: inherit;
    text-decoration: none;
}

button {
    cursor: pointer;
    font: inherit;
    border: none;
    background: none;
}

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

/* ----- Focus Indicators (WCAG 2.4.7) ----- */
:focus-visible {
    outline: 2px solid var(--color-truth-gold);
    outline-offset: 2px;
}

/* ----- Screen Reader Only ----- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

.font-heading { font-family: var(--font-heading); }
.font-body    { font-family: var(--font-body); }

.text-xs   { font-size: 0.75rem; line-height: 1rem; }
.text-sm   { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg   { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl   { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl  { font-size: 1.5rem; line-height: 2rem; }
.text-3xl  { font-size: 1.875rem; line-height: 2.25rem; }

.font-normal   { font-weight: 400; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }

.tracking-tight  { letter-spacing: -0.025em; }
.tracking-widest { letter-spacing: 0.1em; }

.text-center { text-align: center; }
.text-spruce { color: var(--color-spruce); }
.text-gold   { color: var(--color-truth-gold); }
.text-red    { color: var(--color-firey-red); }
.uppercase   { text-transform: uppercase; }
.underline   { text-decoration: underline; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */

.flex      { display: flex; }
.flex-col  { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1    { flex: 1; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }

.grid   { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* ============================================================
   SPACING
   ============================================================ */

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }

.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }

.ml-2 { margin-left: 0.5rem; }
.ml-auto { margin-left: auto; }

.mb-8 { margin-bottom: 2rem; }

/* ============================================================
   DISPLAY
   ============================================================ */

.w-full       { width: 100%; }
.h-full       { height: 100%; }
.hidden       { display: none; }
.block        { display: block; }
.inline-block { display: inline-block; }
.relative     { position: relative; }
.absolute     { position: absolute; }

/* ============================================================
   COMPONENTS — Buttons
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.25rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s ease, opacity 0.15s ease, transform 0.1s ease;
    text-decoration: none;
}

.btn:hover { opacity: 0.9; }
.btn:active { transform: scale(0.98); }

.btn-primary {
    background: var(--color-truth-gold);
    color: #fff;
}

.btn-spruce {
    background: var(--color-spruce);
    color: #fff;
}

.btn-danger {
    background: var(--color-firey-red);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--color-spruce);
    color: var(--color-spruce);
}
.btn-outline:hover {
    background: var(--color-spruce);
    color: #fff;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* ============================================================
   COMPONENTS — Form Inputs
   ============================================================ */

.input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    border: 1.5px solid color-mix(in srgb, var(--color-spruce) 30%, transparent);
    background: color-mix(in srgb, var(--color-spruce) 5%, var(--color-paper));
    color: var(--color-evergreen);
    font-family: var(--font-body);
    font-size: 0.875rem;
    line-height: 1.5;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input::placeholder {
    color: color-mix(in srgb, var(--color-evergreen) 50%, transparent);
}

.input:focus {
    outline: 2px solid var(--color-truth-gold);
    outline-offset: 1px;
    border-color: var(--color-truth-gold);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-truth-gold) 20%, transparent);
}

textarea.input {
    resize: vertical;
    min-height: 5rem;
}

select.input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%234B6755' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

/* ============================================================
   COMPONENTS — Cards
   ============================================================ */

.card {
    background: var(--color-card);
    border: 1px solid color-mix(in srgb, var(--color-spruce) 15%, transparent);
    border-radius: 0.75rem;
    padding: 1.25rem;
}

/* ============================================================
   COMPONENTS — Bible Book Cards
   ============================================================ */

.bible-book-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    background: var(--color-card);
    border: 1px solid color-mix(in srgb, var(--color-spruce) 12%, transparent);
    border-left: 3px solid var(--cat-pentateuch);
    border-radius: 6px;
    text-decoration: none;
    color: var(--color-evergreen);
    transition: transform 0.1s ease, box-shadow 0.15s ease;
}

.bible-book-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.bible-book-card:active { transform: translateY(0); }

.bible-book-card.cat-pentateuch { border-left-color: var(--cat-pentateuch); }
.bible-book-card.cat-historical { border-left-color: var(--cat-historical); }
.bible-book-card.cat-poetry { border-left-color: var(--cat-poetry); }
.bible-book-card.cat-major-prophets { border-left-color: var(--cat-major-prophets); }
.bible-book-card.cat-minor-prophets { border-left-color: var(--cat-minor-prophets); }
.bible-book-card.cat-gospels { border-left-color: var(--cat-gospels); }
.bible-book-card.cat-history-nt { border-left-color: var(--cat-history-nt); }
.bible-book-card.cat-pauline { border-left-color: var(--cat-pauline); }
.bible-book-card.cat-general { border-left-color: var(--cat-general); }
.bible-book-card.cat-prophecy { border-left-color: var(--cat-prophecy); }

/* ============================================================
   COMPONENTS — Badges
   ============================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.25rem;
    background: color-mix(in srgb, var(--color-spruce) 15%, transparent);
    color: var(--color-spruce);
}

.badge-spruce {
    background: color-mix(in srgb, var(--color-spruce) 15%, transparent);
    color: var(--color-spruce);
}

.badge-gold {
    background: color-mix(in srgb, var(--color-truth-gold) 15%, transparent);
    color: var(--color-truth-gold);
}

.badge-red {
    background: color-mix(in srgb, var(--color-firey-red) 15%, transparent);
    color: var(--color-firey-red);
}

.badge-active {
    background: var(--color-truth-gold);
    color: #fff;
}

/* ----- Accessible link styling (color + underline) ----- */
a.text-gold:not(.btn):not(.card) {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ============================================================
   COMPONENTS — Progress Bar
   ============================================================ */

.progress-bar {
    width: 100%;
    height: 0.5rem;
    background: color-mix(in srgb, var(--color-spruce) 15%, transparent);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--color-truth-gold);
    border-radius: 9999px;
    transition: width 0.3s ease;
}

/* ============================================================
   COMPONENTS — Tabs
   ============================================================ */

.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1.5px solid color-mix(in srgb, var(--color-spruce) 15%, transparent);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-spruce);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

.tab:hover {
    color: var(--color-evergreen);
}

.tab.active {
    color: var(--color-truth-gold);
    border-bottom-color: var(--color-truth-gold);
    font-weight: 600;
}

/* ============================================================
   COMPONENTS — Tables
   ============================================================ */

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-spruce);
    border-bottom: 1.5px solid color-mix(in srgb, var(--color-spruce) 20%, transparent);
}

.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid color-mix(in srgb, var(--color-spruce) 10%, transparent);
}

.table tr:hover td {
    background: color-mix(in srgb, var(--color-spruce) 5%, transparent);
}

/* ============================================================
   COMPONENTS — Pagination
   ============================================================ */

.pagination {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    justify-content: center;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-spruce);
    transition: background-color 0.15s ease;
}

.pagination a:hover {
    background: color-mix(in srgb, var(--color-spruce) 10%, transparent);
}

.pagination .active {
    background: var(--color-truth-gold);
    color: #fff;
    font-weight: 600;
}

/* ============================================================
   COMPONENTS — Alerts
   ============================================================ */

.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    border: 1px solid transparent;
}

.alert-error {
    background: color-mix(in srgb, var(--color-firey-red) 10%, var(--color-paper));
    border-color: color-mix(in srgb, var(--color-firey-red) 30%, transparent);
    color: var(--color-firey-red);
}

.alert-success {
    background: color-mix(in srgb, var(--color-spruce) 10%, var(--color-paper));
    border-color: color-mix(in srgb, var(--color-spruce) 30%, transparent);
    color: var(--color-spruce);
}

/* ============================================================
   COMPONENTS — Empty State
   ============================================================ */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--color-spruce);
}

.empty-state svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    max-width: 20rem;
}

/* ============================================================
   LAYOUT — App Shell
   ============================================================ */

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ----- Sidebar ----- */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--color-evergreen);
    color: var(--color-paper);
    display: flex;
    flex-direction: column;
    z-index: 50;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid color-mix(in srgb, var(--color-paper) 10%, transparent);
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0.5rem;
    overflow-y: auto;
}

.sidebar-footer {
    padding: 0.5rem;
    border-top: 1px solid color-mix(in srgb, var(--color-paper) 10%, transparent);
}

/* ----- Nav Items ----- */
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--color-paper);
    opacity: 0.7;
    transition: opacity 0.15s ease, background-color 0.15s ease;
    text-decoration: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.nav-item:hover {
    opacity: 1;
    background: color-mix(in srgb, var(--color-paper) 8%, transparent);
}

.nav-item.nav-active {
    opacity: 1;
    background: color-mix(in srgb, var(--color-paper) 12%, transparent);
    font-weight: 600;
}

.nav-divider {
    height: 1px;
    background: color-mix(in srgb, var(--color-paper) 10%, transparent);
    margin: 0.5rem 0.75rem;
}

.nav-label {
    display: block;
    padding: 0.25rem 0.75rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-paper);
    opacity: 0.5;
}

/* ----- Main Content ----- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 1.5rem 2rem;
}

/* ----- Bottom Nav (mobile) ----- */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--color-card);
    border-top: 1px solid color-mix(in srgb, var(--color-spruce) 15%, transparent);
    z-index: 40;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--color-spruce);
    opacity: 0.75;
    transition: opacity 0.15s ease, color 0.15s ease;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.375rem 0.75rem;
}

.bottom-nav-item:hover,
.bottom-nav-item.nav-active {
    opacity: 1;
    color: var(--color-truth-gold);
}

/* ----- Sidebar Overlay (mobile) ----- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 45;
}

.sidebar-overlay.open {
    display: block;
}

/* ============================================================
   BIBLE-SPECIFIC — Highlight Colors
   ============================================================ */

.highlight-yellow { background: rgba(255, 235, 59, 0.25); }
.highlight-green  { background: rgba(76, 175, 80, 0.2); }
.highlight-blue   { background: rgba(66, 165, 245, 0.2); }
.highlight-pink   { background: rgba(236, 64, 122, 0.2); }
.highlight-orange { background: rgba(255, 152, 0, 0.2); }

.dark .highlight-yellow { background: rgba(255, 235, 59, 0.15); }
.dark .highlight-green  { background: rgba(76, 175, 80, 0.12); }
.dark .highlight-blue   { background: rgba(66, 165, 245, 0.12); }
.dark .highlight-pink   { background: rgba(236, 64, 122, 0.12); }
.dark .highlight-orange { background: rgba(255, 152, 0, 0.12); }

/* ----- Popover ----- */
.popover {
    position: absolute;
    background: var(--color-card);
    border: 1px solid color-mix(in srgb, var(--color-spruce) 15%, transparent);
    border-radius: 0.5rem;
    padding: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 30;
    display: none;
}

.popover.open {
    display: block;
}

/* ----- Color Dot (highlight picker) ----- */
.color-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.1s ease;
}

.color-dot:hover {
    transform: scale(1.15);
}

.color-dot.active {
    border-color: var(--color-evergreen);
}

/* ============================================================
   PROSE — Markdown Rendered Content
   ============================================================ */

.prose {
    max-width: 65ch;
    line-height: 1.75;
}

.prose h1 {
    font-family: var(--font-heading);
    font-size: 1.875rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    margin-top: 1.5rem;
}

.prose h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    line-height: 1.3;
    margin-bottom: 0.75rem;
    margin-top: 1.25rem;
}

.prose h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

.prose p {
    margin-bottom: 1rem;
}

.prose ul,
.prose ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.prose li {
    margin-bottom: 0.25rem;
}

.prose li::marker {
    color: var(--color-spruce);
}

.prose blockquote {
    border-left: 3px solid var(--color-truth-gold);
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
    color: var(--color-spruce);
}

.prose strong {
    font-weight: 600;
}

.prose em {
    font-style: italic;
}

.prose a {
    color: var(--color-truth-gold);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.prose a:hover {
    opacity: 0.8;
}

/* ============================================================
   RESPONSIVE — Tablet (max-width: 768px)
   ============================================================ */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .bottom-nav {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        padding: 1.25rem 1rem;
        padding-bottom: calc(var(--bottom-nav-height) + 1rem);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .hide-mobile {
        display: none;
    }
}

/* ============================================================
   RESPONSIVE — Phone (max-width: 480px)
   ============================================================ */

@media (max-width: 480px) {
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 1rem;
        padding-bottom: calc(var(--bottom-nav-height) + 1rem);
    }
}

/* ============================================================
   BADGE CARDS
   ============================================================ */

.badge-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.75rem 0.5rem;
    border-radius: 10px;
    width: 100px;
    min-height: 100px;
    border: 1px solid var(--color-border, #e0ddd5);
    background: var(--color-paper, #fff);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.badge-card--earned {
    border-color: var(--color-truth-gold);
    box-shadow: 0 1px 4px rgba(183, 124, 63, 0.15);
}

.badge-card--earned:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(183, 124, 63, 0.2);
}

.badge-card--locked {
    opacity: 0.5;
    filter: grayscale(0.8);
}

.badge-card__icon {
    font-size: 1.75rem;
    line-height: 1;
    margin-bottom: 0.35rem;
}

.badge-card__name {
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--color-evergreen, #121c0d);
}

.badge-card__date,
.badge-card__progress {
    font-size: 0.6875rem;
    margin-top: 0.2rem;
    line-height: 1.2;
}

/* Badge celebration toast */
.badge-toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    background: var(--color-paper, #fff);
    border: 2px solid var(--color-truth-gold);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    max-width: 320px;
    animation: badgeSlideIn 0.4s ease-out;
}

.badge-toast__title {
    font-weight: 700;
    color: var(--color-truth-gold);
    margin-bottom: 0.25rem;
}

.badge-toast__list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
}

.badge-toast__list li {
    font-size: 0.9rem;
    padding: 0.15rem 0;
}

@keyframes badgeSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
