/* style.css */
body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    width: 90%;
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

input[type="email"], input[type="text"], button {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

button {
    background-color: #28a745;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #218838;
}

#settingsButton {
    background-color: #28a745;
    margin-bottom: 20px;
}

#settingsButton:hover {
    background-color: #218838;
}

#logoutButton {
    background-color: #28a745;
    margin-top: 20px;
}

#logoutButton:hover {
    background-color: #218838;
}

#bestCards {
    width: 100%;
}

.desktop-only {
    display: none;
}

.mobile-only {
    display: none;
}

.header {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr; /* Adjust column widths as needed */
    font-weight: bold;
    color: #333;
    border-bottom: 2px solid #333;
    margin-bottom: 10px;
    padding: 10px 0;
}

.header span {
    font-size: 1.2em;
    padding: 0 10px; /* Add padding for spacing */
    text-align: center; /* Center-align text in each header cell */
}

.header span:first-child {
    text-align: left; /* Left-align the first column */
}

.header span:last-child {
    text-align: right; /* Right-align the last column */
}

.desktop-cards {
    display: flex;
    flex-direction: column;
}

.card-item {
    display: flex; /* Use flexbox for card layout */
    justify-content: space-between; /* Space out the items */
    align-items: center; /* Center items vertically */
    margin: 10px 0; /* Add vertical margin between cards */
    padding: 15px; /* Add padding inside the card */
    border-radius: 8px; /* Round the corners */
    background-color: #ffffff; /* Background color for cards */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
    transition: transform 0.2s ease-in-out;
    cursor: pointer;
}

.card-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); /* Darker shadow on hover */
    transform: scale(1.02);
}

.card-item .category,
.card-item .card-name,
.card-item .cashback {
    padding: 0 10px; /* Add horizontal padding for spacing */
    text-align: left; /* Ensure text is left-aligned */
    flex: 1; /* Allow the text to take up space */
}

.card-item .cashback {
    text-align: right; /* Right-align the cashback */
}

.card-item .category {
    font-size: 1.4em;
    font-weight: bold;
    color: #000;
}

.card-item .card-name {
    font-size: 1.2em;
    color: #505050;
}

.card-item .cashback {
    font-size: 1.3em;
    font-weight: bold;
    color: #000000;
}

#noCardsMessage {
    text-align: center;
    color: #666;
    font-style: italic;
}

#backButton {
    background-color: #28a745;
    margin-bottom: 20px;
}

#backButton:hover {
    background-color: #218838;
}

#categoryCards .header {
    grid-template-columns: 2fr 1fr; /* Adjust for two columns */
}

.category_page {
    display: flex;
    align-items: center;
}

.category_page::before {
    content: attr(data-emoji);
    margin-right: 5px;
    font-size: 1.2em;
}

.center-align {
    text-align: center;
}

#categoryTitle {
    display: flex;
    justify-content: center;
    align-items: center;
}

#categoryTitle::before {
    content: attr(data-emoji);
    margin-right: 10px;
    font-size: 1.2em;
}

@media (min-width: 769px) {
    .desktop-only {
        display: block;
    }

    .desktop-cards {
        display: flex;
    }
}

@media (max-width: 768px) {
    .container {
        width: 95%;
        margin: 10px auto;
        padding: 15px;
    }

    .mobile-only {
        display: block;
    }

    .mobile-cards {
        display: flex;
        flex-direction: column;
    }

    .card-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        padding: 15px;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .category-and-name {
        display: flex;
        flex-direction: column;
    }

    .card-item .category {
        font-size: 1.4em;
        margin-bottom: 5px;
    }

    .card-item .card-name {
        font-size: 1.2em;
    }

    .card-item .cashback {
        font-size: 2em;
        margin-left: 15px;
    }

    #categoryCards .card-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    #categoryCards .card-item .card-name {
        font-size: 1.2em;
        flex: 2;
    }

    #categoryCards .card-item .cashback {
        font-size: 1.3em;
        flex: 1;
        text-align: right;
    }

    .header {
        display: none; /* Hide header on mobile */
    }

    input[type="email"], input[type="text"], button {
        padding: 8px;
        margin: 8px 0;
    }

    button {
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .container {
        width: 100%;
        margin: 0;
        border-radius: 0;
    }

    button {
        padding: 10px;
    }

    .card-item {
        padding: 10px;
    }

    .card-item .category {
        font-size: 1.3em;
    }

    .card-item .card-name {
        font-size: 1.1em;
    }

    .card-item .cashback {
        font-size: 1.8em;
    }

    input[type="email"], input[type="text"], button {
        padding: 6px;
        font-size: 0.9em;
    }
}