body, html {
-webkit-user-select: none; /* Safari */
-ms-user-select: none; /* IE 10 and IE 11 */
user-select: none; /* Standard syntax */
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #121212;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.app-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: calc(100% - 70px); /* Full height minus toolbar */
    width: 100%;
}

#canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block; /* To avoid any potential alignment issues */
}

.toolbar {
    display: flex;
    justify-content: space-around;
    padding: 15px 0;
    background-color: #1f1f1f;
    width: 100%;
    position: fixed;
    bottom: 0;
    z-index: 2;
}

.toolbar button {
    background: none;
    border: 1px solid #555;
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 25px; /* Make it circular */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.1s;
}

.toolbar button:active {
    background-color: #333;
    transform: scale(0.95);
}

.top-right-controls {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 2;
}

.top-right-controls button {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.1s;
}

.top-right-controls button:active {
    background-color: #333;
    transform: scale(0.95);
}

.toolbar button.active {
    background-color: #FFC107;
}

.modal {
    display: none;
    position: fixed;
    z-index: 10;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.modal.show {
    display: flex;
    opacity: 1;
    align-items: center; /* Vertically center */
    justify-content: center; /* Horizontally center */
}

.modal-content {
    background-color: #1f1f1f;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

#help-modal .modal-content {
    width: 85%;
    height: 75%;
    max-width: none; /* Remove max-width constraint */
    max-height: none; /* Remove max-height constraint */
    overflow-y: auto; /* Enable vertical scrolling */
    transform: translateY(-100%); /* Start off-screen for slide-down */
    transition: transform 0.5s ease-out; /* Transition for slide-down */
}

#help-modal.show .modal-content {
    transform: translateY(0); /* Slide into view */
    animation: bounceIn 0.6s ease-out; /* Apply bounce animation */
}

#help-modal.hide .modal-content {
    transform: translateY(-100%); /* Slide out of view */
    transition: transform 0.5s ease-in; /* Transition for slide-up */
}

@keyframes bounceIn {
    0% {
        transform: translateY(-100%);
    }
    60% {
        transform: translateY(10%);
    }
    100% {
        transform: translateY(0);
    }
}

.close-btn {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal-top-right-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
}

.modal h2 {
    margin-top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal input[type="text"] {
    width: calc(100% - 22px); /* 100% - padding - border */
    padding: 10px;
    margin-bottom: 15px;
    background-color: #333;
    border: 1px solid #555;
    color: #fff;
    border-radius: 5px;
}

#recipe-name {
    font-size: 1em;
}

.recipe-json-display {
    width: calc(100% - 22px);
    height: 150px;
    margin-bottom: 15px;
    background-color: #333;
    border: 1px solid #555;
    color: rgba(255, 255, 255, 0.5); /* Faint white color */
    border-radius: 5px;
    padding: 10px;
    font-family: monospace;
    resize: vertical;
}

.modal button {
    background-color: #FFC107;
    color: white;
    padding: 12px 15px;
    border: none;
    border-radius: 5px;
    width: 100%;
    cursor: pointer;
    font-size: 16px;
}

#recipe-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 60vh; /* 60% of viewport height */
    overflow-y: auto;
}

#recipe-list li {
    padding: 12px;
    border-bottom: 1px solid #333;
    cursor: pointer;
}

#recipe-list li:hover {
    background-color: #333;
}

input::placeholder {
    color: #888;
}

input:focus {
    outline: none;
    border-color: #FFC107;
}

.modal-content input:required {
    position: relative;
}

.modal-content input:required + label::after {
    content: ' *';
    color: #ff3b30;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

#loading-indicator {
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #FFC107;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Sidebar Styles */
.sidebar {
    height: calc(100% - 70px); /* Adjusted height to account for toolbar */
    width: 0;
    position: fixed;
    z-index: 3; /* Changed z-index to be on top of toolbar */
    top: 0;
    right: 0;
    background-color: #1f1f1f;
    overflow-x: hidden;
    transition: 0.5s;
    padding-top: 60px;
    box-shadow: -5px 0 15px rgba(0,0,0,0.3);
    overflow-y: auto; /* Make the entire sidebar scrollable */
}

.sidebar.show {
    width: 310px; /* Adjust as needed */
}

.sidebar-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #1f1f1f;
    border-bottom: 1px solid #333;
}

.sidebar-header h2 {
    margin: 0;
    color: #ffffff;
    /* Removed display: flex and align-items: center */
}

.sidebar input[type="text"] {
    width: 240px;
    padding: 10px;
    margin: 15px auto;
    display: block;
    background-color: #333;
    border: 1px solid #555;
    color: #fff;
    border-radius: 5px;
}

.sidebar #saved-recipe-list,
.sidebar #uploaded-recipe-list {
    list-style: none;
    padding: 0 15px;
    margin: 0;
}

.sidebar #saved-recipe-list li,
.sidebar #uploaded-recipe-list li {
    padding: 12px 0;
    border-bottom: 1px solid #333;
    cursor: pointer;
}

.sidebar #saved-recipe-list li:last-child,
.sidebar #uploaded-recipe-list li:last-child {
    border-bottom: none;
}

.sidebar #saved-recipe-list li:hover,
.sidebar #uploaded-recipe-list li:hover {
    background-color: #333;
}

.delete-recipe-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 20px;
    cursor: pointer;
    float: right;
}

.delete-recipe-btn:hover {
    color: #fff;
}

.add-from-file-container {
    text-align: center;
    padding: 15px;
}

#add-from-file-btn {
    background-color: #FFC107;
    color: white;
    padding: 15px 20px; /* Increased padding */
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px; /* Increased font size */
    width: auto; /* Allow button to size to content */
    display: inline-block; /* For centering with text-align */
    transition: background-color 0.2s;
}

#add-from-file-btn:hover {
    background-color: #FFB300;
}

.download-recipe-btn {
    background: none;
    border: none;
    color: #FFC107;
    font-size: 20px; /* Increased font size */
    cursor: pointer;
    padding: 10px 12px; /* Increased padding */
    border-radius: 5px; /* Added border-radius for a slightly softer look */
}

.download-recipe-btn:hover {
    color: #FFB300;
}

#saved-recipe-list li span,
#uploaded-recipe-list li span {
    display: inline-block;
    vertical-align: middle;
}

#saved-recipe-list li .delete-recipe-btn,
#uploaded-recipe-list li .delete-recipe-btn {
    vertical-align: middle;
}

#saved-recipe-list li .download-recipe-btn {
    vertical-align: middle;
}

.sidebar-close-btn {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    margin-left: 10px; /* Add margin to separate from text */
    padding-right: 10px;
}

.help-modal-close-btn {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    margin-left: 10px; /* Add margin to separate from text */
    padding-right: 10px;
}
