/* Main Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: var(--z-modal, 90); /* Sit on top */
    top: 0;
    left: 0;
    width: 100%; /* Full width */
    height: 100vh; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
    padding-top: 5vh; /* 10vh from the top */
    box-sizing: border-box;
}

/* Modal content styles */
.modal-content {
    background-color: var(--color-background);
    margin: 0 auto; /* Centered horizontally */
    padding: 20px;
    width: 80%; /* Could be more or less, depending on screen size */
    max-width: 800px; /* Maximum width for better readability */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--color-text);
    line-height: 1.6;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: calc(var(--z-modal, 90) + 1);
}

/* Close button styles */
.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: var(--color-primary);
    text-decoration: none;
    cursor: pointer;
}

/* Search Result Modal */
.search-result-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: var(--z-overlay, 60);
    display: flex;
    justify-content: center;
    align-items: center;
}

.search-result-modal-content {
    background-color: var(--color-background);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    width: 51vw;
    max-width: 51vw;
    height: 75vh;
    text-align: center;
    color: var(--color-text);
    position: relative;
    display: flex;
    flex-direction: column;
    z-index: calc(var(--z-overlay, 60) + 1);
}

.search-result-modal-content p {
    margin-bottom: 15px;
}

.search-result-modal-close-button {
    margin-top: 15px;
    padding: 8px 16px;
    background-color: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-result-modal-close-button:hover {
    background-color: var(--color-primary-dark);
    transform: scale(1.03);
}

/* Modal List Container */
.modal-list-container {
    flex-grow: 1;
    overflow-y: auto;
    text-align: left;
    margin-bottom: 10px;
    min-height: 0;
}

.modal-list-container ul {
    list-style-type: none;
    padding-left: 0;
    margin-top: 15px;
    margin-bottom: 0;
}

/* Modal List Items */
.modal-list-item {
    background-color: var(--color-secondary);
    padding: 12px 18px;
    margin-bottom: 12px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.modal-list-item strong {
    color: var(--color-text);
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
}

.modal-list-item p {
    font-size: 0.9em;
    color: var(--color-text);
    margin-top: 0;
    margin-bottom: 0;
    line-height: 1.4;
}

/* Load Data Button in Modal */
.modal-load-data-button {
    margin-right: 10px;
}

/* Tutorial Overlay */
#tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: var(--z-modal, 90);
    display: flex;
    justify-content: center;
    align-items: center;
}

#tutorial-highlight {
    position: absolute;
    border: 2px solid #4CAF50;
    border-radius: 4px;
    pointer-events: none;
    transition: all 0.3s ease;
    box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.7);
    z-index: calc(var(--z-modal, 90) + 1);
}

#tutorial-content {
    background-color: var(--color-background);
    padding: 20px;
    border-radius: 8px;
    max-width: 80%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    z-index: calc(var(--z-modal, 90) + 2);
}

#tutorial-text {
    margin-bottom: 20px;
}

#tutorial-continue {
    background-color: var(--color-primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

#tutorial-continue:hover {
    background-color: var(--color-primary-dark);
}

.hidden {
    display: none !important;
}
