body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f9;
    color: #333;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    position: relative;
}

.view-buttons, .margin-input {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.controls-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.controls-row input {
    margin: 0;
    padding: 8px 16px;
    font-size: 0.95em;
    border: 1px solid #ccc;
    border-radius: 5px;
    width: 140px;
    text-align: center;
    -moz-appearance: textfield;
    appearance: textfield;
}

.controls-row input::-webkit-outer-spin-button,
.controls-row input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.controls-row input:hover {
    border-color: #007bff;
}

.controls-row button {
    margin: 0;
    padding: 8px 16px;
    font-size: 0.95em;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    background-color: #fff;
    transition: background-color 0.3s, color 0.3s;
}

.controls-row button:hover {
    background-color: #007bff;
    color: #fff;
}

.controls-row button.active {
    background-color: #007bff;
    color: #fff;
}

.view-buttons button, .margin-input input, .arrow-button {
    margin: 0 10px;
    padding: 10px 20px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

.view-buttons button:hover, .margin-input input:hover, .arrow-button:hover {
    background-color: #007bff;
    color: #fff;
}

.view-buttons button.active {
    background-color: #007bff;
    color: #fff;
}

.reset-button {
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    position: absolute;
    top: 10px;
    right: 10px;
}

.reset-button:hover {
    background-color: #0056b3; /* Darker blue */
    transform: rotate(360deg);
}

.today-button {
    background-color: #e9e9ed;
    color: #0078d7;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    position: absolute;
    top: 10px;
    left: 10px;
}

.today-button:hover {
    background-color: #0056b3; /* Darker blue */
    transform: rotate(360deg);
}

.chart-container {
    width: 100%;
    height: 0;
    padding-bottom: 50%;
    position: relative;
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

.margin-input input {
    -moz-appearance: textfield;
    appearance: textfield;
    text-align: center;
}

.margin-input input::-webkit-outer-spin-button,
.margin-input input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.toggle-button {
    margin: 0 10px;
    padding: 10px 20px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

.toggle-button.active {
    background-color: #007bff;
    color: #fff;
}

.toggle-button:hover {
    background-color: #0056b3;
    color: #fff;
}

body.loading {
    display: none;
}

.current-price-container {
    margin-top: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    border-left: 4px solid #007bff;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 16px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    color: white;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.stat-min {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.7) 0%, rgba(22, 163, 74, 0.6) 100%);
}

.stat-avg {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.7) 0%, rgba(37, 99, 235, 0.6) 100%);
}

.stat-max {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.7) 0%, rgba(220, 38, 38, 0.6) 100%);
}

.stat-label {
    font-size: 0.75em;
    opacity: 0.95;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: 600;
}

.stat-value {
    font-size: 1.8em;
    font-weight: bold;
    margin-bottom: 5px;
    line-height: 1.2;
}

.stat-unit {
    font-size: 0.7em;
    opacity: 0.9;
    font-weight: 500;
}

.current-price-container {
    margin-top: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    border-left: 4px solid #007bff;
}

.current-price-container h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
    font-size: 1.2em;
}

.current-price {
    font-size: 2.5em;
    font-weight: bold;
    color: #007bff;
    line-height: 1.2;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.price-unit {
    font-size: 0.5em;
    color: #6c757d;
    margin-left: 5px;
}

.price-details {
    display: block;
    font-size: 0.4em;
    color: #6c757d;
    font-weight: normal;
    margin-top: 5px;
}

/* Custom tooltip styling */
.chartjs-tooltip {
    opacity: 1;
    position: absolute;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 6px;
    padding: 12px;
    pointer-events: none;
    transform: translate(-50%, 0);
    transition: all .1s ease;
    z-index: 100;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    max-width: 250px;
}

.chartjs-tooltip-key {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 5px;
}
