* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
}

/* Header Styles */
header {
    background: linear-gradient(to right, #1e5fa8, #2b7bc4);
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    width: 80px;
    height: 80px;
}

.header-text h1 {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 5px;
}

.header-text p {
    font-size: 12px;
    font-weight: normal;
}

.account-dropdown select {
    padding: 8px 15px;
    border-radius: 5px;
    border: none;
    background-color: white;
    color: #1e5fa8;
    font-weight: bold;
    cursor: pointer;
}

.account-dropdown select:hover {
    background-color: #f0f0f0;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 20px auto;
    background-color: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* Content */
.content {
    padding: 20px;
}

.content h2 {
    background-color: #5eb3d4;
    color: white;
    padding: 15px;
    text-align: center;
    margin-bottom: 0;
    font-size: 18px;
    font-weight: bold;
}

/* Flood Table */
.flood-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.flood-table th {
    background-color: #5eb3d4;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: bold;
    border: 1px solid #4da3c4;
}

.flood-table td {
    padding: 12px;
    border: 1px solid #ddd;
    vertical-align: top;
    font-size: 14px;
}

.flood-table tr:hover {
    background-color: #f9f9f9;
}

.state-header td {
    background-color: #b8b8b8;
    font-weight: bold;
    padding: 10px;
    color: #000;
    border: 1px solid #999;
}

.station-name {
    width: 25%;
}

.station-name a {
    color: #2b7bc4;
    text-decoration: none;
    font-weight: 500;
}

.station-name a:hover {
    text-decoration: underline;
}

/* Risk Level Colors - Matching the reference */
.safe {
    background-color: #c8e6c9 !important;
    color: #000;
}

.normal {
    background-color: #c8e6c9 !important;
    color: #000;
}

.alert {
    background-color: #fff9c4 !important;
    color: #000;
}

.warning {
    background-color: #fff9c4 !important;
    color: #000;
}

.danger {
    background-color: #fff9c4 !important;
    color: #000;
}

.rainfall-col {
    background-color: #ffe0b2 !important;
    color: #000;
}

/* Login.jsp Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e5fa8, #5eb3d4);
}

.login-box {
    background-color: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    width: 400px;
    text-align: center;
}

.login-logo {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
}

.login-box h2 {
    color: #1e5fa8;
    margin-bottom: 10px;
}

.login-box h3 {
    color: #666;
    margin-bottom: 30px;
    font-weight: normal;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: bold;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2b7bc4;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background-color: #2b7bc4;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
}

.btn-login:hover {
    background-color: #1e5fa8;
}

.error-message {
    background-color: #ffebee;
    color: #c62828;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid #c62828;
}

.login-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.login-footer a {
    color: #2b7bc4;
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

.success-message {
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid #2e7d32;
}

/* admin jsp design css */

/* Admin Dashboard Styles */
.admin-header {
    background-color: #1e5fa8;
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.admin-header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h2 {
    margin: 0;
    font-size: 24px;
}

.admin-header p {
    margin: 5px 0 0 0;
    font-size: 14px;
    opacity: 0.9;
}

.btn-logout {
    background-color: #ff6347;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
}

.btn-logout:hover {
    background-color: #e55347;
}

.admin-container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 80px);
}

.admin-sidebar {
    width: 250px;
    background-color: #2c3e50;
    padding: 20px 0;
}

.admin-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.admin-sidebar li {
    margin: 0;
}

.admin-sidebar a {
    display: block;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    border-left: 4px solid transparent;
}

.admin-sidebar a:hover {
    background-color: #34495e;
    border-left-color: #3498db;
}

.admin-sidebar a.active {
    background-color: #34495e;
    border-left-color: #3498db;
}

.admin-content {
    flex: 1;
    padding: 30px;
    background-color: #f5f5f5;
}

.admin-content h3 {
    color: #1e5fa8;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #1e5fa8;
}

/* Stats Cards */
.stats-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h4 {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 14px;
    font-weight: normal;
}

.stat-number {
    font-size: 36px;
    font-weight: bold;
    color: #1e5fa8;
    margin: 0;
}

.alert-card .stat-number {
    color: #ff6347;
}

/* Admin Table */
.admin-table {
    width: 100%;
    background-color: white;
    border-collapse: collapse;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.admin-table thead {
    background-color: #2b7bc4;
    color: white;
}

.admin-table th {
    padding: 12px;
    text-align: left;
    font-weight: bold;
}

.admin-table td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
}

.admin-table tbody tr:hover {
    background-color: #f5f5f5;
}

/* Badges */
.badge-bahaya {
    background-color: #ff6347;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.badge-amaran {
    background-color: #ffa500;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.badge-waspada {
    background-color: #ffd700;
    color: #333;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.badge-normal, .badge-safe {
    background-color: #90ee90;
    color: #333;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

/* officer add reading */

/* Form Styles */
.form-container {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    max-width: 900px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    color: #333;
    font-weight: bold;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-family: Arial, sans-serif;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2b7bc4;
    box-shadow: 0 0 5px rgba(43, 123, 196, 0.3);
}

.form-group textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn-primary {
    background-color: #2b7bc4;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-primary:hover {
    background-color: #1e5fa8;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* Officer add reading */
/* Action Buttons */
.btn-edit {
    background-color: #28a745;
    color: white;
    padding: 6px 12px;
    text-decoration: none;
    border-radius: 3px;
    font-size: 12px;
    display: inline-block;
    margin-right: 5px;
}

.btn-edit:hover {
    background-color: #218838;
}

.btn-delete {
    background-color: #dc3545;
    color: white;
    padding: 6px 12px;
    text-decoration: none;
    border-radius: 3px;
    font-size: 12px;
    display: inline-block;
}

.btn-delete:hover {
    background-color: #c82333;
}

.admin-table td {
    vertical-align: middle;
}


/* Status Badges */
.badge-active {
    background-color: #28a745;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.badge-inactive {
    background-color: #6c757d;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

/* Filter Styles */
.filter-container {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.filter-form {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.filter-group label {
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 14px;
    color: #333;
}

.filter-group select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.btn-filter {
    background-color: #2b7bc4;
    color: white;
    padding: 8px 20px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    height: 38px;
}

.btn-filter:hover {
    background-color: #1e5fa8;
}

.btn-reset {
    background-color: #6c757d;
    color: white;
    padding: 8px 20px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    height: 38px;
    line-height: 22px;
}

.btn-reset:hover {
    background-color: #5a6268;
}

/* Subscription Badges */
.badge-subscribed {
    background-color: #28a745;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.badge-unsubscribed {
    background-color: #dc3545;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

/* user subs */

/* Subscription Card */
.subscription-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 10px;
    margin: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.subscription-info h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
}

.subscription-info p {
    margin: 5px 0;
    font-size: 14px;
}

.subscription-action {
    text-align: center;
}

.btn-subscribe {
    background-color: #28a745;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.btn-subscribe:hover {
    background-color: #218838;
}

.btn-unsubscribe {
    background-color: #dc3545;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.btn-unsubscribe:hover {
    background-color: #c82333;
}

.dashboard-header {
    background-color: #2b7bc4;
    color: white;
    padding: 20px;
    margin: 20px;
    border-radius: 8px;
}

.dashboard-header h2 {
    margin: 0 0 5px 0;
}

.dashboard-header p {
    margin: 0;
    opacity: 0.9;
}

/* Alert Preview */
.alert-preview {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.alert-preview h4 {
    margin: 0 0 15px 0;
    color: #dc3545;
    font-size: 18px;
}

/* View All Button */
.btn-view-all {
    background-color: #2b7bc4;
    color: white;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    display: inline-block;
}

.btn-view-all:hover {
    background-color: #1e5fa8;
}

.btn-back {
    background-color: #6c757d;
    color: white;
    padding: 8px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    display: inline-block;
    margin-top: 10px;
}

.btn-back:hover {
    background-color: #5a6268;
}