/* General Styles */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f7f9fc;
    color: #333;
}

header {
    background-color: #4caf50;
    color: white;
    padding: 1em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0;
}

/* Auth Buttons */
.auth-button {
    padding: 0.5em 1em;
    border: none;
    border-radius: 5px;
    background-color: #4caf50;
    color: white;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.auth-button:hover {
    background-color: #45a049;
}

.auth-button.hidden {
    display: none;
}

#nav-links {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 10px; /* Add spacing between buttons */
}

#nav-links li {
    display: inline; /* Ensure the list items are inline */
}

.bingo-card-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.bingo-card-table td {
    border: 1px solid #ddd;
    padding: 15px;
    text-align: center;
    width: 20%;
    height: 50px;
}

.bingo-cell {
    font-weight: bold;
    background-color: #f9f9f9;
}

.free-space {
    background-color: #4caf50;
    color: white;
    font-style: italic;
}

#card-private-message {
    color: red;
    font-weight: bold;
    text-align: center;
    margin-top: 20px;
}

.bingo-cell {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

.bingo-cell.completed {
    background-color: #4caf50;
    color: white;
    font-weight: bold;
}

.bingo-cell.non-clickable {
    cursor: default; /* Default cursor for non-clickable tiles */
}

#header-buttons {
    display: flex;
    gap: 10px;
}

.dashboard-button, .logout-button {
    padding: 0.5em 1em;
    border: none;
    border-radius: 5px;
    background-color: #4caf50;
    color: white;
    font-size: 1em;
    cursor: pointer;
    margin-left: auto;
}

.dashboard-button:hover, .logout-button:hover {
    background-color: #45a049;
}


.dashboard-button.hidden, .logout-button.hidden {
    display: none;
}

/* Modal Styles */
.error-message {
    color: red;
    font-size: 0.9em;
    margin-top: 5px;
}

.hidden {
    display: none;
}

.modal {
    display: none; /* Ensure it is hidden initially */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.create-card-modal {
    display: none; /* Ensure it is hidden initially */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.create-card-modal.show {
    display: flex;
}

.edit-card-modal {
    display: none; /* Ensure it is hidden initially */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.edit-card-modal.show {
    display: flex; /* Shows the modal when 'show' class is added */
}

.edit-button {
    padding: 0.5em 1em;
    border: none;
    border-radius: 5px;
    font-size: 0.9em;
    cursor: pointer;
    background-color: #4caf50;
    color: white;
}

.edit-button:hover {
    background-color: #45a049;
}

.modal-content {
    background: #ffffff;
    padding: 2em;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    animation: slide-in 0.3s ease-out;
}

@keyframes slide-in {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #333;
}

.close-modal:hover {
    color: #f44336;
}

/* Welcome Section */
#welcome {
    text-align: center;
    padding: 3em 1em;
}

#welcome h2 {
    margin-bottom: 0.5em;
    font-size: 2em;
    color: #333;
}

#welcome p {
    font-size: 1.2em;
    color: #555;
}

/* Styled Table for Dashboard */
.styled-table {
    width: 100%;
    max-width: 800px;
    margin: 2em auto;
    border-collapse: collapse;
    font-size: 1em;
    text-align: left;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.styled-table thead tr {
    background-color: #4caf50;
    color: white;
    text-align: center;
}

.styled-table th,
.styled-table td {
    padding: 1em;
    border: 1px solid #ddd;
}

.styled-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.styled-table tbody tr:hover {
    background-color: #f1f1f1;
}

/* View and Delete Buttons */
.view-button,
.delete-button {
    padding: 0.5em 1em;
    border: none;
    border-radius: 5px;
    font-size: 0.9em;
    cursor: pointer;
}

.view-button {
    background-color: #4caf50;
    color: white;
}

.view-button:hover {
    background-color: #45a049;
}

.delete-button {
    background-color: #f44336;
    color: white;
}

.delete-button:hover {
    background-color: #d32f2f;
}

/* Create Card Button */
.create-card-button {
    display: block;
    margin: 2em auto;
    padding: 0.7em 1.5em;
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.create-card-button:hover {
    background-color: #45a049;
}

/* Scrollable List Area */
#card-items-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 0.5em;
    background-color: #fff;
    scroll-behavior: smooth;
}

#card-items-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5em;
    margin-bottom: 0.3em;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}

#card-items-list li a {
    color: #f44336;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    margin-left: 0.5em;
}

#card-items-list li a:hover {
    text-decoration: underline;
}

/* Goal Counter */
#goal-counter {
    font-size: 0.85em;
    color: #4caf50;
    margin-top: -10px;
    margin-bottom: 10px;
    font-weight: bold;
    text-align: right;
}

/* Form Styles */
form label {
    font-weight: bold;
    margin-bottom: 0.5em;
    font-size: 0.9em;
}

form input,
form textarea {
    padding: 0.7em;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 0.9em;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

form input:focus,
form textarea:focus {
    outline: none;
    border-color: #4caf50;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.5);
}

form button {
    padding: 0.7em 1em;
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

form button:hover {
    background-color: #45a049;
}

/* Footer */
footer {
    background-color: #4caf50;
    color: white;
    text-align: center;
    padding: 1em;
    width: 100%;
    font-size: 1em;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
}

/* Spin animation for both loading and toggling tiles */
@keyframes spin {
    0% {
        transform: rotateY(90deg);
        opacity: 0.5;
    }
    50% {
        transform: rotateY(180deg);
        opacity: 1;
    }
    100% {
        transform: rotateY(360deg);
    }
}

.bingo-cell.spin {
    animation: spin 0.6s ease-in-out;
}

.bingo-cell.completed {
    background-color: #4caf50;
    color: white;
    font-weight: bold;
}

/* Non-clickable tile style */
.bingo-cell.non-clickable {
    cursor: default;
}
