body {
    font-family: sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
}

header {
    background-color: #004080; /* Dark blue */
    color: #fff;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
}

main {
    max-width: 900px;
    margin: 2rem auto;
    padding: 1.5rem;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-radius: 5px;
}

.calculator-form {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

select, input[type="date"], input[type="text"], button {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Include padding in width */
    font-size: 1rem;
}

select {
    max-width: 600px; /* Prevent select from becoming excessively wide */
}

input[type="date"] {
   max-width: 200px; /* Make date inputs less wide */
}

.input-group {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 4px;
}

.input-group div { /* Style individual input containers */
    margin-bottom: 1rem;
}

.input-group label { /* Style labels within the dynamic group */
    font-weight: normal;
    margin-bottom: 0.3rem;
}

/* Specific styling for checkboxes */
.input-group .checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}
.input-group .checkbox-group input[type="checkbox"] {
    width: auto; /* Override default width */
    margin: 0 0.5rem 0 0; /* Adjust margin */
    padding: 0;
}
.input-group .checkbox-group label {
    margin-bottom: 0; /* Reset bottom margin for checkbox label */
    font-weight: normal;
}


button {
    background-color: #0056b3; /* Slightly lighter blue */
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover:not(:disabled) {
    background-color: #004080; /* Darker blue on hover */
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#show-disclaimer-btn {
    width: auto; /* Override default button width */
    padding: 0.5rem 1rem;
    background-color: #e9ecef;
    color: #333;
    border: 1px solid #ccc;
}
#show-disclaimer-btn:hover {
     background-color: #d6d8db;
}

#results-area h2 {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

#results-output ul {
    list-style: none;
    padding: 0;
}

#results-output li {
    background-color: #e9f5ff; /* Light blue background */
    border: 1px solid #b8d6eb;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

#results-output li .rule {
    font-weight: bold;
    color: #004080;
    margin-right: 0.5em;
}

#results-output li .date {
    font-weight: bold;
    margin-right: 0.5em;
}
#results-output li .weekday {
    color: #555;
    font-style: italic;
    margin-right: 1em;
}

#results-output li .notes {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #444;
    white-space: pre-wrap; /* Preserve line breaks in notes */
    border-left: 3px solid #0056b3;
    padding-left: 0.8rem;
    background-color: #f8f9fa;
}
#results-output li .notes::before {
    content: "Note: ";
    font-weight: bold;
}


.error-message {
    color: #721c24; /* Dark red */
    background-color: #f8d7da; /* Light red */
    border: 1px solid #f5c6cb;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}

footer {
    text-align: center;
    margin-top: 2rem;
    padding: 1rem;
    font-size: 0.9rem;
    color: #666;
}
footer a {
    color: #0056b3;
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.5); /* Black w/ opacity */
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto; /* 10% from the top and centered */
    padding: 25px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
    max-width: 700px;
    border-radius: 5px;
    position: relative;
}

.modal-content h2 {
    margin-top: 0;
    color: #004080;
    text-align: center;
    margin-bottom: 1.5rem;
}
.modal-content p {
    margin-bottom: 1rem;
}
.modal-content strong {
    color: #c00; /* Red for emphasis */
}

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

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

.close-modal-btn {
    display: block;
    margin: 1.5rem auto 0;
    width: auto;
    padding: 0.6rem 1.5rem;
}

/* Small screen adjustments */
@media (max-width: 600px) {
    header {
        flex-direction: column;
        text-align: center;
    }
    header h1 {
        margin-bottom: 0.5rem;
        font-size: 1.3rem;
    }
    main {
        margin: 1rem;
        padding: 1rem;
    }
    select, input[type="date"], button {
        font-size: 0.95rem;
        padding: 0.7rem;
    }
    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 20px;
    }
}