/* Basic reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Global typography & background */
body {
    font-family: 'Open Sans', sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

main {
    max-width: 800px;
    margin: 2rem auto;
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Header */
header {
    background: #005f73;
    color: #fff;
    padding: 1rem 0;
    text-align: center;
}

h1 {
    margin: 0;
    font-weight: 600;
}

h2 {
    margin-top: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e0e0e0;
    color: #005f73;
    font-weight: 500;
}

/* Horizontal rules */
hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 2rem 0;
}

/* Buttons & inputs */
.btn {
    background: #0077b6;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn:hover {
    background: #005f86;
}

input[type="number"] {
    padding: 0.4rem 0.6rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 10ch; /* increased to accommodate longer numeric values */
}

/* toast */
#toast {
    visibility: hidden;
    min-width: 200px;
    background: #333;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 0.75rem 1rem;
    position: fixed;
    left: 50%;
    bottom: 2rem;
    transform: translateX(-50%) translateY(100px);
    opacity: 0;
    transition: opacity 0.4s, transform 0.4s;
}

#toast.show {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* new table & number-input styles */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 1.5rem;
}

#template-table,
#consumption-table {
    width: auto;
    min-width: 100%;
    border-collapse: collapse;
}

#consumption-table th,
#consumption-table td {
    padding: .5rem;
    border: 1px solid #ccc;
    text-align: center;
    white-space: nowrap;
}

.num-input {
    display: flex;
    align-items: center;
    justify-content: center;
}

.num-input input {
    width: 3rem;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin: 0 .25rem;
}

.num-input button {
    width: 1.5rem;
    height: 1.5rem;
    border: none;
    background: #0078d4;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    line-height: 1;
}

.num-input button.minus {
    background: #005a9e;
}

/* highlight inputs that have a value > 0 */
.num-input input.filled {
    background: #e0f7fa;
    border-color: #0078d4;
}

/* vertical template controls */
#template-vertical {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

#template-vertical label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

/* start PEth options dropdown */
#startPethOptions,
#pethPerGrOptions,
#halfLifeOptions {
    position: absolute;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    margin-top: 0.25rem;
    z-index: 100;
}

.option {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
}

.option:hover {
    background: #f0f0f0;
}

/* result summary styling */
.result-summary {
    font-size: 1.1rem;
    background: #e6f4ff;
    border-left: 4px solid #0078d4;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    border-radius: 4px;
    color: #005a9e;
    text-align: center;
}
