body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(to right, #6a11cb, #2575fc);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    height: 100vh;
    margin: 10px 0;
    color: #333;
}

.login_div {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 300px;
}

.login_form {
    display: flex;
    flex-direction: column;
}

.form_item {
    margin: 10px 0;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}

.form_item[type="submit"] {
    background: #6a11cb;
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.form_item[type="submit"]:hover {
    background: #2575fc;
}

.logo {
    margin-bottom: 20px;
    color: #6a11cb;
}

.message {
    margin-bottom: 20px;
    color: red;
    font-weight: bold;
}

.password_container {
    position: relative;
}

.password_container .form_item {
    width: calc(100% - 30px);
    display: inline-block;
}

.password_container i {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
}

.main_container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 80%;
    max-width: 1200px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.profile {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.profile_logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 10px;
}

.username {
    font-size: 18px;
    font-weight: bold;
    color: #6a11cb;
}

.link {
    text-decoration: none;
    color: inherit;
    transition: font-size 0.3s;
    color: #6a11cb;
}

.link:hover {
    transition: font-size 0.3s;
    font-size: 20px;
}

.logout_button {
    background: #6a11cb;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.logout_button:hover {
    background: #2575fc;
}

main {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.add_button, .toggle_button {
    background: #6a11cb;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 16px;
}

.add_button:hover, .toggle_button:hover {
    background: #2575fc;
}

#shoppingList {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.list_view .shopping_item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #f9f9f9;
    max-height: 26px;
}

.grid_view {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}


main.column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex-wrap: nowrap;
}
.grid_view .shopping_item{
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #f9f9f9;
}

.grid_view > .shopping_item {
    height: 50px;
}

.shopping_item button {
    background: #6a11cb;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 14px;
    margin-left: 5px;
}

.shopping_item button:hover {
    background: #2575fc;
}

.shopping_item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #f9f9f9;
}

.shopping_item img.item_image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 5px;
    margin-right: 10px;
}

.grid_view .shopping_item {
    flex-direction: column;
    align-items: center;
}

.grid_view .shopping_item img.item_image {
    width: 100%;
    height: auto;
    margin-right: 0;
    margin-bottom: 10px;
}

.shopping_item.completed {
    text-decoration: line-through;
    background: #b3b3b3;
}

/* Responsive styles */
@media (max-width: 512px) {
    /*.shopping_item {
        flex-direction: column;
        align-items: flex-start;
    }

    .shopping_item img.item_image {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .grid_view .shopping_item {
        align-items: flex-start;
    }

    .grid_view .shopping_item img.item_image {
        width: 100%;
    }*/

    .grid_view {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

.edit_form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.edit_form .form_item {
    margin: 5px 0;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
}

.edit_form .form_item[type="submit"],
.edit_form .form_item[type="button"] {
    background: #6a11cb;
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.edit_form .form_item[type="submit"]:hover,
.edit_form .form_item[type="button"]:hover {
    background: #2575fc;
}

.settings_section, .danger_section {
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.settings_section {
    background: #f9f9f9;
}

.danger_section {
    background: #ffe6e6;
}

.setting_item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
}

.setting_item:last-child {
    border-bottom: none;
}

.open_modal_button {
    background: #6a11cb;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 14px;
}

.open_modal_button:hover {
    background: #2575fc;
}

.tile {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    flex: 1 1 calc(33.333% - 20px);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    color: inherit;
}

.tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.tile h2 {
    margin-top: 0;
    color: #6a11cb;
}

.tile p {
    color: #666;
}

.account_form {
    display: flex;
    flex-direction: column;
}

.form_item {
    margin: 10px 0;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}

.form_item[type="submit"] {
    background: #6a11cb;
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.form_item[type="submit"]:hover {
    background: #2575fc;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal_content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-50px);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
}

.modal_content.show {
    transform: translateY(0);
    opacity: 1;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown_button {
    background: #6a11cb;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 16px;
}

.dropdown_button:hover {
    background: #2575fc;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.dropdown_content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 1;
    border-radius: 5px;
    overflow: hidden;
    transform: translate(-50%, 0);
}

.dropdown_content .dropdown_item {
    color: black;
    padding: 10px 14px;
    text-decoration: none;
    display: block;
    cursor: pointer;
    margin: 3px !important;
    font-size: 13px;
    border: none;
    border-radius: 5px;
    background-color: #e0e0e0;
}

.dropdown_content .dropdown_item:hover {
    background-color: #f1f1f1;
    color: #6a11cb;
}

.dropdown_content.show {
    display: flex;
    flex-direction: column;
}

.error_message {
    color: red;
    font-weight: bold;
    margin-top: 10px;
}