/* Base Styles */
:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-color: #1f2937;
    --border-color: #e5e7eb;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    padding: 20px;
}

.app-container {
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

header {
    background-color: var(--primary-color);
    color: white;
    padding: 1.5rem;
    text-align: center;
}

header h1 {
    font-weight: 600;
    font-size: 1.5rem;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background-color: #f9fafb;
    overflow-x: auto;
}

.tab-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--primary-color);
    background-color: #f3f4f6;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: white;
}

/* Main Content */
main {
    padding: 1.5rem;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
}

#new-item-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

#new-item-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

#add-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#add-btn:hover {
    background-color: var(--primary-hover);
}

/* Shopping List */
.shopping-list {
    list-style: none;
}

.item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
    cursor: grab;
    /* Enable grab cursor for dragging */
}

.item:hover {
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.item.dragging {
    opacity: 0.5;
    border: 2px dashed var(--primary-color);
    background-color: #eef2ff;
    cursor: grabbing;
}

.item span {
    flex: 1;
    font-size: 1.05rem;
}

.delete-btn {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    margin-left: 10px;
}

.delete-btn:hover {
    color: #ef4444;
    background-color: #fee2e2;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 2rem 0;
    color: #9ca3af;
}

.hidden {
    display: none;
}

@media (max-width: 480px) {
    body {
        padding: 0;
    }

    .app-container {
        border-radius: 0;
        min-height: 100vh;
        box-shadow: none;
    }
}