/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


body {
    font-family: Arial, sans-serif;
    /*
    background: url('/images/bg/painting-mountain-lake-with-mountain-background.jpg') no-repeat center center fixed;
    background: url('/images/bg/0yd0pjuyetee1.jpeg') no-repeat center center fixed;
    */
    background: url('/images/bg/643p9n0as1ce1.jpeg') no-repeat center center fixed;

    background-size: cover;
    background-color: #f0f0f0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    color: #ffffff;
    line-height: 1.5;
}



body::before {
    content: '';
    position: absolute;
    top: 60px; /* Leave space for the `#header-bar` */
    bottom: 60px; /* Leave space for the `#footer-bar` */
    left: 0;
    width: 100%;
    height: calc(100% - 120px); /* Full height minus the #header-bar + #footer-bar */
    /* background-color: rgba(0, 0, 0, 0.5); /* 50% transparent dark overlay */
    z-index: 1; /* Place below content (.screen) */
}

.bar {
    position: absolute;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.7); /* Darker overlay for readability */
    z-index: 4;
    display: flex;
    align-items: center;
    padding: 0 15px; /* Add padding for aesthetic spacing */
    color: #ffffff; /* Ensure text is readable */
    font-size: 16px;
}

.bar a {
    color: #ffffff;
    text-decoration: none;
    font-weight: bolder;
    font-size: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* The header bar */
#header-bar {
    top: 0;
    justify-content: space-between; /* Spread <span> elements evenly */
}

#footer-bar {
    bottom: 0;
    justify-content: space-evenly;
}


/* Main Screen */
.screen {
    flex: 1;
    z-index: 3; /* Ensure it stays above the background and any overlay */
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;

    /* Set text and icon readability */
    color: #ffffff; /* Makes the text easily visible on the background */
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7); /* Gives text a glow-like readability */

    border-radius: 20px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}

/* Icon Grid */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(4, auto);
    gap: 15px;
    justify-items: center;
    justify-content: center;
    align-content: center;
    height: 100%;
}

/* Individual Icon Styles */
.icon {
    background-color: rgba(0, 0, 0, 0.6); /* Add contrast for readability */
    border-radius: 10px;
    padding: 20px;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    color: #ffffff;
    font-size: 14px;
    transition: transform 0.2s ease;
    cursor: grab;
}

/* Icon Dragging State */
.icon.dragging {
    opacity: 0.5;
    cursor: grabbing;
}



.icon img {
    max-width: 70%;
    max-height: 70%;
    object-fit: contain;
    margin-bottom: 5px;

}

.icon p {
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    max-width: 80px;
    margin: 0 auto;
}

.icon:hover {
    transform: scale(1.2);
}

/* Floating Add Icon Button */
.add-icon-btn {
    position: relative;
    bottom: 20px;
    /* right: 20px; */
    width: 56px;
    height: 56px;
    background-color: #4caf50;
    color: #fff;
    font-size: 30px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.add-icon-btn:hover {
    transform: scale(1.1);
    box-shadow: 0px 6px 10px rgba(0, 0, 0, 0.2);
}

/* Modal Styling */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}

.modal h2 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #6e6e6e;
}

.modal label {
    display: block;
    font-size: 14px;
    margin-bottom: 5px;
    color: #6e6e6e;
}

.modal input {
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    outline: none;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}



.btn, #reset-btn, .save-btn, .cancel-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}
.save-btn {
    background: #4caf50;
    color: #fff;
}
.cancel-btn {
    background: #f44336;
    color: #fff;
}
#reset-btn {
    background: #0D47A1;
    color: #fff;
}



/* When the modal is active */
.modal.active {
    opacity: 1;
    pointer-events: all;
}

.hidden {
    display: none;
}

/* Context Menu */
#context-menu {
    position: absolute;
    z-index: 1000;
    background: #f9f9f9; /* Light background for contrast */
    color: #333; /* Dark text */
    border: 1px solid #ccc;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 5px 0;
    list-style: none;
    display: none; /* Initially hidden */
    min-width: 120px;
    font-size: 14px;
}


#context-menu.hidden {
    display: none !important; /* Ensure it explicitly hides the context menu */
}

#context-menu:not(.hidden) {
    display: block; /* Ensure it's visible when the `hidden` class is removed */
}

#context-menu ul {
    margin: 0;
    padding: 0;
    list-style: none; /* Remove bullet points */
}


#context-menu li {
    padding: 8px 12px;
    cursor: pointer;
}

#context-menu li:hover {
    background-color: #e8e8e8; /* Highlight option on hover */
}

#context-menu li.separator {
    border-top: 1px solid #cccccc;
    list-style-type: none;
}



@media (max-width: 768px) {
    .screen {
        padding: 10px;
        flex-direction: column;
    }

    /*
    .icon {
        width: 80px;
        height: 80px;
        font-size: 12px;
    }

     */

    #header-bar {
        font-size: 14px;
    }

    #footer-bar {
        font-size: 14px;
    }

}

@media (orientation: portrait) {
    body {
        background-position: center center;
    }
}

@media (orientation: landscape) {
    body {
        background-position: top center;
    }
}
