/* Basic Reset & Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    background-color: #e9ecef; /* Light gray background */
    color: #212529; /* Dark gray text */
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 20px;
}

.container {
    background-color: #ffffff;
    padding: 25px 30px;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 800px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #dee2e6;
}

header h1 {
    color: #0056b3; /* A nice blue */
    font-size: 1.9em;
    font-weight: 600;
}

.calculator-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.date-group {
    background-color: #f8f9fa; /* Slightly off-white for groups */
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ced4da;
}

.date-group h2 {
    font-size: 1.4em;
    color: #343a40;
    margin-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 8px;
}

.input-row {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column; /* Stack label above input on small screens */
}

.input-row:last-child {
    margin-bottom: 0;
}

.input-row label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #495057;
}

.input-row input[type="date"],
.input-row input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.input-row input[type="date"]:focus,
.input-row input[type="number"]:focus {
    outline: none;
    border-color: #80bdff; /* Blue focus */
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.results-panel {
    margin-top: 10px; /* Add some space above results */
    padding: 20px;
    background-color: #0056b3; /* Blue background for results */
    color: #ffffff;
    border-radius: 8px;
    text-align: center;
}

.results-panel h2 {
    font-size: 1.4em;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 8px;
}

#date-difference-output,
#epoch-difference-output {
    font-size: 1.1em;
    font-weight: 500;
    line-height: 1.8;
}
#date-difference-output span,
#epoch-difference-output span {
    font-weight: bold;
    color: #ffc107; /* Yellow accent for numbers */
}


footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
    font-size: 0.9em;
    color: #6c757d;
}

/* Responsive adjustments */
@media (min-width: 600px) {
    .calculator-panel {
        grid-template-columns: 1fr 1fr; /* Two columns for date groups on wider screens */
        gap: 25px;
    }
    .date-group { /* Make date groups span if only one in a row or results below */
        grid-column: span 1;
    }
    .results-panel {
        grid-column: span 2; /* Results panel spans both columns */
    }
    .input-row {
        flex-direction: row; /* Label and input side-by-side */
        align-items: center;
    }
    .input-row label {
        margin-bottom: 0;
        margin-right: 10px;
        min-width: 150px; /* Give labels some consistent width */
        text-align: right;
    }
    .input-row input[type="date"],
    .input-row input[type="number"] {
        flex-grow: 1; /* Input takes remaining space */
    }
}