* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: #f5f5f5;
}

.container {
    max-width: 100%;
    margin: 0;
    background-color: white;
    padding: 30px 40px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
}

.warning-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.box-left h1 {
    color: #2a7f8f;
    font-size: 28px;
    margin-bottom: 30px;
}

.box-left h2 {
    color: #2a7f8f;
    font-size: 28px;
    font-weight: 600;
}

.box-right {
    display: flex;
    align-items: center;
    gap: 30px;
}

.warnings {
    display: flex;
    gap: 20px;
}

.warning-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.warning-icon {
    font-size: 24px;
    border-radius: 4px;
    font-weight: bold;
    color: white;
    padding: 2px 8px;
}

.danger {
    background-color: #dc3545;
}

.alert {
    background-color: #ffc107;
    color: #000;
}

.danger-text {
    color: #dc3545;
    font-weight: 600;
}

.alert-text {
    color: #ffc107;
    font-weight: 600;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
}

.event-card {
    background: white;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    transition: 0.2s ease;
}

.event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
}

.profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 35px;
    height: 35px;
    background: #ddd;
    border-radius: 50%;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-info strong {
    font-size: 14px;
}

.meta {
    font-size: 12px;
    color: #666;
}

.menu {
    cursor: pointer;
}

.event-image {
    width: 100%;
    height: 200px;
    background: #eaeaea;
}

.event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.content {
    padding: 15px 12px;
}

.content h4 {
    font-size: 14px;
    margin-bottom: 10px;
}


.status {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
}

.status.safe {
    background: #d4f8d4;
    color: #1b7a1b;
}

.status.danger {
    background: #ffd6d6;
    color: #b30000;
}

.status.alert {
    background: #fff2cc;
    color: #996c00;
}

/* Status Badges for Report Details */
.status-badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    min-width: 110px;
}

.status-safe {
    background: #86efac;
    color: #065f46;
}

.status-danger {
    background: #fca5a5;
    color: #991b1b;
}

.status-unknown {
    background: #e5e7eb;
    color: #333;
}

/* Modal for report details */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #457d8a;
}

.modal-close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    line-height: 20px;
}

.modal-close:hover {
    color: #457d8a;
}

.detail-row {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.detail-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-label {
    font-weight: 600;
    color: #457d8a;
    margin-bottom: 5px;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.detail-value {
    color: #333;
    font-size: 14px;
    line-height: 1.6;
}

.report-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 600px;
    border-radius: 8px;
    margin-top: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.image-row {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.image-row.detail-row {
    border-bottom: none;
}


@media (max-width: 817px) {

    .container {
        padding: 25px 20px;
    }

    .warning-box {
        flex-direction: column;
        align-items: flex-start;
    }

    .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .event-image {
        height: 140px;
    }
}

/* ======= YOUR REQUEST: 540px ======= */
@media (max-width: 540px) {

    .box-right {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 15px;
    }

    .warnings {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .info-section {
        width: 100%;
    }

    .last-updated {
        text-align: left;
    }
}

@media (max-width: 425px) {

    .container {
        padding: 20px 15px;
    }

    .grid-container {
        grid-template-columns: 1fr;
    }

    .event-image {
        height: 200px;
    }

    .content h4 {
        font-size: 15px;
    }

}

/* Pagination info styled like user-water-level-data page */
.pagination-info {
    text-align: left;
    margin-bottom: 20px;
    padding: 12px 0;
    font-size: 13px;
    color: #666;
    border-bottom: 1px solid #e5e7eb;
    word-break: break-word;
}

.pagination-info p {
    margin: 0;
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    align-items: center;
    line-height: 1.6;
}

.pagination-info strong {
    color: #457d8a;
    font-weight: 600;
}

/* old button styles retained for legacy but not used on news page */
.pagination-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    background: white;
    color: #457d8a;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 40px;
}

.pagination-btn:hover:not(.disabled):not(.active) {
    border-color: #457d8a;
    background: #f0f9ff;
}

.pagination-btn.active {
    background: #457d8a;
    color: white;
    border-color: #457d8a;
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* new pagination styling matching user-water-level-data page */
.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.pagination {
    display: flex;
    gap: 8px;
    align-items: center;
}

.page-btn {
    background: white;
    border: 1px solid #e5e7eb;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    color: #333;
}

.page-btn:hover {
    background: #f3f4f6;
}

.page-btn.active {
    background: #457d8a;
    color: white;
    border-color: #457d8a;
}

.page-btn.disabled {
    background: #f3f4f6;
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
    border-color: #e5e7eb;
}

.page-btn:disabled {
    background: #f3f4f6;
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
    border-color: #e5e7eb;
}

.pagination a.page-btn {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.pagination a.page-btn:hover {
    background: #e8f1f3;
    border-color: #457d8a;
}

.pagination span {
    color: #999;
    padding: 0 5px;
}
