body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    margin: 0;
    padding: 20px;
    background-color: #f8f9fa;
    color: #333;
}

h1, h2 {
    text-align: center;
    color: #2c3e50;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.filters {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-weight: bold;
}

.filter-group select, .filter-group input {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

.visuals-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.map-container, .chart-container {
    flex: 1;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid #e0e0e0;
    background-color: #fff;
    min-width: 0;
}

.chart-container {
    position: relative;
    height: 450px;
}

#map {
    height: 400px;
    width: 100%;
}

.map-tooltip {
    position: absolute;
    text-align: center;
    width: auto;
    padding: 8px;
    font: 12px sans-serif;
    background: lightsteelblue;
    border: 0;
    border-radius: 8px;
    pointer-events: none;
}

#data-container {
    padding-top: 20px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

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

thead th {
    background-color: #3498db;
    color: #ffffff;
    font-weight: bold;
}

tbody tr:nth-of-type(even) {
    background-color: #f8f9fa;
}

tbody tr:hover {
    background-color: #f1f1f1;
}

p {
    text-align: center;
}

.nav-controls {
    text-align: center;
    margin-bottom: 20px;
}

.nav-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    margin: 0 10px;
    font-size: 1em;
}

.nav-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.price-up {
    color: #28a745; /* Green */
}

.price-down {
    color: #dc3545; /* Red */
}

.price-cell-content {
    display: flex;
    align-items: center;
}

.variety-cell-content {
    display: flex;
    align-items: center;
}

.organic-icon {
    margin-right: 4px;
}

.map-container h3, .chart-container h3 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 15px;
    color: #34495e;
}

/* --- Ticker Styles --- */
@keyframes ticker {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%); /* A 50% translation is a full loop for duplicated content */
    }
}

.ticker-wrap {
    width: 100%;
    overflow: hidden;
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 15px 0;
    box-sizing: border-box;
    margin: 20px 0;
}

.ticker {
    display: inline-block;
    white-space: nowrap;
}

.ticker.is-animating {
    animation-name: ticker;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

.ticker-item {
    display: inline-block;
    padding: 0 2rem;
    font-size: 1.1em;
}

.ticker-item .price-up {
    color: #2ecc71; /* A brighter green */
}

.ticker-item .price-down {
    color: #e74c3c; /* A brighter red */
}

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

.modal-content {
    background-color: #fefefe;
    margin: 10% auto; /* 10% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 900px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

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

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

#trend-modal-title {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 20px;
}

.chart-container-modal {
    position: relative;
    height: 400px;
}

#narrative-modal-title {
    text-align: center;
}

.modal-content-narrative {
    white-space: pre-wrap;
    padding: 20px;
}

.narrative-headline {
    text-align: center;
    font-weight: bold;
}

.narrative-body {
    text-align: justify;
}

#report-title {
    margin-top: 10px;
}

#report-dates {
    text-align: center;
    margin: 10px auto;
}

.filter-container {
    display: flex;
    justify-content: space-around;
}