* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Prompt', Arial, sans-serif;
    background-color: #ffffff;
    color: #333;
    line-height: 1.6;
}

.header {
    background: #1e5631;
    padding: 25px 0;
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

 .header-content {
     max-width: 1200px;
     margin: 0 auto;
     display: flex;
     align-items: center;
     gap: 25px;
     padding: 0 20px;
     justify-content: space-between;
     flex-wrap: nowrap; /* เพิ่มบรรทัดนี้ */
 }

 .title-section {
     flex: 1;
     min-width: 0;
 }

.logo {
    width: 90px;
    height: 90px;
    flex-shrink: 0;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.logo img {
    width: 70px;
    height: 70px;
    object-fit: contain;
}

.title-section h1 {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.4;
    color: white;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.nav-section {
    background: rgba(30, 86, 49, 0.95);
    padding: 20px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: white;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

.nav-top {
    background: rgba(255,255,255,0.1);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    position: relative;
}

.date-info {
    font-size: 16px;
    font-weight: 500;
    text-align: center;
}

.login-btn {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.login-btn:hover {
    background: rgba(255,255,255,0.3);
}

.controls-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 30px;
    align-items: center;
}

.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    align-items: center;
}

.control-select {
    background: rgba(255,255,255,0.95);
    border: 2px solid rgba(255,255,255,0.5);
    color: #333;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Prompt', sans-serif;
}

.search-btn {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    border: none;
    color: white;
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    cursor: pointer;
    font-size: 14px;
    font-family: 'Prompt', sans-serif;
}

.search-btn:hover {
    background: linear-gradient(135deg, #45a049 0%, #388e3c 100%);
}

.view-options {
    display: flex;
    gap: 25px;
    background: rgba(255,255,255,0.1);
    padding: 15px 20px;
    border-radius: 12px;
    align-items: center;
}

.view-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: white;
}

.icon-svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.icon-label {
    font-size: 12px;
    text-align: center;
}

.main-content {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 350px 1fr;
    grid-template-rows: auto auto;
    gap: 20px;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    grid-column: 1;
    grid-row: 1 / 3;
}

.map-container {
    grid-column: 2;
    grid-row: 1 / 3;
    height: 710px;
    background: white;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e0e0e0;
}

.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border: 2px solid #333;
}

.card-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
}

.card-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.food-icon {
    fill: #333;
}

.card h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    margin: 0;
}

.emergency-list {
    list-style: none;
}

.emergency-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 14px;
    color: #333;
}

.emergency-btn {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    font-size: 11px;
    min-width: 60px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
    transition: all 0.2s ease;
    font-family: 'Prompt', sans-serif;
}

.emergency-btn:hover {
    background: linear-gradient(135deg, #c82333 0%, #a71e2a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.sad-icon {
    width: 14px;
    height: 14px;
    fill: white;
}

.salt-text {
    font-size: 8px;
    opacity: 0.9;
}

.more-link {
    text-align: center;
    margin-top: 15px;
}

.more-link a {
    color: #007bff;
    text-decoration: underline;
    font-size: 14px;
}

.chart-card h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 16px;
    text-align: center;
    font-weight: 600;
}

.chart-container {
    height: 200px;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
}

.chart-bg {
    position: absolute;
    width: 100%;
    height: 100%;
}

.chart-red {
    background-color: #dc3545;
    height: 40%;
    top: 0;
}

.chart-yellow {
    background-color: #ffc107;
    height: 30%;
    top: 40%;
}

.chart-green {
    background-color: #28a745;
    height: 30%;
    top: 70%;
}

.chart-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
}

.chart-point {
    position: absolute;
    width: 16px;
    height: 16px;
    background-color: #333;
    border: 3px solid white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.point1 { left: 20%; top: 85%; }
.point2 { left: 50%; top: 65%; }
.point3 { left: 80%; top: 45%; }

.chart-line svg {
    width: 100%;
    height: 100%;
}

.chart-labels {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.map-header {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.map-title {
    color: #333;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
}

.legend {
    display: flex;
    gap: 30px;
    font-size: 14px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 2px;
    border: 1px solid #ccc;
}

.red { background-color: #dc3545; }
.yellow { background-color: #ffc107; }
.green { background-color: #28a745; }

#map {
    width: 100%;
    height: 500px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    background-color: #f8f9fa;
}

.full-list-section {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.full-list-card {
    background: white;
    border-radius: 8px;
    padding: 30px;
    border: 2px solid #333;
    position: relative;
}

.full-list-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
}

.full-list-title {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.full-list-icon {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    margin-top: 5px;
}

.title-text h2 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0 0 5px 0;
    line-height: 1.3;
}

.title-text .count {
    font-size: 16px;
    color: #666;
    font-weight: 400;
}

.export-btn {
    background: linear-gradient(135deg, #1e5631 0%, #2d7d32 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    font-family: 'Prompt', sans-serif;
    text-decoration: none;
    display: inline-block;
}

.export-btn:hover {
    background: linear-gradient(135deg, #0f2819 0%, #1e5631 100%);
}

.food-table {
    width: 100%;
    border-collapse: collapse;
}

.food-table th {
    background-color: #f8f9fa;
    color: #333;
    font-weight: 600;
    padding: 15px 12px;
    text-align: left;
    border-bottom: 2px solid #333;
    font-size: 14px;
}

.food-table td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
    color: #333;
    vertical-align: middle;
}

.food-table tr:hover {
    background-color: #f8f9fa;
}

.rank-col { width: 10%; text-align: center; font-weight: 600; }
.food-col { width: 60%; }
.level-col { width: 30%; text-align: center; }

.level-badge {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 80px;
    justify-content: center;
}
.level-badge2 {
    background: linear-gradient(135deg, #F0E002 0%, #DECF02 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 80px;
    justify-content: center;
}
.level-badge3 {
    background: linear-gradient(135deg, #18E002 0%, #16BD04 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 80px;
    justify-content: center;
}

.level-icon {
    width: 14px;
    height: 14px;
    fill: white;
}

.salt-unit {
    font-size: 11px;
    opacity: 0.9;
}

.pagination {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.pagination a {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
}

.pagination a:hover {
    background-color: #f8f9fa;
}

.pagination a.active {
    background-color: #1e5631;
    color: white;
    border-color: #1e5631;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .sidebar {
        grid-column: 1;
        grid-row: 1;
    }

    .map-container {
        grid-column: 1;
        grid-row: 2;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .controls-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .controls {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .view-options {
        justify-content: center;
    }

    .food-table {
        font-size: 11px;
    }

    .rank-col { width: 15%; }
    .food-col { width: 55%; }
    .level-col { width: 30%; }
}

@media (max-width: 768px) {
    .legend {
        flex-direction: column;
        gap: 8px;
    }

    .map-container {
        height: auto;
    }

    #map {
        height: 400px;
    }

    .controls {
        grid-template-columns: 1fr;
    }

    .control-select {
        width: 100%;
    }

    .login-btn {
        position: static;
        margin-top: 10px;
        text-align: center;
    }

    .nav-top {
        text-align: center;
    }
}
