body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0; /* Reset padding */
    /*padding-top: 55px; /* Add padding to prevent content from being hidden by the sticky menu */
    text-align: center;
}
img {

    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    cursor: pointer; /* Indicate the image is clickable */
    /* border-radius: 15px; Add rounded corners */
    /* border: 2px solid #ccc; Optional: Add a border for better visibility */
}
h1 {
    font-size: 2em;
    margin: 20px 0;
}
p {
    margin: 10px;
}

a{
    font-size: 15px;
    text-decoration: none;
    color: #000000; /* Bootstrap primary color */
    font-weight: bold;
}

/* Global Alert/Message Styles */
.error, .success {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 15px;
    text-align: left;
}

.error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.error::before, .success::before {
    font-family: "Font Awesome 6 Free";
    margin-right: 10px;
}

/* ==========================================================================
   Global Button Styles
   ========================================================================== */
.btn {
    display: inline-block;
    padding: 10px 15px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s, border-color 0.2s;
    color: #fff;
}

.btn-block {
    width: 100%;
    box-sizing: border-box;
}

.btn-primary {
    background-color: #007BFF;
    border-color: #007BFF;
}
.btn-primary:hover { background-color: #0056b3; border-color: #0056b3; color: #fff; }

.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
}
.btn-secondary:hover { background-color: #5a6268; border-color: #5a6268; color: #fff; }

.btn-danger {
    background-color: #d9534f;
    border-color: #d9534f;
}
.btn-danger:hover { background-color: #c9302c; border-color: #c9302c; color: #fff; }

.btn-success {
    background-color: #48af5f;
    border-color: #48af5f;
}
.btn-success:hover { background-color: #1b8532; border-color: #1b8532; color: #fff; }

.btn:disabled, .btn.disabled {
    background-color: #5f5f5f;
    border-color: #5f5f5f;
    cursor: not-allowed;
    opacity: 0.65;
}

/* Modal (Lightbox) Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    overflow-y: auto; /* Allow scrolling on small screens */
    animation: fadeIn 0.3s ease-out;
    /* Add flex properties for centering */
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease-out;
}

.modal-close {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal-close:hover,
.modal-close:focus {
    color: #000;
    text-decoration: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Desktop-specific styles */
@media (min-width: 768px) {
    h1 {
        font-size: 2.5em;
    }
    p {
        font-size: 1.2em;
    }
    img {
        max-width: 50%;
    }
}

/* Mobile-specific styles */
@media (max-width: 767px) {
    h1 {
        font-size: 1.8em;
    }
    p {
        font-size: 1em;
    }
    img {
        max-width: 80%;
    }
}

/* Search Bar for Card Grid */
.search-bar-container {
    margin-bottom: 25px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.search-input {
    width: 100%;
    padding: 12px 20px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 25px; /* Pill shape */
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    border-color: #007BFF;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.card-grid-container {
    width: 95%;
    max-width: 1200px;
    margin: 20px auto;
}

.grid-header {
    text-align: center;
    font-size: 28px;
    color: #333;
    margin-bottom: 25px;
    font-weight: bold;
}

.card-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.card-item {
    background-color: #fff;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 15px;
    text-decoration: none;
    color: #333;
    transition: transform 0.2s, box-shadow 0.2s;
    flex: 1 0 calc(50% - 15px); /* Two columns on mobile, accounting for gap */
    max-width: calc(50% - 15px);
    box-sizing: border-box;
    aspect-ratio: 1 / 1; /* Make cards square */
    /* Prevent text selection on card tiles */
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* IE10+/Edge */
    user-select: none; /* Standard */
}

.card-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.card-logo-container {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 100px; /* Match the logo size */
    height: 100px; /* Match the logo size */
}

.card-logo {
    max-width: 100px; /* Define a fixed width */
    max-height: 100px; /* Define a fixed height */
    /*object-fit: contain; /* Ensure logo fits within the box without distortion */
    border-radius: 15px;
}

.card-name {
    font-weight: 1000;
    margin-top: 10px;
    transition: color 0.2s; /* Add transition for text color */
    white-space: normal; /* Allow text to wrap */
    overflow-wrap: break-word; /* Break long words if necessary */
    width: 100%;
    text-align: center;
    line-height: 1.2; /* Adjust line height for wrapped text */
    text-shadow: 0 1px 3px rgba(0,0,0,0.15); /* Add subtle shadow for readability */
    min-height: 2.4em; /* Reserve space for two lines to prevent layout shifts */
}

.no-cards-message {
    text-align: center;
    padding: 40px 20px;
    font-size: 18px;
    color: #666;
    background-color: #f9f9f9;
    border: 1px dashed #ccc;
    border-radius: 12px;
    width: 100%;
    box-sizing: border-box;
    margin-top: 15px;
}

.no-cards-message p { margin: 0; }

@media (max-width: 400px) {
    .card-name {
        font-size: 14px; /* Slightly smaller font on very small screens */
    }
}

@media (min-width: 576px) {
    .card-item {
        flex-basis: calc(33.333% - 15px); /* Three columns on small screens */
        max-width: calc(33.333% - 15px);
    }
}

@media (min-width: 992px) {
    .card-item {
        flex-basis: calc(20% - 15px); /* Five columns on large screens */
        max-width: calc(20% - 15px);
    }
}

.login-container .remember-me {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    text-align: left;
}

.login-container .remember-me input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
    margin-bottom: 0;
    transform: scale(1.2);
}

.login-container .remember-me label {
    margin-bottom: 0;
    font-weight: normal;
    color: #555;
}

/* LOGIN PAGE WRAPPER */
.login-page-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

.autocomplete-suggestions {
    position: absolute;
    border: 1px solid #ccc;
    border-top: none;
    background-color: #fff;
    z-index: 99;
    width: 100%;
    box-sizing: border-box;
    max-height: 150px;
    overflow-y: auto;
    border-radius: 0 0 4px 4px;
}

.autocomplete-suggestion {
    padding: 10px;
    cursor: pointer;
    text-align: left;
}

.autocomplete-suggestion:hover,
.autocomplete-suggestion.active {
    background-color: #f0f0f0;
}

.autocomplete-no-suggestion {
    padding: 10px;
    color: #6c757d;
    font-style: italic;
    text-align: left;
}

/* REMOVE CARD */
.message-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: #f9f9f9;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-family: 'Roboto', sans-serif;
    text-align: center;
}
.message-container a {
    color: #007BFF;
    text-decoration: none;
    font-size: 14px;
}
.message-container a:hover {
    text-decoration: underline;
}

/* Add Card Wizard Styles */
.wizard-step {
    display: none;
    animation: fadeIn 0.5s;
}
.wizard-step.active {
    display: block;
}

.brand-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 20px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 8px;
}

.brand-select-item {
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    background-color: #f9f9f9;
}

.brand-select-item:hover {
    background-color: #f0f0f0;
}

.brand-select-item.selected {
    border-color: #007BFF;
    background-color: #e7f3ff;
}

.brand-select-item .card-logo {
    margin: 0 auto; /* Center the logo */
}

.brand-select-item span {
    font-size: 13px;
    font-weight: 500;
    display: block;
    word-wrap: break-word;
}

.wizard-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.color-picker-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* EDIT PROFILE */
.edit-profile-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: #f9f9f9;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-family: 'Roboto', sans-serif;
}

.edit-profile-container h2, .edit-profile-container h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.edit-profile-container label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.edit-profile-container input {
    width: 80%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}
.edit-profile-container p {
    text-align: center;
    font-size: 14px;
}

.edit-profile-container input[readonly] {
    background-color: #e9ecef;
    cursor: not-allowed;
}

.edit-profile-container form {
    margin-bottom: 20px;
}

.share-family-checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    text-align: left;
}

.share-family-checkbox input[type="checkbox"] {
    width: auto;
    transform: scale(1.5); /* Make the checkbox 50% larger */
    margin-right: 10px;
    margin-bottom: 0;
    cursor: pointer;
}

.share-family-checkbox label {
    /* Override generic label styles for this specific case */
    display: inline-block;
    margin-bottom: 0;
    cursor: pointer;
}

/* Base style for all form containers */
.form-container {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* General Form Styles for containers with .form-container */
.form-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    text-align: left;
}

.form-container input[type="text"],
.form-container input[type="email"],
.form-container input[type="password"],
.form-container textarea,
.form-container select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Important for padding and width */
}

.form-container input[readonly] {
    background-color: #e9ecef; /* A light grey to indicate it's not editable */
    cursor: not-allowed;
    color: #6c757d;
}

/* EDIT CARD */
.edit-card-container .owner-badge {
    background-color: #e7f3ff;
    color: #0056b3;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 20px;
    border: 1px solid #b3d7ff;
}

.shared-users-list {
    list-style: none;
    padding: 0;
    margin-top: 20px;
}

.shared-user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f9f9f9;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid #eee;
}

.shared-user-item .user-name {
    font-weight: 500;
    color: #333;
}

.admin-brands-container {
    max-width: 1000px; /* Wider container for the brands table */
}

.table-wrapper {
    margin-top: 20px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
}

.admin-table th {
    background-color: #f8f9fa;
    color: #495057;
    text-align: left;
    padding: 12px 15px;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
}

.admin-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
    text-align: left;
    vertical-align: middle;
    /* Truncate long text like emails */
    max-width: 150px; /* Adjust as needed */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table .btn {
    padding: 5px 10px;
    font-size: 13px;
}

/* Responsive Card View for Admin Table */
@media (max-width: 768px) {
    .admin-table thead {
        display: none; /* Hide table headers on mobile */
    }
    .admin-table, .admin-table tbody, .admin-table tr, .admin-table td {
        display: block;
        width: 100%;
    }
    .admin-table tr {
        margin-bottom: 15px;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }
    .admin-table td {
        text-align: right; /* Align content to the right */
        padding-left: 50%; /* Make space for the label */
        position: relative;
        border-bottom: 1px solid #eee;
    }
    .admin-table td:last-child { border-bottom: none; }
    .admin-table td::before {
        content: attr(data-label); /* Use data-label for the pseudo-element content */
        position: absolute;
        left: 15px;
        width: calc(50% - 30px);
        text-align: left;
        font-weight: bold;
        color: #333;
    }
    .admin-table td form {
        display: contents; /* Allows form to exist inside a td for mobile view */
    }
}

/* Menu Bar */
.menu-bar {
    position: sticky;
    top: 0;
    width: 100%;
    background-color: #333;
    overflow: hidden;
    font-family: 'Roboto', sans-serif;
    z-index: 1001; /* Ensure it's above other content but below modals */
}

.menu-bar ul {
    margin: 0;
    padding: 0;
    list-style-type: none;
    display: flex;
    justify-content: space-around;
}

.menu-bar ul li {
    display: inline;
}

.menu-bar ul li a {
    display: block;
    color: white;
    text-align: center;
    padding: 14px 20px;
    text-decoration: none;
    font-size: 18px;
}

.menu-bar ul li a:hover {
    background-color: #575757;
    color: white;
}

.shared-card-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    margin-top: 20px;
}

/* Center the shared card table */
.shared-card-table-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

.shared-card-table {
    border-collapse: collapse;
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.shared-card-table th, .shared-card-table td {
    border: 1px solid #ccc;
    padding: 10px;
}

.shared-card-table th {
    background-color: #f4f4f4;
    font-weight: bold;
}

.shared-card-table td {
    background-color: #fff;
}

.shared-card-table tr:nth-child(even) td {
    background-color: #f9f9f9;
}
/* ABOUT PAGE */
.about-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    text-align: left;
    font-family: Arial, sans-serif;
    color: #333;
}

.about-container h1, .about-container h2 {
    text-align: center;
    color: #007bff;
}

.about-container ul {
    list-style-type: disc;
    margin-left: 20px;
}

.about-container p {
    line-height: 1.6;
}

/* Collapsible Section for Edit Card Page */
.collapsible-section {
    margin-top: 20px;
    border-top: 1px solid #e0e0e0;
    padding-top: 20px;
}

.collapsible-trigger {
    background-color: transparent;
    border: none;
    width: 100%;
    text-align: left;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    padding: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.collapsible-trigger .arrow {
    border: solid #333;
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(45deg);
    transition: transform 0.2s;
}

.collapsible-trigger.active .arrow {
    transform: rotate(-135deg);
}

.collapsible-content {
    display: none;
    overflow: hidden;
    padding-top: 10px;
}

/* PWA Install Prompt Banner */
.install-prompt-banner {
    display: none; /* Hidden by default */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #333;
    color: #fff;
    padding: 15px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    z-index: 2000;
    text-align: left;
    animation: slideInUp 0.5s ease-out;
}

.install-prompt-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.install-prompt-text {
    margin-right: 15px;
}

@keyframes slideInUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}