/* === GLOBAL BACKGROUND === */
body {
    background: url('/static/images/background.jpg') no-repeat center center fixed;
    background-size: cover;
    color: #333;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    position: relative;
}

/* Readability overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.88);
    z-index: -1;
}

/* Header */
.header-container {
    background: linear-gradient(135deg, #1E5E4E, #2E7D32);
    color: white;
    padding: 20px 30px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.hamburger-menu {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    width: 30px;
    height: 30px;
    justify-content: space-between;
}

.hamburger-menu span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-menu:hover span {
    background-color: #e0e0e0;
}

.header-container h1 {
    font-size: 1.5rem;
    margin: 0;
    flex-grow: 1;
}

/* Mobile Sidebar */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -250px;
    width: 250px;
    height: 100vh;
    background: #2E7D32;
    color: white;
    padding: 20px 0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
    z-index: 1001;
    transition: left 0.3s ease;
}

.mobile-sidebar.active {
    left: 0;
}

.close-mobile-menu {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.overlay.active {
    display: block;
}

/* App Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    position: relative;
    margin-top: 80px;
}

/* Desktop Sidebar */
.sidebar {
    width: 250px;
    background: rgba(46,125,50,0.95);
    color: white;
    padding: 20px 0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 80px;
    /* align to left edge of centered .app-layout (1200px wide) */
    left: calc(50% - 600px);
    height: calc(100vh - 80px - 90px);
    overflow-y: auto;
    z-index: 50;
    will-change: transform;
}
.menu-header {
    background: #1E5E4E;
    padding: 15px 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.nav-btn {
    width: 100%;
    padding: 15px 20px;
    background: transparent;
    color: white;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    position: relative;
}
.nav-btn:hover {
    background: rgba(255,255,255,0.1);
}
.nav-btn.active {
    background: #1E5E4E;
    font-weight: 600;
}
.nav-btn svg {
    width: 20px;
    height: 20px;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 20px;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    min-height: calc(100vh - 80px);
    margin-left: 250px; /* leave space for fixed sidebar */
    width: calc(100% - 250px);
    padding-bottom: 100px;
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 20px;
    animation: fadeIn 0.3s ease-in-out;
}
.tab-content.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === PREDICTION LAYOUT === */
.prediction-layout {
    display: flex;
    gap: 30px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.upload-section { flex: 1; min-width: 300px; }
.results-section { flex: 1; min-width: 300px; display: flex; flex-direction: column; gap: 20px; }

.upload-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    text-align: center;
    transition: transform 0.2s ease;
}
.upload-card:hover { transform: translateY(-3px); }

/* Location Selection */
.location-selection {
    margin-bottom: 15px;
    text-align: left;
}

.location-selection label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2E7D32;
}

.location-dropdown {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    background-color: white;
    cursor: pointer;
}

.location-dropdown:focus {
    outline: none;
    border-color: #2E7D32;
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.2);
}

/* Upload Button */
.upload-button {
    width: 100%;
    padding: 12px;
    background: #1E5E4E;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
    margin-bottom: 15px;
}
.upload-button:hover { background: #2E7D32; }

/* Preview Container */
.preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    max-width: 100%;
    overflow: hidden;
}
.preview-container img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 10px 0;
}
.preview-container .filename {
    font-size: 0.9rem;
    color: #666;
    margin-top: 10px;
    text-align: center;
    word-break: break-all;
}

.analyze-btn {
    width: 100%;
    padding: 12px;
    background: #1E5E4E;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
    margin-top: 10px;
}
.analyze-btn:hover { background: #2E7D32; }
.analyze-btn:disabled { background: #999; cursor: not-allowed; }

/* Top Predictions */
.top-predictions {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: none;
}
.top-predictions h3 {
    margin-bottom: 15px;
    color: #1E5E4E;
    text-align: center;
    font-size: 1.1rem;
}

.prediction-cards {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.prediction-card {
    flex: 1;
    min-width: 120px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.prediction-card.high {
    border-left: 5px solid #4CAF50;
    background: #e8f5e8;
}
.prediction-card.medium {
    border-left: 5px solid #FFC107;
    background: #fff3e0;
}
.prediction-card.low {
    border-left: 5px solid #F44336;
    background: #ffebee;
}
.prediction-card h4 {
    margin: 5px 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
}
.prediction-card p {
    font-size: 1.1rem;
    font-weight: bold;
    margin: 5px 0;
    line-height: 1.2;
}

/* Diagnosis Result */
.diagnosis-result {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: none;
    border-left: 5px solid #1E5E4E;
}
.diagnosis-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}
.diagnosis-header h3 {
    color: #1E5E4E;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}
.diagnosis-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #555;
    max-height: 150px;
    overflow-y: auto;
    padding-right: 10px;
}
.diagnosis-text::-webkit-scrollbar {
    width: 6px;
}
.diagnosis-text::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}
.diagnosis-text::-webkit-scrollbar-track {
    background: #f5f5f5;
}

#readMoreBtn {
    margin-top: 10px;
    padding: 6px 12px;
    background: #e0f7e0;
    border: 1px solid #a8d5a8;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #2E7D32;
    font-weight: 600;
}

/* Loading state styling */
.loading-state {
    text-align: center;
    padding: 30px;
    color: #1E5E4E;
}

.loading-state .progress-container {
    width: 90%;
    max-width: 300px;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    margin: 0 auto 15px;
    overflow: hidden;
}

.loading-state .progress-bar {
    width: 0%;
    height: 100%;
    background: #4CAF50;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.loading-state .loading-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.loading-state .loading-message svg {
    width: 24px;
    height: 24px;
    fill: #2E7D32;
}

.loading-state .loading-text {
    margin: 0;
    font-weight: 500;
}

.loading-state .additional-info {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
    line-height: 1.4;
    margin-top: 10px;
}

/* === DASHBOARD STYLES === */
.dashboard-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.dashboard-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.2s ease;
}

.dashboard-card:hover {
    transform: translateY(-3px);
}

.dashboard-card h3 {
    color: #1E5E4E;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2rem;
    border-bottom: 2px solid #e8f5e8;
    padding-bottom: 10px;
}

/* Dashboard Filter */
.dashboard-filter {
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.dashboard-filter label {
    font-weight: 600;
    color: #1E5E4E;
}

.dashboard-filter input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    color: #333;
}

.filter-btn, .reset-btn {
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.filter-btn {
    background: #1E5E4E;
    color: white;
    border: none;
}
.filter-btn:hover { background: #2E7D32; }

.reset-btn {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}
.reset-btn:hover { background: #e0e0e0; }

/* Stats Container */
.stats-container {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    margin: 10px;
    flex: 1;
    min-width: 80px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #2E7D32;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
}

/* Top Affected Plot Styles */
.top-affected-plot {
    padding: 15px 0;
}

.affected-plot-info {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.plot-highlight {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    border-radius: 10px;
    min-width: 100px;
    border-left: 4px solid #F44336;
}

.plot-label-large {
    font-size: 1.8rem;
    font-weight: bold;
    color: #C62828;
    margin-bottom: 5px;
}

.plot-status {
    font-size: 0.85rem;
    padding: 5px 10px;
    background: rgba(244, 67, 54, 0.2);
    border-radius: 5px;
    font-weight: 600;
}

.affected-plot-details {
    flex: 1;
}

.affected-plot-details p {
    margin: 8px 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.affected-plot-details strong {
    color: #1E5E4E;
}

/* Activity List */
.activity-list {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-time {
    font-size: 0.8rem;
    color: #999;
}

.activity-result {
    font-weight: bold;
    margin-top: 5px;
}

/* Risk Assessment */
.risk-info {
    line-height: 1.6;
}

.risk-high {
    color: #F44336;
    font-weight: bold;
}

.risk-medium {
    color: #FF9800;
    font-weight: bold;
}

.risk-low {
    color: #4CAF50;
    font-weight: bold;
}

/* Map Container */
.map-container {
    position: relative;
    background: #f5f5f5;
    border: 1px solid #ddd;
    height: 500px;
}

/* Location Stats */
.location-stats {
    margin-top: 20px;
}

.plot-list {
    max-height: 200px;
    overflow-y: auto;
}

.plot-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
}

.plot-name {
    font-weight: bold;
}

.plot-disease {
    color: #2E7D32;
    font-weight: bold;
}

.plot-count {
    background: #e8f5e8;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
}

/* Map Marker Styles */
.marker-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    color: white;
    cursor: pointer;
}

.marker-icon.healthy {
    background: #4CAF50;
}

.marker-icon.leaf-blight {
    background: #FFC107;
}

.marker-icon.sundapteryx-bigutulla {
    background: #F44336;
}

.marker-icon.tungau {
    background: #2196F3;
}

.marker-icon.other {
    background: #9C27B0;
}

/* === DISEASE DATABASE === */
.disease-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.disease-card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    cursor: pointer;
}
.disease-card:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.disease-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}
.disease-card h3 { margin-bottom: 10px; color: #2E7D32; }
.disease-card p { font-size: 0.9rem; color: #666; line-height: 1.4; }

/* === HISTORY === */
.history-table {
    max-height: 340px;
    overflow-y: auto;
    padding: 8px 0;
}
.history-table.expanded {
    max-height: 800px;
}

/* custom thin scrollbar */
.history-table::-webkit-scrollbar {
    width: 10px;
}
.history-table::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 8px;
}
.history-table::-webkit-scrollbar-thumb {
    background: rgba(46,125,50,0.35);
    border-radius: 8px;
}
.history-table::-webkit-scrollbar-thumb:hover {
    background: rgba(46,125,50,0.6);
}

#toggleHistoryBtn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.15s ease;
    background: #4CAF50;
    color: white;
}
#toggleHistoryBtn:hover { background: #43A047; }
.history-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.history-table th, .history-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}
.history-table th { background: #f5f5f5; font-weight: 600; }

.chart-container {
    margin-top: 20px;
    height: 450px;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.history-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}
#downloadBtn, #clearBtn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    min-width: 150px;
    text-align: center;
}
#downloadBtn { background: #2196F3; color: white; }
#downloadBtn:hover { background: #1976D2; }
#clearBtn { background: #F44336; color: white; }
#clearBtn:hover { background: #D32F2F; }

/* === ABOUT PAGE STYLES === */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Developer Profile Styles */
.profile-card {
    display: flex;
    align-items: center;
    gap: 25px;
    padding: 15px 0;
    flex-wrap: wrap;
}

.profile-image {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #2E7D32;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.profile-info {
    flex: 1;
    min-width: 250px;
}

.profile-info h4 {
    margin: 0 0 5px 0;
    color: #1E5E4E;
    font-size: 1.4rem;
    font-weight: 700;
}

.profile-role {
    color: #555;
    margin: 0 0 15px 0;
    font-size: 1rem;
    font-weight: 500;
}

.profile-details p {
    margin: 5px 0;
    font-size: 0.95rem;
    color: #444;
}

.profile-links {
    display: flex;
    gap: 12px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.profile-link {
    text-decoration: none;
    color: #2E7D32;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #e8f5e8;
    border-radius: 20px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.profile-link:hover {
    background: #2E7D32;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(46, 125, 50, 0.2);
}

@media (max-width: 600px) {
    .profile-card {
        flex-direction: column;
        text-align: center;
    }
    .profile-links {
        justify-content: center;
    }
}

.expandable-section {
    background: white;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
}

.expandable-header {
    padding: 15px 20px;
    background: #f5f5f5;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
}

.expandable-header:hover {
    background: #e8f5e8;
}

.expandable-header h3 {
    margin: 0;
    color: #1E5E4E;
    font-size: 1.1rem;
    font-weight: 600;
}

.expandable-icon {
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.expandable-icon.expanded {
    transform: rotate(180deg);
}

.expandable-content {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.expandable-content.expanded {
    max-height: 1000px; /* Adjust as needed */
    padding: 20px;
}

.popup-trigger {
    background: #2E7D32;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
    font-size: 0.9rem;
}

.popup-trigger:hover {
    background: #1E5E4E;
}

/* Popup modal for detailed view */
.popup-modal {
    display: none;
    position: fixed;
    z-index: 1002; /* Higher than main modal */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.popup-modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    position: relative;
    max-height: 85vh;
    overflow-y: auto;
}

.popup-modal-content h3 {
    color: #1E5E4E;
    margin-top: 0;
    border-bottom: 2px solid #e8f5e8;
    padding-bottom: 10px;
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    background: none;
    border: none;
}

.popup-close:hover {
    color: #333;
}

.popup-content {
    line-height: 1.6;
    font-size: 1rem;
}

/* Performance table in popup */
.popup-performance-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    background: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
}

.popup-performance-table th,
.popup-performance-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.popup-performance-table th {
    background: #e8f5e8;
    font-weight: 600;
}

.popup-performance-table tr:last-child td {
    border-bottom: none;
}

/* Lists in popup */
.popup-list {
    padding-left: 20px;
    margin: 15px 0;
}

.popup-list li {
    margin-bottom: 8px;
    line-height: 1.5;
}

/* === MODAL (SCROLLABLE!) === */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}
.modal-content {
    background: white;
    margin: 10% auto;
    padding: 20px;
    border-radius:10px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}
.modal-content::-webkit-scrollbar {
    width: 8px;
}
.modal-content::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 10px;
}
.modal-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}
.modal-content::-webkit-scrollbar-thumb:hover {
    background: #999;
}
.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.close:hover { color: #333; }

/* Footer */
footer {
    text-align: center;
    padding: 15px;
    color: #777;
    border-top: 1px solid #ddd;
    background: white;
    position: sticky;
    bottom: 0;
    width: 100%;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    z-index: 100;
}

footer p {
    margin: 5px 0;
    font-size: 0.9rem;
}

/* Utility classes */
.desktop-only {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .hamburger-menu {
        display: flex;
    }
    
    .desktop-only {
        display: none;
    }
    
    .header-container h1 {
        font-size: 1.2rem;
    }
    
    .app-layout {
        flex-direction: column;
        padding: 0 10px;
    }
    
    .main-content {
        margin-left: 0;
        padding: 15px;
    }
    
    .prediction-layout {
        flex-direction: column;
    }
    
    .preview-container img {
        max-height: 200px;
    }
    
    .history-actions {
        flex-direction: column;
    }
    
    #downloadBtn, #clearBtn {
        min-width: auto;
    }
    
    .prediction-card {
        min-width: 100px;
    }
    
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
    
    .popup-modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
    
    .expandable-header {
        padding: 12px 15px;
    }
    
    .expandable-content {
        padding: 0 15px;
    }
    
    .expandable-content.expanded {
        padding: 15px;
    }
}

/* History filename link (clickable preview) */
.history-filename {
    color: #1E5E4E;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.history-filename:hover {
    color: #2E7D32;
    text-decoration: underline;
}

/* Modal image preview styling */
.modal-content img {
    display: block;
    margin: 12px auto 0 auto;
    max-width: 100%;
    max-height: 60vh;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

/* Plot list metadata (reports count and top-percent) */
.plot-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
}
.plot-item .plot-name {
    font-weight: 700;
    color: #333;
}
.plot-item .plot-disease {
    color: #666;
    margin-left: 0;
}
.plot-item .plot-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 0.9rem;
    color: #777;
}
.plot-item .plot-percent {
    background: #f1f8f1;
    color: #2E7D32;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 700;
}
.plot-item .plot-count {
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 12px;
}

/* Download and Open buttons in modal */
.download-btn, .open-btn {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}
.download-btn {
    background: #2E7D32;
}
.download-btn:hover { background: #1E5E4E; }
.open-btn {
    background: #1976D2;
}
.open-btn:hover { background: #115293; }

/* === PLOT GRID MAP STYLES === */
.plot-map-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

#plotGridMap {
    flex: 1;
    min-width: 400px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.plot-grid-legend {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    min-width: 150px;
    flex: 0 1 auto;
}

.plot-grid-legend h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #1E5E4E;
    border-bottom: 2px solid #e8f5e8;
    padding-bottom: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: 1px solid #ddd;
}

.plot-stats-summary {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.stat-box {
    flex: 1;
    min-width: 80px;
    text-align: center;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid #2E7D32;
}

.stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    color: #2E7D32;
    margin-bottom: 5px;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    font-weight: 600;
}

/* Plot label styles */
.plot-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: white;
    border-radius: 50%;
    border: 2px solid #1E5E4E;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.plot-number {
    font-weight: bold;
    color: #1E5E4E;
    font-size: 0.8rem;
    text-align: center;
}

/* Plot popup styles */
.plot-popup {
    font-size: 0.9rem;
    line-height: 1.5;
}

.plot-popup strong {
    color: #1E5E4E;
    display: block;
    margin-bottom: 5px;
}

/* Responsive for plot map */
@media (max-width: 768px) {
    .plot-map-container {
        flex-direction: column;
    }
    
    #plotGridMap {
        min-width: auto;
        height: 500px !important;
    }
    
    .plot-grid-legend {
        min-width: auto;
        display: flex;
        gap: 15px;
        flex-wrap: wrap;
    }
    
    .plot-grid-legend h3 {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .legend-item {
        flex: 1;
        min-width: 100px;
    }
}