@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg: #f3f6ff;
    --card: #ffffff;
    --accent: #0033ff;
    --accent-soft: #e3e7ff;
    --danger: #ec5f5f;
    --text: #1f2a44;
    --muted: #5f6b7a;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: linear-gradient(180deg, #eef2ff 0%, #f8fbff 45%, #ffffff 100%);
    min-height: 100vh;
    color: var(--text);
}

.app-shell {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.card {
    background: var(--card);
    border-radius: 20px;
    box-shadow: 0 15px 30px rgba(31, 42, 68, 0.08);
    padding: 1.75rem;
}

.hero {
    padding: 2rem;
    text-align: center;
}

.hero h1 {
    margin-bottom: 0.5rem;
    font-size: clamp(2rem, 3vw, 2.75rem);
}

.hero p {
    margin: 0;
    color: var(--muted);
    font-size: 1.05rem;
}

.board {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.input-row input {
    flex: 1;
    min-width: 220px;
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.meta-row input {
    flex: 1;
    min-width: 150px;
}

.action-btn {
    min-width: 140px;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-btn {
    border-radius: 12px;
    border: 1px solid transparent;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

.filter-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.stat-card {
    padding: 1rem;
    border-radius: 14px;
    background: var(--accent-soft);
    color: var(--accent);
    text-align: center;
}

.stat-card strong {
    display: block;
    font-size: 2rem;
}

.list-section {
    background: var(--card);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

#shopping-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.shopping-item {
    border: 1px solid #edf0ff;
    border-radius: 14px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    transition: transform 200ms ease, box-shadow 200ms ease;
    background: #fff;
}

.shopping-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(17, 24, 39, 0.08);
}

.shopping-item--mine {
    border-color: var(--accent);
}

.item-content {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.item-content span {
    font-size: 1rem;
    font-weight: 600;
}

.item-content .item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
}

.item-content .item-description {
    color: var(--muted);
    font-size: 0.9rem;
}

.item-content .item-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.item-quantity {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
}

.owner-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    border: 1px solid var(--accent-soft);
    color: var(--accent);
    background: var(--accent-soft);
    width: fit-content;
}

.owner-badge--me {
    border-color: var(--accent);
    background: rgba(76, 110, 245, 0.12);
}

.delete-btn {
    padding: 0.35rem 1rem;
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(31, 42, 68, 0.55);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
    padding: 1rem;
}

.overlay-hidden {
    display: none;
}

.welcome-card {
    width: min(420px, 95%);
    padding: 2rem;
    background: white;
    border-radius: 18px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.welcome-card h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.welcome-card p {
    margin: 0 0 1.25rem;
    color: var(--muted);
}

.welcome-card .input-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.welcome-card .input-group input {
    flex: 1;
    min-width: 180px;
}

.welcome-card .input-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(19, 42, 106, 0.25);
}

.welcome-card .input-group .btn {
    flex-shrink: 0;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    border: 1px solid #d2d8ff;
    background: #f2f4ff;
    color: #3b4490;
    font-weight: 600;
}

.change-user-btn {
    border: none;
    background: transparent;
    color: var(--accent);
    padding: 0;
    font-weight: 600;
}

@media (max-width: 700px) {
    .card,
    .list-section {
        padding: 1.25rem;
    }

    .input-row {
        flex-direction: column;
    }
}
