* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 10px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 20px;
}

.portal-back {
    margin-bottom: 12px;
    font-size: 0.9em;
}

.portal-back a {
    color: #667eea;
    text-decoration: none;
}

.portal-back a:hover {
    text-decoration: underline;
}

.banner-pr {
    margin-bottom: 16px;
    text-align: center;
}

.banner-pr a {
    display: inline-block;
    line-height: 0;
}

.banner-pr img {
    width: 320px;
    height: 120px;
    max-width: none;
    vertical-align: bottom;
}

.banner-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.banner-row a {
    display: inline-block;
    line-height: 0;
}

.banner-row img {
    width: 300px;
    height: 100px;
    max-width: none;
    vertical-align: bottom;
}

header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

header h1 {
    font-size: 1.8em;
    color: #2c3e50;
    margin-bottom: 5px;
}

.subtitle {
    color: #2c3e50;
    font-size: 1.2em;
    font-weight: 600;
    background-color: #f0f4ff;
    padding: 8px 15px;
    border-radius: 6px;
    display: inline-block;
    margin-top: 5px;
}

.location-input {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.location-input h2 {
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 1.1em;
}

.input-group {
    display: grid;
    grid-template-columns: auto 1fr auto 1fr;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.input-group label {
    font-weight: 600;
    color: #555;
    font-size: 0.9em;
}

.input-group input {
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.9em;
    transition: border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

button {
    padding: 8px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

button:active {
    transform: translateY(0);
}

button.secondary {
    background: #6c757d;
}

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

button.secondary:hover {
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.4);
}


.help-text {
    font-size: 0.8em;
    color: #6c757d;
    margin-top: 8px;
}

.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

.hidden {
    display: none;
}

.results {
    margin-top: 15px;
}

.results h2 {
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 1.2em;
}

.forecast-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.forecast-table-container {
    overflow-x: auto;
    margin-top: 10px;
}

.forecast-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    table-layout: fixed;
}

.forecast-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.forecast-table th {
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9em;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.time-header {
    background: #2c3e50;
    width: 10%;
}

.date-header {
    width: 30%;
    font-size: calc(0.9em + 2pt);
}

.date-sub {
    font-size: calc(0.8em + 2pt);
    opacity: 0.9;
    font-weight: 400;
}

.forecast-table tbody tr {
    border-bottom: 1px solid #eee;
}

.forecast-table tbody tr:hover {
    background-color: #f8f9fa;
}

.time-cell {
    padding: 10px;
    text-align: center;
    font-weight: 600;
    background: #f8f9fa;
    border-right: 2px solid #ddd;
    font-size: calc(0.9em + 2pt);
    color: #2c3e50;
}

.forecast-cell {
    padding: 8px;
    vertical-align: top;
    border: 1px solid #e0e0e0;
    min-height: 120px;
}

.past-cell {
    background-color: #e9ecef;
    color: #6c757d;
    text-align: center;
    font-size: 0.9em;
}

.empty-cell {
    background-color: #f8f9fa;
    text-align: center;
    color: #adb5bd;
}

.not-spray-time {
    background-color: #f8f9fa;
    text-align: center;
    color: #6c757d;
    font-size: 0.8em;
}

.not-spray-time-content {
    opacity: 0.8;
    border-left-color: #e0e0e0 !important;
}

.spray-time-label {
    font-size: 0.75em;
    color: #6c757d;
    margin-bottom: 2px;
    font-weight: 600;
    text-align: center;
    padding: 1px;
    background-color: #f0f0f0;
    border-radius: 3px;
}

.cell-content {
    padding: 2px;
    border-radius: 4px;
    font-size: 0.85em;
}

.cell-content.status-green {
    background-color: #d4edda;
    border-left: 3px solid #28a745;
}

.cell-content.status-yellow {
    background-color: #fff3cd;
    border-left: 3px solid #ffc107;
}

.cell-content.status-red {
    background-color: #f8d7da;
    border-left: 3px solid #dc3545;
}

.cell-status {
    margin-bottom: 2px;
    text-align: center;
}

.cell-status .status-badge {
    padding: 3px 6px;
    font-size: 0.7em;
}

.cell-weather-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-bottom: 1px;
    padding: 1px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
}

.weather-icon {
    font-size: 3em;
    line-height: 1;
}

.weather-condition {
    font-size: calc(0.85em + 4pt);
    font-weight: 600;
    color: #2c3e50;
}

.cell-weather {
    display: flex;
    flex-direction: column;
    gap: 0px;
    margin-bottom: 1px;
    font-size: 0.8em;
}

.weather-item {
    padding: 0px;
}

.cell-reason,
.cell-warning,
.cell-recommendation,
.cell-ok {
    font-size: calc(0.75em + 2pt);
    padding: 1px 3px;
    margin-top: 1px;
    border-radius: 3px;
    line-height: 1.1;
    word-wrap: break-word;
}

.cell-reason {
    background-color: #f8f9fa;
    color: #721c24;
}

.cell-warning {
    background-color: #fff3cd;
    color: #856404;
}

.cell-recommendation {
    background-color: #d1ecf1;
    color: #0c5460;
}

.cell-ok {
    background-color: #d4edda;
    color: #155724;
}

.forecast-card {
    background: white;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #ddd;
    transition: transform 0.2s, box-shadow 0.2s;
}

.forecast-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.forecast-card.status-green {
    border-left-color: #28a745;
}

.forecast-card.status-yellow {
    border-left-color: #ffc107;
}

.forecast-card.status-red {
    border-left-color: #dc3545;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.75em;
    text-transform: uppercase;
}

.status-badge.green {
    background: #d4edda;
    color: #155724;
}

.status-badge.yellow {
    background: #fff3cd;
    color: #856404;
}

.status-badge.red {
    background: #f8d7da;
    color: #721c24;
}

.datetime {
    font-weight: 600;
    color: #555;
    font-size: 0.9em;
}

.card-body {
    display: grid;
    gap: 8px;
}

.weather-info {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 70px;
}

.info-item .label {
    font-size: 0.75em;
    color: #6c757d;
    margin-bottom: 2px;
}

.info-item .value {
    font-size: 1em;
    font-weight: 600;
    color: #2c3e50;
}

.reasons {
    background: #f8f9fa;
    padding: 8px;
    border-radius: 6px;
    margin-top: 5px;
    font-size: 0.85em;
}

.reasons strong {
    font-size: 0.9em;
}

.reasons ul {
    margin-left: 16px;
    margin-top: 5px;
}

.reasons li {
    margin: 2px 0;
    color: #555;
}

.warnings {
    background: #fff3cd;
    padding: 8px;
    border-radius: 6px;
    margin-top: 5px;
    border-left: 3px solid #ffc107;
    font-size: 0.85em;
}

.warnings strong {
    color: #856404;
    font-size: 0.9em;
}

.warnings ul {
    margin-left: 16px;
    margin-top: 5px;
}

.warnings li {
    margin: 2px 0;
    color: #856404;
}

.recommendations {
    background: #d1ecf1;
    padding: 8px;
    border-radius: 6px;
    margin-top: 5px;
    border-left: 3px solid #17a2b8;
    font-size: 0.85em;
}

.recommendations strong {
    color: #0c5460;
    font-size: 0.9em;
}

.recommendations ul {
    margin-left: 16px;
    margin-top: 5px;
}

.recommendations li {
    margin: 2px 0;
    color: #0c5460;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-size: 1.1em;
}

.legend {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #f0f0f0;
}

.legend h3 {
    margin-bottom: 8px;
    color: #2c3e50;
    font-size: 1em;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.85em;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #f0f0f0;
    text-align: center;
    color: #6c757d;
    font-size: 0.8em;
}

footer a {
    color: #667eea;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

footer p {
    margin: 5px 0;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 1.5em;
    }

    .input-group {
        grid-template-columns: 1fr;
    }

    #search-btn {
        grid-column: 1;
    }

    .forecast-list {
        grid-template-columns: 1fr;
    }

    .weather-info {
        flex-direction: column;
    }

    .forecast-table {
        font-size: 0.85em;
    }

    .forecast-table th,
    .forecast-table td {
        padding: 6px 4px;
    }
}
