body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    width: 90%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 10px 10px 80px 10px;
    background-color: #1a1a1a;
    color: #e4e4e4;
    min-height: 100vh;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 3px solid #4a9eff;
}

h1 {
    font-size: 28px;
    color: #ffffff;
    margin: 0;
    padding: 0;
    border: none;
}

.settings-btn {
    background-color: #2d2d2d;
    border: 1px solid #444;
    color: #e4e4e4;
    padding: 8px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
    white-space: nowrap;
    width: auto;
}

.settings-btn:hover {
    background-color: #3a3a3a;
}

#results h1 {
    font-size: 28px;
    color: #ffffff;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #4a9eff;
}

.control-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #e4e4e4;
}

select, button, input[type="text"], input[type="password"] {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
    border: 1px solid #444;
    border-radius: 3px;
    background-color: #2d2d2d;
    color: #e4e4e4;
    font-size: 14px;
    font-family: inherit;
}

input[type="text"], input[type="password"] {
    margin-bottom: 5px;
}

input[type="password"] + small {
    display: block;
    margin-bottom: 15px;
    color: #999;
    font-size: 12px;
}

button {
    background-color: #4a9eff;
    color: white;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

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

button:hover:not(:disabled) {
    background-color: #6bb0ff;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.button-group button {
    flex: 1;
}

#export-excel-btn {
    background-color: #2d8659;
}

#export-excel-btn:hover:not(:disabled) {
    background-color: #34a668;
}

#results h2 {
    font-size: 20px;
    margin-top: 25px;
    border-bottom: 2px solid #444;
    padding-bottom: 10px;
    color: #ffffff;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 14px;
    background-color: #2d2d2d;
}

thead tr {
    background-color: #3a3a3a;
    border-bottom: 2px solid #555;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #444;
    color: #e4e4e4;
}

th {
    font-weight: 600;
}

tbody tr:hover {
    background-color: #3a3a3a;
}

tfoot tr {
    background-color: #3a3a3a;
    font-weight: 600;
}

.total-label {
    text-align: right;
    padding-right: 15px;
}

td a {
    text-decoration: none;
    color: #4a9eff;
    font-weight: 500;
}

td a:hover {
    text-decoration: underline;
    color: #6bb0ff;
}

.story-points {
    text-align: center;
    font-weight: 600;
    width: 120px;
}

.section-break {
    margin-top: 50px !important;
}

.time-metric {
    text-align: center;
    width: 100px;
    font-size: 13px;
}

tfoot tr:first-of-type {
    border-top: 2px solid #555;
}

tfoot .total-label {
    text-align: right;
    padding-right: 15px;
    color: #b8b8b8;
}

.combined-average-row {
    background-color: #2a3f5f;
    font-weight: 600;
    border-bottom: 1px solid #444;
}

.combined-average-row:first-of-type {
    border-top: 2px solid #4a9eff;
}

/* --- MODAL STYLES --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #2d2d2d;
    padding: 30px;
    border: 1px solid #444;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #ffffff;
    border-bottom: 2px solid #4a9eff;
    padding-bottom: 10px;
}

.close {
    color: #999;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close:hover {
    color: #ffffff;
}

.modal-body {
    padding: 10px 0;
}

.modal-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background-color: #2d2d2d;
}

.modal-table tr {
    border-bottom: 1px solid #444;
}

.modal-table .duration-row {
    background-color: #3a3a3a;
    font-weight: 600;
}

.modal-table .label {
    text-align: left;
    padding: 12px 0;
    color: #b8b8b8;
    width: 40%;
    font-weight: 600;
}

.modal-table .value {
    text-align: left;
    padding: 12px 15px;
    color: #e4e4e4;
    word-break: break-word;
}

/* Make time cells clickable */
.time-metric-clickable {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.time-metric-clickable:hover {
    background-color: #2a3f5f;
    border-radius: 3px;
}

/* Make average metrics clickable to copy */
.avg-metric-copy {
    cursor: copy;
    transition: background-color 0.2s ease;
    position: relative;
}

.avg-metric-copy:hover {
    background-color: #2a3f5f;
    border-radius: 3px;
}

.avg-metric-copy:active {
    background-color: #3a5f7f;
}

/* Settings form styles */
.setting-group {
    margin-bottom: 20px;
}

.setting-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #e4e4e4;
}

.setting-group small {
    display: block;
    margin-top: 3px;
    color: #999;
    font-size: 12px;
}

.settings-save-btn {
    width: 100%;
    padding: 12px;
    background-color: #4a9eff;
    color: white;
    border: none;
    border-radius: 3px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
}

.settings-save-btn:hover {
    background-color: #6bb0ff;
}

#settings-message {
    text-align: center;
    padding: 10px;
    border-radius: 3px;
}

#settings-message.success {
    background-color: #1e4620;
    color: #8bc34a;
}

#settings-message.error {
    background-color: #4a1e1e;
    color: #ff6b6b;
}

/* --- GO TO TOP BUTTON STYLES --- */
#go-top-btn {
    opacity: 0;
    visibility: hidden;
    position: fixed;
    bottom: 80px;
    right: 30px;
    z-index: 99;
    width: 50px;
    height: 50px;
    font-size: 24px;
    border: none;
    border-radius: 50%;
    background-color: #4a9eff;
    color: white;
    cursor: pointer;
    line-height: 1;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

#go-top-btn.show {
    opacity: 1;
    visibility: visible;
}

#go-top-btn:hover {
    background-color: #6bb0ff;
}

/* --- FOOTER STYLES --- */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #2d2d2d;
    border-top: 1px solid #444;
    padding: 15px 0;
    text-align: center;
    z-index: 98;
}

.footer p {
    margin: 0;
    color: #999;
    font-size: 14px;
    font-weight: 500;
}
