/* Basic styling for the calculator */
body {
    font-family: sans-serif;
    margin: 20px;
    background-color: #f4f4f4;
    color: #333;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

h1 {
    color: #0056b3;
    margin: 0;
}

#help-btn {
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 50%; /* Make it circular */
    width: 30px;
    height: 30px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

#help-btn:hover {
    background-color: #0056b3;
}


#app {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow-x: auto; /* Allow horizontal scrolling for the spreadsheet */
}

#tabs-container {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 10px;
    border-bottom: 2px solid #ddd;
    padding-bottom: 5px;
}

.tab-button {
    background-color: #e0e0e0;
    border: 1px solid #ccc;
    border-bottom: none;
    padding: 8px 15px;
    cursor: pointer;
    margin-right: 5px;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    font-size: 0.9em;
    transition: background-color 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tab-button:hover {
    background-color: #d0d0d0;
}

.tab-button.active {
    background-color: #fff;
    border-color: #0056b3;
    border-bottom: 2px solid #fff; /* Overlap the container's border */
    font-weight: bold;
    color: #0056b3;
    z-index: 1;
}

.tab-button .tab-name {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px; /* Limit tab name width */
}

.tab-button .close-tab-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 1em;
    cursor: pointer;
    padding: 0 3px;
    line-height: 1;
    transition: color 0.2s ease;
}

.tab-button .close-tab-btn:hover {
    color: #333;
}

#add-sheet-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    margin-left: 10px;
    transition: background-color 0.2s ease;
}

#add-sheet-btn:hover {
    background-color: #0056b3;
}

/* Styling for read-only cells in Jexcel */
.readonly {
    background-color: #e9ecef !important; /* Light gray background */
    color: #495057 !important; /* Darker text for readability */
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
    backdrop-filter: blur(5px); /* Frosted glass effect */
    -webkit-backdrop-filter: blur(5px); /* For Safari */
    padding-top: 60px; /* Location of the box */
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto; /* 15% from the top and centered */
    padding: 30px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
    max-width: 600px; /* Max width for larger screens */
    border-radius: 10px;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
    position: relative;
    animation-name: animatetop;
    animation-duration: 0.4s
}

/* Add Animation */
@keyframes animatetop {
    from {top: -300px; opacity: 0}
    to {top: 0; opacity: 1}
}

.modal-content h2 {
    color: #0056b3;
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.modal-content ul {
    list-style-type: disc;
    margin-left: 20px;
    padding-left: 0;
}

.modal-content li {
    margin-bottom: 5px;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 15px;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}