:root {
    --primary: #333;
    --accent: #2e7d32;
    /* Green */
    --bg: #f9f9f9;
    --card-bg: #fff;
    --border: #ddd;
    --error: #d32f2f;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background: var(--bg);
    color: var(--primary);
}

/* VIEWS */
.view {
    display: none;
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.view.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

p {
    color: #666;
    margin-bottom: 2rem;
}

/* FORMS */
input {
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
    margin-bottom: 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

button {
    width: 100%;
    padding: 15px;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    background: transparent;
    color: #666;
    border: 1px solid #ccc;
}

/* SEARCH RESULTS */
#results-list {
    list-style: none;
    padding: 0;
}

#results-list li {
    background: white;
    padding: 15px;
    border: 1px solid var(--border);
    margin-bottom: 10px;
    border-radius: 8px;
    cursor: pointer;
}

#results-list li:hover {
    border-color: var(--primary);
}

/* MEMBER CARDS */
.member-card {
    background: var(--card-bg);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.member-name {
    font-weight: bold;
    font-size: 1.1rem;
}

.checkbox-wrapper input {
    width: 25px;
    height: 25px;
    margin: 0;
    cursor: pointer;
}

select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: white;
    font-size: 1rem;
}

select:disabled {
    background: #f0f0f0;
    color: #999;
}

/* STICKY BAR */
#sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border);
    padding: 15px 20px;
    padding-bottom: max(15px, env(safe-area-inset-bottom));
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

#sticky-bar.hidden {
    display: none;
}

.bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 900px;
    margin: 0 auto;
}

.stats {
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
}

.stat-icons {
    display: flex;
    gap: 5px;
    margin-top: 4px;
}

.pill {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    color: white;
}

.pill.vegan {
    background: #4caf50;
}

.pill.seafood {
    background: #2196f3;
}

.pill.hidden {
    display: none;
}

.actions {
    display: flex;
    gap: 10px;
}

.hidden-mobile {
    display: none;
}

/* TOAST */
.toast {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
}

.error-msg {
    color: var(--error);
    margin-top: 10px;
    font-weight: bold;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 50px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* DESKTOP TWEAKS */
@media (min-width: 900px) {
    .hidden-mobile {
        display: block;
    }

    .stats {
        flex-direction: row;
        align-items: center;
        gap: 15px;
        font-size: 1.1rem;
    }

    .member-card {
        flex-direction: row;
        align-items: center;
    }

    .card-header {
        flex: 1;
    }

    select {
        width: 200px;
    }
}