
.login-box-body {   
    /*padding-bottom: 20px!important;*/ 
    border-radius: 10px!important;     
    background: rgba(255, 255, 255, 0.6)!important;  
    /*box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);*/
}

.login-logo {
    text-shadow: #fff 2px 2px 3px;
    /*text-shadow:4px 4px 2px rgba(150, 150, 150, 1);*/
}

.loading-image {       
    background-image: url("../img/19052568-blur.jpg");
}

.progressive-image {
    height: 100vh;      
    opacity: 0.6;
    z-index: -1;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
}

.progressive-image div {
    height: 100vh;       
    /*opacity: 0.5;*/
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;  
    z-index: -1;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
}

.progressive-image .loading-image {
    filter: blur(5px);
}

.progressive-image .overlay {
    position: absolute;
    top: 0;
    opacity: 0;
    transition: opacity 200ms ease-in;        
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    background: #fff url("../img/search.png") right 10px top 7px no-repeat;
}

/* === ส่วนจาก main-login.php === */

body {
    font-family: 'Source Sans Pro', sans-serif;
}

.left-section {
    font-family: 'Source Sans Pro', sans-serif;
    line-height: 1.6;
    color: #333;
}

.left-section h5 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.left-section .card-link {
    font-size: 0.8rem;
    display: block;
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: #ffffff;
    border-left: 4px solid #007bff;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.2s ease-in-out;
}

.left-section .card-link:hover {
    background-color: #f8f9fa;
    transform: translateX(4px);
}

.form-group {
    width: 100%;
}

.form-control {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
}

.invalid-feedback, .help-block {
    text-align: left !important;
    display: block;
    width: 100%;
    padding-left: 0;
    margin-left: 0;
}

/* Fix validation icon position on focus (conflict with Material Dashboard focus animation) */
/* Round 2: Using more specific selectors and multiple background positions */
.form-control.is-invalid, 
.form-control.is-invalid:focus,
.form-group.is-focused .form-control.is-invalid {
    /* Lock position for the first background image (the icon) */
    /* and explicitly handle multiple backgrounds if the theme adds them on focus */
    background-position: right calc(0.375em + 0.1875rem) center, center bottom, center bottom !important;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem), 100% 2px, 100% 1px !important;
}

/* Ensure padding is sufficient for the icon even when focused */
.form-group.is-focused .form-control.is-invalid {
    padding-right: calc(1.5em + 0.75rem) !important;
}

.login-box-body .transbox {
    padding-top: 0px;
}

.login-logo {
    text-shadow: #c1deb9 2px 2px 3px;
    font-size: 15px;
}

div.transbox {
    padding: 5rem 10rem;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.3);
    padding-top: 15px;
    padding-right: 15px;
    padding-left: 15px;
}

/* === ส่วนที่ทำให้เป็นกล่อง login ที่มีสีขาวใส === */

.login-container-glass {
    width: 100%;
    max-width: 1000px;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.3); /* เพิ่มความหรู */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    /* backdrop-filter / position / z-index ไม่จำเป็น */
}

/* ส่วนที่เหมือนกัน */
.glass-left,
.glass-right {
    flex: 1;
    min-width: 300px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ส่วนเฉพาะของ glass-left */
.glass-left {
    background: rgba(245, 245, 245, 0.5);  /* #f5f5f5 โปร่งใส */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* ส่วนเฉพาะของ glass-right */
.glass-right {
    background: rgba(255, 255, 255, 0.3);
}
 
/* Custom styles for ThaiD login button */
.btn-thaid-custom {
    background-color: #03064f !important; /* สีพื้นหลังที่ต้องการ */
    color: #ffffff !important;           /* สีตัวอักษร (สีขาวเพื่อให้ตัดกับพื้นหลังเข้ม) */
    border-color: #03064f !important;     /* สีเส้นขอบ */
}

/* Optional: Styles for hover, focus, active states */
.btn-thaid-custom:hover,
.btn-thaid-custom:focus,
.btn-thaid-custom:active {
    background-color: #02043a !important; /* สีพื้นหลังเมื่อ hover (เข้มขึ้นเล็กน้อย) */
    color: #ffffff !important;
    border-color: #02043a !important;     /* สีเส้นขอบเมื่อ hover */
}

/* === ส่วนสำหรับตารางแสดงรายละเอียดแบบกำหนดเองใน view.php === */

.detail-custom-table {
    border: none;
}

.detail-custom-table td,
.detail-custom-table th {
    border: none !important;
    padding: 0 !important;
}

/* ใส่สีเฉพาะ text ของ label */
.detail-custom-table th {
    color: #2f684e; /* สีเขียวพาสเทลอ่อน */
    font-weight: 600;
}

/* ระยะระหว่าง label กับ value */
.detail-custom-table tr + tr td {
    padding-top: 4px !important;
}

/* ระยะห่างระหว่างแต่ละ attribute */
.detail-custom-table tr:nth-child(even) td {
    padding-bottom: 32px !important;
}

/* === ส่วนสำหรับ card ที่มีการจัดเรียงแบบคอลัมภ์ โดยทำให้กล่องเรียงต่อเนื่องแบบแนวตั้ง waterfall === */

.card-container {
    column-count: 2;
    column-gap: 1.5rem;
}

@media screen and (max-width: 768px) {
    .card-container {
        column-count: 1 !important;
    }
}

.card-box {
    break-inside: avoid;
    margin-bottom: 0.75rem;
    width: 100%; /* เพิ่มความชัดเจน */
    display: inline-block; /* ให้ column ทำงานถูกต้อง */
}

/* === ส่วนสำหรับการแสดงผล Mermaid diagram ใน modal === */

#workflowModal .modal-body {
    /* กำหนดความสูงสูงสุดของส่วนเนื้อหา Modal ไม่ให้เกิน 75% ของความสูงหน้าจอ */
    max-height: 75vh;
    /* เพิ่ม Scrollbar แนวตั้งเมื่อเนื้อหาล้นออกไป */
    overflow-y: auto;
}
/* เพิ่ม Scrollbar แนวนอนสำหรับตัวกราฟเอง ในกรณีที่กราฟกว้างเกินไป */
#workflowModal .mermaid-container {
    position: relative;
    min-height: 200px; /* ให้มีพื้นที่สำหรับ loader */
    overflow-x: auto;
}

/* ซ่อนโค้ด Mermaid เริ่มต้นเพื่อป้องกันการกระพริบ (FOUC) */
#workflowModal .mermaid {
    opacity: 0;
    transition: opacity 0.4s ease-in;
}

/* แสดงกราฟเมื่อ render เสร็จแล้ว */
#workflowModal .mermaid.visible {
    opacity: 1;
}

/* สไตล์สำหรับตัวโหลด */
#workflowModal .mermaid-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease-out;
}

#workflowModal .mermaid-loader.hidden {
    display: none;
}