@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;700&display=swap');

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --danger: #ef4444;
    --success: #22c55e;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
aside {
    width: 300px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lists-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.lists-header h2 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.add-list-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.add-list-btn:hover {
    background: #e0e7ff;
}

#lists-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.list-item {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.list-item:hover {
    background: #f1f5f9;
}

.list-item.active {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow);
}

.delete-list-btn {
    opacity: 0;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
}

.list-item:hover .delete-list-btn {
    opacity: 1;
}

/* Main Content */
main {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    max-width: 800px;
    margin: 0 auto;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    margin-top: 5rem;
}

#active-list-view {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
}

.list-title {
    font-size: 2rem;
    font-weight: 700;
}

.input-group {
    display: flex;
    gap: 1rem;
    position: relative;
}

#item-input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    transition: border-color 0.2s;
}

#item-input:focus {
    border-color: var(--primary);
    ring: 2px var(--primary);
}

#add-item-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

#add-item-btn:hover {
    background: var(--primary-hover);
}

/* Autocomplete */
#suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-top: 0.5rem;
    box-shadow: var(--shadow);
    z-index: 10;
    display: none;
}

.suggestion-item {
    padding: 0.75rem 1.25rem;
    cursor: pointer;
}

.suggestion-item:hover {
    background: #f8fafc;
}

/* Items List */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.shopping-item {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s;
}

.shopping-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.shopping-item.checked {
    opacity: 0.6;
    background: #f8fafc;
}

.checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    display: grid;
    place-items: center;
    color: transparent;
    transition: all 0.2s;
}

.shopping-item.checked .checkbox {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.item-name {
    flex: 1;
    font-size: 1.1rem;
}

.shopping-item.checked .item-name {
    text-decoration: line-through;
    color: var(--text-muted);
}

.delete-item-btn {
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
}

.delete-item-btn:hover {
    background: #fee2e2;
    color: var(--danger);
}

h3.section-title {
    font-size: 0.875rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}
