﻿/*td.wrap-text {
    max-width: 100px;*/ /* กำหนดความกว้างเซลล์ */
/*   height: 100px;*/ /* กำหนดความสูงที่ต้องการ */
/*overflow: auto !important;*/ /* ให้เลื่อนในเซลล์ได้ */
/*white-space: normal !important;
    word-break: break-word !important;
}*/
.dataTable td.wrap-text {
    white-space: normal !important;
    word-break: break-word;
    max-width: 150px;
    line-height: 1.4;
}

.timer-box {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #f0f8ff;
    padding: 5px;
}

.timer-display {
    font-size: 24px;
    font-weight: bold;
    color: red;
    background-color: #e6f0fa;
    padding: 5px 10px;
}

.timer-button {
    background-color: black;
    color: white;
    border: none;
    padding: 5px 15px;
    font-weight: bold;
    cursor: pointer;
}

.checkbox-group-ann {
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.checkbox-box-ann {
    flex: 1; 
    min-height: 150px;
    border: 2px solid black;
    border-radius: 15px;
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 120px;
}

    .checkbox-box-ann label {
        display: flex;
        align-items: center;
        gap: 5px;
        margin: 5px 0;
    }

    .checkbox-box-ann input[type="checkbox"] {
        width: 20px;
        height: 20px;
        accent-color: black;
    }

/*.hazard-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
*/
/*.hazard-row {
    display: flex;
    flex-wrap: nowrap;*/ /* ห้าม wrap ใน row เดียวกัน */
/*gap: 10px;
}*/


.hazard-item {
    width: 110px;
    height: 110px;
    text-align: center;
    border: 1px solid #ccc;
    padding: 10px;
    cursor: pointer;
    color: gray;
}

    .hazard-item img {
        width: 40px;
        height: 40px;
        filter: grayscale(100%);
    }

    .hazard-item.active {
        border: 2px solid red;
        color: red;
    }

        .hazard-item.active img {
            filter: brightness(0) saturate(100%) invert(17%) sepia(97%) saturate(7336%) hue-rotate(357deg) brightness(100%) contrast(118%);
        }

.hazard-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* ให้ center เสมอ */
    gap: 10px;
}

.hazard-item {
    width: 110px;
    height: 110px;
    text-align: center;
    border: 1px solid #ccc;
    padding: 10px;
    cursor: pointer;
    color: gray;
    box-sizing: border-box;
    flex-shrink: 0; /* ไม่ให้ item ย่อขนาด */
}


#chaticon {
    position: fixed;
    bottom: 20px; /* ระยะห่างจากขอบล่าง */
    right: 20px; /* ระยะห่างจากขอบขวา */
    border-radius: 50%; /* ทำให้ปุ่มกลม */
    padding: 15px; /* ขนาดของปุ่ม */
    font-size: 20px; /* ขนาดตัวอักษร */
    background-color: #CA282C; /* สีพื้นหลัง */
    color: white; /* สีข้อความ */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* เงา */
    z-index: 9999;
}

    #chaticon i {
        color: white; /* กำหนดให้ไอคอนเป็นสีขาว */
        font-size: 40px;
    }

#chat-body {
    max-height: calc(100vh - 160px); /* ปรับตามขนาด header/footer */
    overflow-y: auto;
}

#chat-list {
    max-height: calc(100vh - 94px); /* ปรับตามขนาด header/footer */
    overflow-y: auto;
}

.chat-message {
    max-width: 75%;
    word-break: break-word;
    overflow-wrap: break-word;
}


/* Prevent From Padding after closing modal*/
body {
    padding-right: 0 !important;
}

#zone-container {
    width: 100%;
    height: 58vh;
}

    #zone-container img {
        width: 100%;
        height: 58vh;
    }

#news-container {
    width: 300px;
    height: 300px;
    overflow: hidden;
}

    #news-container img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.btn-red {
    background-color: #CA282C;
    border-color: #CA282C;
    color: white; /* Ensure text is readable */
}

    .btn-red:hover {
        background-color: #a6083d;
        border-color: #a6083d;
        color: white;
    }

/*.form-control{
    color:black;
}*/
.form-control:focus {
    border-color: #990033;
    box-shadow: 0 0 5px #990033;
}

.form-group {
    margin-bottom: 0.2rem;
}

.form-control[readonly], .form-control:disabled {
    background-color: lightgrey; /* Light gray background */
    cursor: not-allowed; /* Change the cursor to indicate the field is readonly */
}

.bootstrap-select > .dropdown-toggle.btn-light.disabled, .bootstrap-select > .dropdown-toggle.btn-light:disabled, .bootstrap-select > .dropdown-toggle.btn-secondary.disabled, .bootstrap-select > .dropdown-toggle.btn-secondary:disabled {
    background: lightgrey !important;
    opacity: 1;
}

.bootstrap-select .dropdown-menu.inner > li.active:not(.selected) > a {
    background: #f64c60
}

.card.card-custom > .card-header.bg-red {
    background-color: #CA282C;
}

.card.card-custom > .card-header {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -webkit-box-align: stretch;
    -ms-flex-align: stretch;
    align-items: stretch;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    min-height: 0px;
    height: 50px;
    padding-top: 0;
    padding-bottom: 0;
    background-color: #22aae3;
}



.card-body {
    background-color: #e7e4e4;
    padding-top: 0.7rem !important;
    padding-bottom: 0.7rem !important;
}

.bg-red {
    background-color: #CA282C;
    color: white;
}

.bg-white {
    background-color: white;
}

.dataTable-search thead th {
    background-color: #CA282C !important; /* Ensures priority over DataTables default */
    color: white; /* Text color for readability */
    cursor: pointer; /* Matches your JavaScript cursor setting */
    /*border: solid 0.1rem #d1d3e0;*/
    white-space: nowrap !important;
    overflow-x: hidden;
}

.dataTable-search tbody td {
    background-color: white !important;
    color: white;
    cursor: pointer;
    /*border: solid 0.1rem #d1d3e0;*/
    white-space: nowrap !important;
    overflow-x: hidden;
}

.dataTables_scrollHeadInner,
.dataTables_scrollHeadInner table {
    width: 100% !important;
}

.dataTables_wrapper {
    overflow-x: hidden; /* Prevents unnecessary horizontal scrolling */
}
/*dataTables_wrapper .dataTable th, .dataTables_wrapper .dataTable td {
    font-size: 1.3rem;
}*/
.table.table-head-custom thead tr, .table.table-head-custom thead th {
    color: white !important;
    font-size: 15px
    /*font-size: 1.3rem;
    font-weight: 600;*/
}

.dataTables_wrapper .dataTables_pager .dataTables_length .custom-select {
    padding-right: 20px;
    padding-left: 10px;
    font-size: 13px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 25px;
}

    .switch input {
        display: none;
    }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 25px;
}

    .slider::before {
        position: absolute;
        content: "";
        height: 19px;
        width: 19px;
        left: 3px;
        bottom: 3px;
        background-color: white;
        transition: 0.4s;
        border-radius: 50%;
    }

input:checked + .slider {
    background-color: #990033;
}

    input:checked + .slider::before {
        transform: translateX(24px);
    }

.switch input:checked ~ span:before, .switch input:empty ~ span:before {
    background-color: transparent;
}

.switch input:checked ~ span:after {
    opacity: 1;
    color: #ffffff;
    background-color: white;
}

.bootstrap-select.disabled, .bootstrap-select > .disabled {
    cursor: not-allowed;
}

:disabled {
    cursor: not-allowed;
}

/* Ensure dropdown-submenu is properly positioned */
.dropdown-submenu {
    position: relative;
}

    .dropdown-submenu .dropdown-menu {
        top: 0;
        left: 100%;
        margin-top: -1px;
        display: none;
    }

    /* When submenu is shown */
    .dropdown-submenu.show .dropdown-menu {
        display: block;
    }


@media (min-width: 991px) {

    .dropdown-submenu .dropdown-toggle::after {
        content: "";
        /*border-top: 0.3em solid;
    border-right: 0.3em solid transparent;*/
        border-top: 0.3em solid transparent;
        border-right: 0;
        border-bottom: 0.3em solid transparent;
        border-left: 0.3em solid;
        display: inline-block;
        position: absolute;
        right: 10px; /* Adjust spacing from the right */
        top: 50%;
        transform: translateY(-50%) translateX(100%);
    }
}
/* Mobile Fix: Stack submenus vertically */
@media (max-width: 991px) {
    .dropdown-submenu .dropdown-menu {
        position: relative;
        left: 0;
        top: 0;
        width: 100%;
    }

    .dropdown-submenu .dropdown-toggle::after {
        display: inline-block;
        margin-left: 0.255em;
        vertical-align: 0.255em;
        content: "";
        border-top: 0.3em solid;
        border-right: 0.3em solid transparent;
        border-bottom: 0;
        border-left: 0.3em solid transparent;
        position: absolute;
        right: 10px; /* Adjust spacing from the right */
        transform: translateY(100%);
    }
}

/* set selectpicker selected value bg */
.bootstrap-select .dropdown-menu.inner > li.selected > a {
    background: #c6cfd9;
}

/* set .error and modelerror*/
.error, .modelError, .error-message, .fv-plugins-message-container .fv-help-block {
    font-size: 1rem !important;
    font-weight: bold !important;
}

.datepicker tbody tr > td.day.today {
    position: relative;
    background-color: #e9e8e8 !important;
    color: #7E8299 !important;
}

.dropdown-item:hover {
    border-radius: 10px;
    background-color: #F64E60;
}

/*homepage design*/
.news-card {
    margin-bottom: 20px;
    transition: transform 0.3s;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    background-color: #fff;
    width: 100%;
    border: 1px solid #e0e0e0;
}

    .news-card:hover {
        transform: translateY(-5px);
    }

.news-card-image-container {
    width: 100%;
    height: 0;
    padding-bottom: 75%; /* Set aspect ratio */
    position: relative;
    overflow: hidden;
}

.news-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.news-card-content {
    padding: 15px;
    background-color: #fff;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.news-card-title {
    font-weight: bold;
    /*    padding-left : 10px;*/
    margin-bottom: 10px;
    color: #333;
    font-size: 1.2rem;
}

.news-date {
    color: #888;
    /*    padding-left: 10px;*/
    font-size: 0.85rem;
    display: flex;
    align-items: center;
}

    .news-date i {
        margin-right: 5px;
        color: #888;
    }

.news-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
}

    .news-card-link:hover {
        text-decoration: none;
        color: inherit;
    }

@media (max-width: 991px) {
    .news-card .row {
        display: flex;
        flex-wrap: wrap;
    }
}

@media (max-width: 767px) {
    .news-card-title {
        font-size: 1rem;
    }

    .news-card .row {
        flex-direction: column;
    }

    .news-card-image-container {
        padding-bottom: 56.25%; /* 16:9 ratio for mobile */
    }

    .news-card-image {
        border-radius: 8px 8px 0 0;
    }
}

.pagination .page-item .page-link {
    width: 40px;
    height: 40px;
    line-height: 38px;
    padding: 0;
    text-align: center;
    border: 1px solid #dee2e6;
    font-size: 16px;
    color: #007bff;
    background-color: white;
    margin: 0 2px;
    border-radius: 5px;
}

.pagination .page-item.active .page-link {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.pagination .page-item.disabled .page-link {
    color: #ccc;
    pointer-events: none;
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.custom-dropdown .dropdown-menu {
    min-width: 300px;
}

.custom-badge {
    position: absolute;
    top: -20px;
    left: -10px;
    background-color: #FFD700; /* สีเหลือง */
    color: black;
    font-weight: bold;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    z-index: 10;
    box-shadow: 0px 6px 10px rgba(0, 0, 0, 0.25);
}