/* EZWishlist design system — token set carried over from v1, rebuilt for htmx server-rendered pages */

:root {
    --primary: #6366f1;
    --primary-hover: #5b5bd6;
    --secondary: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;

    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
    --container: 1100px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }
body {
    font-family: var(--font);
    color: var(--gray-800);
    background: var(--gray-50);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; }
a { color: var(--primary); }

.container { max-width: var(--container); margin: 0 auto; padding: 0 1rem; }

/* Header */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    position: sticky; top: 0; z-index: 50;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-weight: 800; font-size: 1.25rem; color: var(--gray-900); text-decoration: none; }
.logo span { color: var(--primary); }
.site-nav { display: flex; gap: 1rem; align-items: center; }
/* :not(.btn) so the nav's link colour can't outrank button styling — without it
   .site-nav a (0,1,1) beat .btn-primary (0,1,0) and the "Sign in" button rendered
   grey-on-indigo. Buttons keep whatever their .btn-* class sets. */
.site-nav a:not(.btn) { color: var(--gray-600); text-decoration: none; font-weight: 500; font-size: .95rem; }
.site-nav a:not(.btn):hover { color: var(--gray-900); }

/* Footer */
.site-footer {
    background: var(--gray-900); color: var(--gray-400);
    padding: 2rem 0; margin-top: 4rem; font-size: .875rem;
}
.site-footer a { color: var(--gray-300); text-decoration: none; margin-right: 1rem; }
.site-footer a:hover { color: #fff; }
.site-footer .disclosure { margin-top: .75rem; font-size: .8rem; color: var(--gray-500); }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .625rem 1.25rem; border-radius: var(--radius);
    font: 600 .95rem var(--font); cursor: pointer; text-decoration: none;
    border: 1px solid transparent; transition: all 150ms ease;
}
.btn:focus-visible { outline: 3px solid #c7d2fe; outline-offset: 1px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #fff; color: var(--gray-700); border-color: var(--gray-300); }
.btn-secondary:hover { background: var(--gray-100); }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: .375rem .75rem; font-size: .85rem; }
.btn-lg { padding: .875rem 1.75rem; font-size: 1.05rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* Cards */
.card {
    background: #fff; border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 1.5rem;
}
.card + .card { margin-top: 1rem; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; font-size: .875rem; margin-bottom: .375rem; color: var(--gray-700); }
.form-control {
    width: 100%; padding: .625rem .75rem; border: 1px solid var(--gray-300);
    border-radius: var(--radius); font: 400 .95rem var(--font); background: #fff;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.form-hint { font-size: .8rem; color: var(--gray-500); margin-top: .25rem; }
.form-check { display: flex; align-items: flex-start; gap: .5rem; margin-bottom: .75rem; }
.form-check input { margin-top: .3rem; }
.validation-error, .field-validation-error { color: var(--error); font-size: .85rem; }
.validation-summary-errors ul { list-style: none; color: var(--error); font-size: .9rem; }

/* Alerts */
.alert { padding: .875rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .925rem; }
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* Badges */
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.badge-available { background: #ecfdf5; color: #065f46; }
.badge-reserved { background: #fffbeb; color: #92400e; }
.badge-purchased { background: var(--gray-100); color: var(--gray-500); }

/* Hero */
.hero { background: linear-gradient(135deg, #eef2ff 0%, #fdf2f8 100%); padding: 4.5rem 0; text-align: center; }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; color: var(--gray-900); line-height: 1.15; }
.hero p.lede { font-size: 1.2rem; color: var(--gray-600); max-width: 620px; margin: 1rem auto 2rem; }

/* Item grid (public wishlist) */
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.25rem; }
.item-card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.item-card .item-img { height: 170px; background: var(--gray-100); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.item-card .item-img img { width: 100%; height: 100%; object-fit: cover; }
.item-card .item-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; gap: .5rem; }
.item-card .item-title { font-weight: 700; color: var(--gray-900); }
.item-card .item-price { color: var(--gray-600); font-weight: 600; }
.item-card .item-actions { margin-top: auto; display: flex; gap: .5rem; flex-wrap: wrap; }

/* Modal (htmx-driven) */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(17,24,39,.55);
    display: flex; align-items: center; justify-content: center; z-index: 100; padding: 1rem;
}
.modal { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 440px; padding: 1.5rem; max-height: 90vh; overflow-y: auto; }
.modal h3 { margin-bottom: 1rem; }
.modal .modal-close { float: right; background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--gray-400); }

/* Dashboard */
.dash-layout { display: grid; grid-template-columns: 220px 1fr; gap: 1.5rem; padding: 1.5rem 0; }
.dash-nav { display: flex; flex-direction: column; gap: .25rem; }
.dash-nav a { padding: .5rem .75rem; border-radius: var(--radius); color: var(--gray-600); text-decoration: none; font-weight: 500; }
.dash-nav a.active, .dash-nav a:hover { background: #eef2ff; color: var(--primary); }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--gray-200); }
table.data th { color: var(--gray-500); font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--gray-500); }
.empty-state .big { font-size: 2.5rem; }

/* Utility */
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.text-center { text-align: center; }
.text-muted { color: var(--gray-500); }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.honeypot { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

/* Feature cards (landing) — fixed columns + uniform row height so every card matches */
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; grid-auto-rows: 1fr; }
/* neutralize the global ".card + .card" top margin, which otherwise shrinks cards 2-4 */
.feature-grid > .card { margin-top: 0; }
@media (max-width: 900px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .feature-grid { grid-template-columns: 1fr; } }

/* Draft builder (/start) — sticky reminder that the list isn't saved yet */
.draft-banner {
    position: sticky; top: 64px; z-index: 40;
    background: #eef2ff; border-bottom: 1px solid #c7d2fe;
    padding: .625rem 0; font-size: .925rem; color: #3730a3;
}
.draft-banner .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
body.popup .draft-banner { top: 0; } /* chrome-less popup mode: no 64px header to sit under */

/* Blog */
.blog-body h2 { font-size: 1.25rem; margin: 1.5rem 0 .5rem; }
.blog-body h3 { font-size: 1.05rem; margin: 1.25rem 0 .4rem; }
.blog-body p { margin-bottom: .875rem; }
.blog-body ul, .blog-body ol { margin: 0 0 .875rem 1.4rem; }
.blog-body li { margin-bottom: .3rem; }
.blog-body blockquote { border-left: 3px solid var(--primary); padding-left: 1rem; color: var(--gray-600); margin-bottom: .875rem; }

.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline; }

@media (max-width: 720px) {
    .dash-layout { grid-template-columns: 1fr; }
    .dash-nav { flex-direction: row; overflow-x: auto; }
    .grid-2 { grid-template-columns: 1fr; }
}
