:root {
    --background: #f4f7f6;
    --foreground: #333;
    --card-background: #fff;
    --card-foreground: #333;
    --primary-color: #dc3545;
    --primary-foreground: #fff;
    --secondary-color: #007bff;
    --secondary-foreground: #fff;
    --muted-color: #6c757d;
    --muted-foreground: #f4f7f6;
    --accent-color: #28a745;
    --accent-foreground: #fff;
    --destructive-color: #dc3545;
    --border-color: #eee;
    --input-color: #ccc;
    --ring-color: #007bff;
    --warning-background: #fff3cd;
    --warning-foreground: #856404;
    --warning-border: #ffc107;

    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
}

html.dark-mode {
    --background: #1a1a1a;
    --foreground: #f4f7f6;
    --card-background: #2a2a2a;
    --card-foreground: #f4f7f6;
    --primary-color: #ff6b6b;
    --primary-foreground: #f4f7f6;
    --secondary-color: #87ceeb;
    --secondary-foreground: #f4f7f6;
    --muted-color: #aaa;
    --muted-foreground: #333;
    --accent-color: #218838;
    --accent-foreground: #fff;
    --destructive-color: #ff6b6b;
    --border-color: #555;
    --input-color: #777;
    --ring-color: #87ceeb;
    --warning-background: #6a5a2d;
    --warning-foreground: #ffebcd;
    --warning-border: #e0a800;

    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    background-color: var(--background);
    color: var(--foreground);
    transition: background-color 0.3s, color 0.3s;
    line-height: 1.6;
    font-size: 1rem;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background-color: var(--card-background);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 997;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0;
    font-size: 24px; /* Slightly smaller font size */
    color: var(--primary-color);
}
header h1 a{
    text-decoration: none;
    color: var(--primary-color);
}

.controls button {
    background: none;
    color: var(--muted-color);
    border: none;
    padding: 8px 12px; /* Smaller padding for buttons */
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2rem; /* Smaller font size for buttons */
    margin-left: 10px;
    transition: background-color 0.3s;
}

.controls button:hover {
    color: var(--secondary-color);
    background-color: var(--background);
}

#bookmark-btn.bookmarked {
        color: var(--secondary-color);
    background-color: var(--background);
}

#bookmark-btn.bookmarked:hover {
        color: var(--secondary-color);
    background-color: var(--background);
}

.card {
    background-color: var(--card-background);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.progress-section h2, .important-notice h2, .additional-tips h2 {
    color: var(--foreground);
    margin-top: 0;
}

.progress-bar-container {
    background-color: var(--border-color);
    border-radius: 5px;
    height: 10px;
    margin-bottom: 10px;
}

.progress-bar {
    background-color: var(--accent-color);
    height: 100%;
    border-radius: 5px;
    width: 0%;
    transition: width 0.3s ease-in-out;
}

.important-notice {
    border-left: 5px solid var(--warning-border);
    background-color: var(--warning-background);
    color: var(--warning-foreground);
}

.checklist-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.checklist-item:last-child {
    border-bottom: none;
}

.checklist-item:hover .item-actions {
    opacity: 1;
}

.checklist-item input[type="checkbox"] {
    margin-right: 10px;
    width: 20px;
    height: 20px;
    cursor: pointer;

}

.checklist-item label {
    flex-grow: 1;
    cursor: pointer;
    font-size: 1.05em; /* Slightly smaller font size */
}

.checklist-item.checked label {
    text-decoration: line-through;
    color: var(--muted-color);
}

.checklist-item span.quantity {
    font-size: 0.85em; /* Slightly smaller font size */
    color: var(--muted-color);
    margin-left: 5px;
}

.item-actions {
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.3s;
    margin-left: 10px;
}

.item-actions button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 3px;
    font-size: 12px;
    transition: background-color 0.3s;
}

.edit-btn {
    color: var(--secondary-color);
}

.edit-btn:hover {
    background-color: var(--secondary-color);
    color: var(--secondary-foreground);
}

.delete-btn {
    color: var(--destructive-color);
}

.delete-btn:hover {
    background-color: var(--destructive-color);
    color: var(--primary-foreground);
}

.edit-item-form {
    display: none;
    background-color: var(--card-background);
    border: 2px solid var(--secondary-color);
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
}

.edit-item-form input {
    width: 98%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--background);
    color: var(--foreground);
    font-size: 14px;
}

.edit-item-form .form-buttons {
    display: flex;
    gap: 10px;
}

.edit-item-form button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.edit-item-form .update-btn {
    background-color: var(--secondary-color);
    color: var(--secondary-foreground);
}

.edit-item-form .update-btn:hover {
    background-color: var(--primary-color);
}

.edit-item-form .cancel-edit-btn {
    background-color: var(--muted-color);
    color: var(--muted-foreground);
}

.edit-item-form .cancel-edit-btn:hover {
    background-color: var(--destructive-color);
}

.category-title {
    font-size: 20px; /* Slightly smaller font size */
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--secondary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 3px solid var(--secondary-color);
    padding-left: 10px;
}

.add-item-btn {
    color: var(--accent-color);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s, transform 0.2s;
}

.add-item-btn:hover {
    background-color: var(--secondary-color);
    color: var(--card-background);
    transform: scale(1.1);
}

.custom-item-form {
    display: none;
    background-color: var(--card-background);
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.custom-item-form input {
    width: 98%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--background);
    color: var(--foreground);
    font-size: 14px;
}

.custom-item-form .form-buttons {
    display: flex;
    gap: 10px;
}

.custom-item-form button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.custom-item-form .save-btn {
    background-color: var(--accent-color);
    color: var(--accent-foreground);
}

.custom-item-form .save-btn:hover {
    background-color: var(--primary-color);
}

.custom-item-form .cancel-btn {
    background-color: var(--muted-color);
    color: var(--muted-foreground);
}

.custom-item-form .cancel-btn:hover {
    background-color: var(--destructive-color);
}

.custom-item {
    background-color: var(--card-background);
}

.additional-tips ul {
    list-style: none;
    padding: 0;
}

.additional-tips li {
    padding: 0.5rem 0;
    font-size: 0.875rem; /* Slightly smaller font size */
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}
.additional-tips li::before {
    content: "✓";
    color: var(--accent-color);
    font-weight: bold;
    position: relative;
    left: 0;
}

.category-card {
    margin-bottom: 20px;
}

footer {
    background-color: var(--card-background);
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.85em;
    color: var(--muted-color);
}

@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        text-align: center;
    }

    header h1 {
        margin-bottom: 10px;
    }

    .controls {
        margin-top: 10px;
    }

    .controls button {
        margin: 5px;
    }

    .container {
        padding: 15px;
    }

    .card {
        padding: 15px;
    }

    .checklist-item label {
        font-size: 1em;
    }

    .checklist-item span.quantity {
        font-size: 0.8em;
    }

    .category-title {
        font-size: 18px;
    }

    .additional-tips li {
        font-size: 0.85em;
    }
}

@media print {
    header, .controls, .important-notice, .additional-tips, footer {
        display: none !important;
    }
    body {
        background-color: white !important;
        color: black !important;
    }
    .card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
    .progress-bar-container {
        background-color: #e9ecef !important;
    }
    .progress-bar {
        background-color: #28a745 !important;
    }
    .checklist-item.checked label {
        color: #333 !important;
    }
}


/* Mobile Menu Styles */
.menu-icon {
    display: none; /* Hidden by default, shown on mobile */
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    cursor: pointer;
    padding: 5px;
    z-index: 1000;
}

.menu-icon .bar {
    width: 100%;
    height: 3px;
    background-color: var(--foreground);
    transition: all 0.3s ease;
}

.mobile-menu {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    right: -300px; /* Start off-screen */
    width: 275px;
    height: 100%;
    background-color: var(--card-background);
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    transition: right 0.3s ease;
    z-index: 999;
}

.mobile-menu.open {
    left: 0;
}

.mobile-menu .close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--foreground);
    cursor: pointer;
    align-self: flex-end;
    margin-bottom: 20px;
}

.mobile-menu .menu-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.mobile-menu .menu-controls button {
    width: 100%;
    padding: 12px;
    font-size: 1.5rem;
    justify-content: flex-start;
}

.mobile-menu .menu-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: none;
}

.mobile-menu .menu-links li a {
    display: block;
    padding: 12px 0;
    color: var(--foreground);
    text-decoration: none;
    font-size: 16px;
    border-bottom: 1px solid var(--border-color);
    transition: color 0.3s;
}

.mobile-menu .menu-links li a:hover {
    color: var(--primary-color);
}

/* Hamburger to Cross Transformation */
.menu-icon.open .bar:nth-child(1) {
    transform: translateY(11px) rotate(45deg);
}

.menu-icon.open .bar:nth-child(2) {
    opacity: 0;
}

.menu-icon.open .bar:nth-child(3) {
    transform: translateY(-11px) rotate(-45deg);
}

/* Media Queries for Mobile Responsiveness */
@media (max-width: 768px) {
/* Overlay for mobile menu */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 998; /* Below mobile menu, above other content */
    transition: opacity 0.3s ease;
}

.overlay.open {
    display: block;
}
.custom-item-form input {
    width: 95%;
}
.edit-item-form input {
    width: 95%;
}
.checklist-item {
    align-items: flex-start;
}
.checklist-item input[type="checkbox"] {
        width: 18px;
        height: 18px;
        min-width: 18px; /* Ensure consistent size */
        min-height: 18px; /* Ensure consistent size */
        margin-top: 0.3rem;
        flex-shrink: 0;
    }
    .desktop-controls {
        display: none;
    }

    .menu-icon {
        display: flex;
    }

    .mobile-menu {
        display: flex;
    }

    header .container {
        flex-direction: row;
        justify-content: space-between;
    }

    header h1 {
        font-size: 20px;
    }
}


