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

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


body {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #2d3748;
    background-color: #f7fafc;
}

.app-container {
    max-width: 600px;
    margin: 40px auto;
    padding: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}



.app-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.app-header__title {
    font-weight: 600;
    color: #1a202c;
    font-size: 1.875rem;
}

.app-header__icon {
    width: 60px;
    height: 60px;
}

.shopping-form {
    margin-bottom: 24px;
    padding: 0 16px;
    /* Added padding for alignment */
}

.input-group {
    margin-bottom: 16px;
}

.white-icon {
    color: white;
}

.shopping-input {
    width: 100%;
    font-size: 1rem;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: .8rem;
    transition: border-color 0.2s ease;
}

#sort-select {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: .8rem;
    transition: border-color 0.2s ease;
}

.btn-danger {
    background-color: red;
    color: white;
}

.shopping-input:focus {
    outline: none;
    border-color: #4299e1;
}

.shopping-input--filter {
    background-color: #f8fafc;
    margin-top: 24px;
}

.btn-primary {
    background-color: #4299e1;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-primary:hover {
    background-color: #3182ce;
}

.shopping-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 24px;
    padding: 0 16px;
    /* Added padding for alignment */
}


.btn-green {
    background-color: green;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
}


.shopping-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background-color: #eaeff3;
    border-radius: 8px;
    font-weight: 500;
    transition: transform 0.2s ease;
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    -ms-border-radius: 8px;
    -o-border-radius: 8px;
}

.shopping-item:hover {
    transform: translateY(-2px);
}

.btn-remove {
    background: none;
    border: none;
    color: #e53e3e;
    cursor: pointer;
    font-size: 1.25rem;
    transition: color 0.2s ease;
}

.btn-remove:hover {
    color: #e70000;
    transform: scale(1.1);
}

.btn-remove:hover::before {
    content: '🗑️';
}

.btn-clear {
    width: calc(100% - 32px);
    /* Adjusted width for padding */
    margin: 24px 16px;
    /* Changed margins */
    padding: 12px;
    background-color: transparent;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    color: #4a5568;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-clear:hover {
    background-color: #e2e8f0;
    color: #2d3748;
}

.filter-container {
    padding: 0 16px;
    /* Added padding for alignment */
}

@media (max-width: 640px) {
    .app-container {
        margin: 20px;
        padding: 20px;
    }

    .shopping-list {
        grid-template-columns: 1fr;
    }
}

.editing {
    background-color: #f0f8ff;
    font-style: italic;
    border: 1px dashed red;
    padding: 5px;
}

/* Alert styles */
.alert {
    /* margin: 16px; */
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    width: calc(100% - 32px);
    /* Adjusted for padding */
}

.alert-danger {
    background-color: #fff5f5;
    color: #e53e3e;
    border: 1px solid #feb2b2;
}

.alert-info {
    background-color: #ebf8ff;
    color: #3182ce;
    border: 1px solid #bee3f8;
}

/* Dark mode styles */
[data-bs-theme="dark"] {
    background-color: #121212 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .container {
    background-color: #121212 !important;
}

[data-bs-theme="dark"] .app-container {
    background-color: #1e1e1e !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .shopping-input {
    background-color: #2d2d2d !important;
    border-color: #404040 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .shopping-item {
    background-color: #2d2d2d !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-clear {
    border-color: #404040 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-clear:hover {
    background-color: #404040 !important;
}

[data-bs-theme="dark"] .btn-remove {
    color: #ff6b6b !important;
}

[data-bs-theme="dark"] .alert-info {
    background-color: #1a365d !important;
    border-color: #2a4365 !important;
    color: #90cdf4 !important;
}

[data-bs-theme="dark"] .alert-danger {
    background-color: #4a1c1c !important;
    border-color: #63171b !important;
    color: #fc8181 !important;
}

[data-bs-theme="dark"] .app-header__title {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .shopping-input--filter {
    background-color: #2d2d2d !important;
}

[data-bs-theme="dark"] .editing {
    background-color: #2d2d2d !important;
    border-color: #fd6906 !important;
}

/* [data-bs-theme="dark"] .btn-primary {
    background-color: #4299e1 !important;
}

[data-bs-theme="dark"] .btn-primary:hover {
    background-color: #2c5282 !important;
} */