/* Import Font ที่สวยและหนาขึ้น */
@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@400;600;700;800&display=swap');

:root {
  --wrd-sidebar-width: 250px;
  --wrd-header-blob-height: 150px;
  --wrd-sidebar-collapsed-width: 75px;
  --wrd-navbar-height: var(--site-navbar-height, 72px);
}

/* Icon Button Edit Document */
.wrd-action-group .button {
    display: inline-flex !important; 
    align-items: center;             
    justify-content: center;         
    gap: 4px;                     
    transition: all 0.2s ease;
    height: 30px;                   
    padding: 0 10px;            
}

/* Icon Dashicons */
.wrd-action-group .button .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    margin: 0; 
    padding-top: 2px;
}

/* 3. ปุ่มแก้ไข (Edit) - Hover */
.wrd-action-group .wrd-btn-edit:hover {
    background-color: #005a87 !important;
    color: #fff !important;
    border-color: #005a87 !important;
}

.wrd-action-group .wrd-btn-edit:hover .dashicons {
    color: #fff !important;
    transform: scale(1.1); 
}

/* 4. ปุ่มลบ (Delete) - ปกติ */
/* เนื่องจากคุณใช้ class button-link-delete พื้นหลังมันจะใส เราอาจต้องแต่งเพิ่มถ้าอยากให้ดูเหมือนปุ่ม */
.wrd-action-group .wrd-btn-delete {
    color: #d63638;
    border-color: #d63638;
}

/* 5. ปุ่มลบ (Delete) - Hover */
.wrd-action-group .wrd-btn-delete:hover {
    background-color: #d63638 !important;
    color: #fff !important;
    border-color: #d63638 !important;
}

.wrd-action-group .wrd-btn-delete:hover .dashicons {
    color: #fff !important;
    transform: scale(1.1);
}

/* กล่องครอบ */
.wrd-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  vertical-align: middle;
}

/* ซ่อน Checkbox เดิม */
.wrd-switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}

/* ตัวรางสไลด์ */
.wrd-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc; /* สีตอนปิด (เทา) */
  -webkit-transition: .4s;
  transition: .4s;
}

/* ปุ่มวงกลมข้างใน */
.wrd-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px; /* ระยะห่างจากซ้าย */
  bottom: 3px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}

/* เมื่อ Checkbox ถูกเลือก (Active) */
input:checked + .wrd-slider {
  background-color: #2196F3; /* สีตอนเปิด (ฟ้า) หรือเปลี่ยนเป็นเขียว #4CAF50 */
}

input:focus + .wrd-slider {
  box-shadow: 0 0 1px #2196F3;
}

/* เลื่อนปุ่มไปทางขวา */
input:checked + .wrd-slider:before {
  -webkit-transform: translateX(24px);
  -ms-transform: translateX(24px);
  transform: translateX(24px);
}

/* ทำให้ปุ่มมน (Rounded) */
.wrd-slider.round {
  border-radius: 34px;
}

.wrd-slider.round:before {
  border-radius: 50%;
}

.wrd-header-blob-wrapper {
    position: relative;
    padding: 60px 60px;
    margin-bottom: 40px;
    overflow: hidden;

    width: 100%;
    box-sizing: border-box;
    border-radius: 12px;
    z-index: 0;
}

.wrd-header-blob-wrapper form{
    position: relative;
    z-index: 10;
}

.wrd-header-blob-wrapper::before {
    content: "";
    position: absolute;
    top: -15%;
    right: -50px;
    width: 500px;
    height: 500px;
    background: linear-gradient(
        200deg,
        rgba(45, 212, 191, 0.1) 0%,
        rgba(37, 99, 235, 0.12) 100%);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    z-index: -1;
    backdrop-filter: blur(20px); /* ทำให้ฉากหลังที่ Blob บังอยู่ดูเบลอๆ นวลๆ */
    -webkit-backdrop-filter: blur(20px);    
    animation: blob-morph 10s ease-in-out infinite;
}

.wrd-header-blob-wrapper::after{
    content: "";
    position: absolute;
    top: 20px;
    left: -5px;
    width: 450px;
    height: 450px;
    background: linear-gradient(
        225deg,
        rgba(243, 193, 244, 0.1) 0%,
        rgba(63, 193, 244, 0.08) 100%
    );
    border-radius: 70% 30% 30% 70% / 60% 40% 60% 40%;
    z-index: -1;
    backdrop-filter: blur(20px); /* ทำให้ฉากหลังที่ Blob บังอยู่ดูเบลอๆ นวลๆ */
    -webkit-backdrop-filter: blur(20px);
    animation: blob-morph-reverse 12s ease-in-out infinite;
}

/* --- Class กลางสำหรับ Blob ตัวใหม่ (เพื่อให้จัดการง่าย) --- */
.wrd-extra-blob {
    position: absolute;  
    z-index: -1;          
    border-radius: 50%;  
    pointer-events: none;
    backdrop-filter: blur(20px); /* ทำให้ฉากหลังที่ Blob บังอยู่ดูเบลอๆ นวลๆ */
    -webkit-backdrop-filter: blur(20px);
    
    animation: blob-morph 15s ease-in-out infinite; 
}

/* --- กำหนดหน้าตา Blob ก้อนที่ 3 --- */
.blob-3 {
    width: 275px;
    height: 275px;
    
    top: 1%;
    left: 35%;
    
    background: linear-gradient(
    200deg,
    rgba(45, 212, 191, 0.1) 0%,   /* เขียว Teal (Teal-400) */
    rgba(37, 99, 235, 0.12) 100%);
    
    /* รูปร่าง */
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
}

/* --- กำหนดหน้าตา Blob ก้อนที่ 4 --- */
.blob-4 {
    width: 300px;
    height: 300px;
    
    /* ตำแหน่ง */
    top: 1%; 
    left: 45%;
    
    /* สี: ม่วงจางๆ */
    background: linear-gradient(
        45deg,
        rgba(249, 168, 212, 0.12) 0%,  /* ชมพูพีช (Pink-300) */
        rgba(129, 140, 248, 0.12) 100%
        );
    
    /* หมุนสวนทางให้ดูมีมิติ */
    animation-direction: reverse; 
    animation-duration: 20s;
}

.wrd-header-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

/* Animation */
@keyframes blob-morph {
    0%, 100% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
        transform: translate(0, 0) scale(1);
    }
    25% {
        border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%;
        transform: translate(20px, -20px) scale(1.05);
    }
    50% {
        border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%;
        transform: translate(-15px, 10px) scale(0.98);
    }
    75% {
        border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%;
        transform: translate(10px, 15px) scale(1.02);
    }
}

@keyframes blob-morph-reverse {
    0%, 100% {
        border-radius: 70% 30% 30% 70% / 60% 40% 60% 40%;
        transform: translate(0, 0) scale(1);
    }
    33% {
        border-radius: 40% 60% 70% 30% / 40% 50% 50% 60%;
        transform: translate(-20px, 15px) scale(1.03);
    }
    66% {
        border-radius: 60% 40% 30% 70% / 50% 60% 40% 50%;
        transform: translate(15px, -10px) scale(0.97);
    }
}

.wrd-container {
    position: relative;
    width: 100%;
    max-width: 1400px;

    margin-left: auto;
    margin-right: auto;
    margin-bottom: 40px;
    margin-top: var(--wrd-navbar-height);

    padding: 0;
    box-sizing: border-box;
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 31, 63, 0.15);
}

/* --- Dashboard Layout --- */
.wrd-shortcode-root {
    --wrd-navbar-offset: 72px;
}

.wrd-layout-wrapper {
    display: flex;
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    font-family: 'Sarabun', sans-serif;

    position: relative;
    overflow: visible;

    margin-left: 0;
    width: 100%;
}

/* --- Sidebar --- */
.wrd-sidebar {
  position: fixed;
  top: var(--wrd-navbar-height, 72px);
  left: 0;

  width: var(--wrd-sidebar-width);
  height: calc(100vh - var(--wrd-navbar-height, 72px));

  flex-shrink: 0;
  z-index: 1100;

  display: flex;
  flex-direction: column;

  background: linear-gradient(
    135deg,
    #f0f4f8 0%,
    #e8f1f9 25%,
    #dde9f5 50%,
    #e5ecf6 75%,
    #f0f4f8 100%
    );
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.08);

  overflow: visible !important;
}


.site-header,
.elementor-sticky--active {
    z-index: 1200;
}


body.loaded .wrd-sidebar {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Decorative Element ด้านหลัง Sidebar */
.wrd-sidebar::before {
    content: "";
    position: absolute;
    top: 10%;
    right: 5%;
    bottom: 0;
    width: 1px;
    background-image:
        radial-gradient(
            circle at 20% 50%,
            rgba(63, 193, 244, 0.08) 0%,
            transparent 50%
        ),
        radial-gradient(
            circle at 80% 80%,
            rgba(0, 102, 204, 0.06) 0%,
            transparent 50%
        );
    z-index: 10;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.wrd-sidebar::after {
    content: "";
    position: absolute;
    bottom: 10%;
    right: 10%;

    width: 150px;
    height: 150px;
    background: radial-gradient(
        circle,
        rgba(63, 193, 244, 0.35) 0%,
        rgba(63, 193, 244, 0.15) 50%,
        transparent 100%
    );

    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    animation: blob-float 6s ease-in-out infinite;
}

@keyframes blob-float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.5;
    }
    25% {
        transform: translate(15px, -15px) scale(1.1);
        opacity: 0.6;
    }
    50% {
        transform: translate(-10px, 10px) scale(0.95);
        opacity: 0.4;
    }
    75% {
        transform: translate(20px, 5px) scale(1.05);
        opacity: 0.55;
    }
}

.blob-decoration {
    position: absolute;
    top: 30%;
    left: -40px;
    
    width: 140px;
    height: 140px;
    
    background: radial-gradient(
        circle,
        rgba(0, 102, 204, 0.25) 0%,
        rgba(0, 102, 204, 0.08) 60%,
        transparent 100%
    );
    
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    
    animation: blob-float-2 7s ease-in-out infinite;
}

@keyframes blob-float-2 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.4;
    }
    50% {
        transform: translate(25px, -25px) scale(1.2);
        opacity: 0.6;
    }
}

/* Header Sidebar */
.sidebar-header {
    padding: 15px;
    display: flex;              
    justify-content: flex-start; 
    align-items: center;    
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
    min-height: 60px;
}

.wrd-sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 10px;
}

#wrd-toggle-btn {
    color: #475569;
    cursor: pointer;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;            
    outline: none;           
    background: transparent;
    border-radius: 8px;
}

#wrd-toggle-btn:focus {
    outline: none;         
    box-shadow: none;        
}

#wrd-toggle-btn:hover {
    background: #003366;  /* hover ฟ้า PSU */
    transform: translateY(-3px) scale(1.08);
    color: white;  
}

#wrd-toggle-btn i svg {
    width: 28px !important;
    height: 28px !important;
    stroke: white !important;
    stroke-width: 2.5 !important;
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    position: relative;
    z-index: 1;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin: 30px 0;
    position: relative;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    vertical-align: middle;
    gap: 12px;
    padding: 12px 20px;
    color: #1f2937; 
    height: 48px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 18px;
    font-weight: 700;
    position: relative;
}

/* Hover Effect - โค้งมน (เฉพาะตอน Sidebar ขยาย) */
.wrd-sidebar:not(.collapsed) .sidebar-nav li a::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    background: #17436E;
    border-radius: 0 25px 25px 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.wrd-sidebar:not(.collapsed) .sidebar-nav li a:hover::before,
.wrd-sidebar:not(.collapsed) .sidebar-nav li.active a::before {
    width: calc(100% - 10px);
    height: 80%;
}

.sidebar-nav li a:hover,
.sidebar-nav li.active a {
    color: white;
    padding-left: 30px;
}

.sidebar-nav li.active a {
    background: rgba(63, 193, 244, 0.15);
    border-left: 4px solid #3fc1f4;
    border-radius: 0 20px 20px 0;
    margin-right: 10px;
}

.sidebar-nav .icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.sidebar-nav li a:hover .icon {
    transform: scale(1.15);
    color: white;
}

.sidebar-nav li a:hover .icon svg {
    stroke: white !important;
}

.sidebar-nav .icon svg {
    width: 26px !important;  
    height: 26px !important;
    color: #475569!important; 
    stroke-width: 2.5 !important; 
 /* fill: white !important; */
}

/* ขนาด Sidebar เมื่อหด */
.wrd-sidebar.collapsed {
    width: var(--wrd-sidebar-collapsed-width);
    min-width: var(--wrd-sidebar-collapsed-width);
    max-width: var(--wrd-sidebar-collapsed-width);
    box-shadow: 2px 0 10px rgba(0, 31, 63, 0.2);
}

.wrd-sidebar.collapsed ~ .wrd-main-content {
    margin-left: 100px;
}

.menu-text {
    white-space: nowrap;
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
}

/* ซ่อนข้อความเมนู */
.wrd-sidebar.collapsed .menu-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: opacity 0.2s ease, width 0.3s ease;
    display: none;
}

/* จัดเมนูให้อยู่กลาง */
.wrd-sidebar.collapsed .sidebar-nav li {
    position: relative;
}

.wrd-sidebar.collapsed .sidebar-nav li a {
    justify-content: center;
    padding: 16px 0;
    gap: 0;
}

.wrd-sidebar:not(.collapsed) .sidebar-nav li a:hover::before,
.wrd-sidebar:not(.collapsed) .sidebar-nav li.active a::before {
    width: calc(100% - 10px);
    height: 80%;
}

/* =============
    Flyout Menu 
   ============= */

.wrd-menu-item {
    position: relative;
    display: flex;
    align-items: center;
    height: 56px;
    overflow: visible;
}

.wrd-menu-item .icon {
    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;

    border-radius: 12px;
    z-index: 2;
}

.wrd-flyout-inline {
    position: absolute;

    left: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(-20px);

    height: 48px;
    padding: 0 16px;
    line-height: 40px;

    display: flex;
    align-items: center;

    background: #003366;
    color: #fff;
   

    border-radius: 0 12px 12px 0;
    white-space: nowrap;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    box-shadow: 0 8px 24px rgba(0,0,0,.25);
    z-index: -1;

    transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}


.wrd-sidebar.collapsed .wrd-menu-item:hover {
    background: linear-gradient(180deg, #003366 0%, #00264d 100%);
}

 /* แสดง flyout เฉพาะตอน sidebar ถูกย่อ */
.wrd-sidebar.collapsed .wrd-menu-item:hover .wrd-flyout-inline {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(-50%) translateX(0);
}


.wrd-sidebar.collapsed .wrd-menu-item:hover .icon,
.wrd-sidebar.collapsed .wrd-menu-item.active .icon {
    background: rgba(63, 193, 244, 0.25);
    transform: scale(1.1);
}

.wrd-flyout-inline::before {
    content: "";
    position: absolute;
    left: 0px;
    top: 0;

    width: 1px;
    height: 100%;

    background: rgba(255,255,255,0.15);
}

/* Active Menu */
.wrd-sidebar.collapsed .wrd-menu-item.active {
    background: rgba(63, 193, 244, 0.3);
}


/* --- Main Content --- */
.wrd-main-content {
    flex: 1;
    min-height: 100%;
    position: relative;
    padding: 0;
    display: flex;
    flex-direction: column;
    
    margin-left: var(--wrd-sidebar-width);
    width: 100%;
}

/* เงาด้านซ้ายของ Content */
.wrd-main-content::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, 
        rgba(0, 51, 102, 0.1) 0%, 
        rgba(0, 51, 102, 0.05) 50%, 
        rgba(0, 51, 102, 0.1) 100%);
    pointer-events: none;
}

/* ปรับ Search Form - หลัก! */
.wrd-main-content form[method="GET"] {
    margin: 0 0 40px 0;
    width: 100%;
    max-width: 100%;
    padding: 30px 60px;
    border-left: 6px solid #003366;
    box-shadow: 0 4px 20px rgba(0, 51, 102, 0.12);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.wrd-main-content form[method="GET"]:hover {
    box-shadow: 0 6px 30px rgba(0, 51, 102, 0.18);
    transform: translateY(-2px);
}

/* ปรับ Wave Section - หลัก! */
.wrd-wave-section {
    position: relative;
    margin-top: 0;
    padding: 100px 60px;
    background: linear-gradient(180deg,
    #Eef2FF 0%,   /* ม่วงครามที่อ่อนมากๆ (Indigo-50) */
    #E0F2FE 100%
    );
    overflow: hidden;

    width: 100%;
    box-sizing: border-box;
}

.wrd-wave-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: white;
    clip-path: polygon(
        0 0,          /* มุมซ้ายบน */
        100% 0,       /* มุมขวาบน */
        100% 40%,     /* ขวาลงมา 40% */
        90% 50%,      /* จุดโค้ง 1 */
        80% 45%,      /* จุดโค้ง 2 */
        70% 55%,      /* จุดโค้ง 3 */
        60% 50%,      /* จุดโค้ง 4 */
        50% 60%,      /* จุดโค้ง 5 */
        40% 55%,      /* จุดโค้ง 6 */
        30% 50%,      /* จุดโค้ง 7 */
        20% 45%,      /* จุดโค้ง 8 */
        10% 50%,      /* จุดโค้ง 9 */
        0 40%         /* ซ้ายลงมา 40% */
    );
}

.wrd-wave-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: white;
    clip-path: polygon(
        0 60%,        /* ซ้ายเริ่มที่ 60% */
        10% 50%,
        20% 55%,
        30% 50%,
        40% 45%,
        50% 40%,
        60% 50%,
        70% 45%,
        80% 55%,
        90% 50%,
        100% 60%,     /* ขวาเริ่มที่ 60% */
        100% 100%,    /* มุมขวาล่าง */
        0 100%        /* มุมซ้ายล่าง */
    );
}

/* Content ตรงกลาง (3 Boxes) */
.wrd-featured-content {
    position: relative;
    z-index: 10; /* อยู่เหนือ Wave */
    padding: 40px 0;
}

/* ปรับ Grid Cards - หลัก! */
.wrd-wave-section .grid {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    max-width: 100%;
}

/* Cards ให้ breathing space ที่ดี */
.wrd-wave-section .shadow-md {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}

.wrd-wave-section .shadow-md:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    transform: translateY(-8px);
}

/* Animation Wave (ถ้าต้องการ) */
@keyframes wave-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.wrd-wave-top {
    animation: wave-float 8s ease-in-out infinite;
}

.wrd-wave-bottom {
    animation: wave-float 8s ease-in-out infinite;
    animation-delay: 2s; /* เลื่อนเวลาให้ไม่พร้อมกัน */
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .wrd-layout-wrapper {
        flex-direction: column;
    }
    
    .wrd-sidebar {
        width: 100% !important;
        height: auto;
        position: relative;
    }
    
    .wrd-sidebar.collapsed {
        height: 70px;
    }
    
    .wrd-sidebar.collapsed .sidebar-nav {
        display: none;
    }
    
    .wrd-main-content {
        margin-left: 0;
        padding: 15px;
    }

    .wrd-header-blob-wrapper {
        margin-left: -15px;
        margin-right: -15px;
        padding: 40px 20px;
    }

    .wrd-wave-section {
        margin-left: -15px;
        margin-right: -15px;
        padding: 60px 20px;
    }

    .wrd-main-content form[method="GET"] {
        padding: 20px;
        gap: 15px !important;
        flex-direction: column;
    }

    .wrd-main-content form[method="GET"] .w-full {
        margin-bottom: 0 !important;
    }

    .wrd-wave-section .grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .sidebar-header {
        text-align: center;
    }
}

/* ปรับปรุงส่วนหัวและการ์ด */
.text-psu-main {
    color: #003366;
    font-weight: 800;
}

.text-psu-dark {
    color: #001f3f;
}

/* ปรับปรุงปุ่มค้นหา */
.bg-psu-main {
    background: linear-gradient(135deg, #003366 0%, #004d7a 100%);
    box-shadow: 0 4px 15px rgba(0, 51, 102, 0.3);
}

.bg-psu-main:hover {
    background: linear-gradient(135deg, #001f3f 0%, #003366 100%);
    box-shadow: 0 6px 20px rgba(0, 51, 102, 0.4);
    transform: translateY(-2px);
}

/* ปรับปรุงการ์ดเอกสาร */
.shadow-md {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.shadow-md:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Loading Animation */
@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.loading-shimmer {
    position: relative;
    overflow: hidden;
}

.loading-shimmer::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s infinite;
}

/* Favorite Document Icon */
.bookmark-btn {
  width: 40px !important;
  height: 40px !important;
  padding: 0 !important;
  border: none !important;
  background: white !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
  color: #cbd5e1 !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  z-index: 20 !important;
  overflow: hidden !important;
}

/* Icon styles */
[data-lucide="star"] {
  width: 20px !important;
  height: 20px !important;
  stroke-width: 2 !important;
  transition: color 0.3s ease !important;
  flex-shrink: 0 !important;
  stroke: currentColor !important;
  fill: none !important;
  color: #cbd5e1 !important;
}

/* Hover state - Floating Action ที่มี rotate */
.bookmark-btn:hover {
  box-shadow: 0 8px 20px rgba(234, 179, 8, 0.25) !important;
  transform: translateY(-4px) rotate(15deg) scale(1.1) !important;
  background: white !important;
}

.bookmark-btn:hover [data-lucide="star"] {
  color: #fbbf24 !important;
}

/* Active state */
.bookmark-btn.active {
  background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 100%) !important;
  box-shadow: 0 8px 24px rgba(250, 204, 21, 0.4) !important;
}

.bookmark-btn.active [data-lucide="star"] {
  color: #b45309 !important;
  fill: currentColor !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1)) !important;
  animation: starPulse 0.5s ease-out !important;
}

/* Pulse animation */
@keyframes starPulse {
  0% {
    transform: scale(0.8);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Active hover - ลบ rotate เมื่อ active แล้ว */
.bookmark-btn.active:hover {
  transform: translateY(-4px) scale(1.15) !important;
  box-shadow: 0 12px 28px rgba(250, 204, 21, 0.35) !important;
}

/* Press/click effect */
.bookmark-btn:active {
  transform: translateY(-2px) scale(1.05) !important;
}

.bookmark-btn.active:active {
  transform: translateY(-2px) scale(1.1) !important;
}

/* Container ลอยมุมขวาบน */
#toastContainer {
    position: fixed;
    top: 80px;      /* ปรับความสูงตามต้องการ */
    right: 20px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none; /* เพื่อให้คลิกทะลุพื้นที่ว่างได้ */
}

/* ตัวกล่อง Toast Notification */
.wrd-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    background: #fff; /* ต้องมีสีพื้นหลัง ไม่งั้นจะโปร่งใส */
    color: #333;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #ddd;
    animation: wrdSlideIn 0.3s ease-out;
    font-family: inherit;
    transition: all 0.3s ease;
}

/* Animation ตอนโผล่มา */
@keyframes wrdSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Animation ตอนหายไป (ทำงานร่วมกับ JS) */
.wrd-toast.removing {
    transform: translateX(100%);
    opacity: 0;
}

/* สีของแถบข้างซ้ายและไอคอน */
.wrd-toast.success { border-left-color: #10B981; }
.wrd-toast.success .toast-icon { color: #10B981; }

.wrd-toast.warning { border-left-color: #F59E0B; }
.wrd-toast.warning .toast-icon { color: #F59E0B; }

.wrd-toast.error { border-left-color: #EF4444; }
.wrd-toast.error .toast-icon { color: #EF4444; }

.wrd-toast.info { border-left-color: #3B82F6; }
.wrd-toast.info .toast-icon { color: #3B82F6; }

/* รายละเอียดภายใน */
.toast-content { flex: 1; }
.toast-title { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.toast-message { font-size: 13px; color: #666; line-height: 1.4; }
.toast-close { background: none; border: none; font-size: 20px; cursor: pointer; color: #aaa; padding: 0; line-height: 1; }
.toast-close:hover { color: #333; }

/* Toast Notification Admin Page */
/* ปรับแต่งสำหรับ WordPress Admin Bar */
.admin-bar #toastContainer {
    top: 50px; /* ขยับลงมาหลบ Admin Bar (ปกติสูง 32px) */
}

/* ถ้าหน้าจอมือถือ Admin bar จะสูงกว่าปกติ */
@media screen and (max-width: 782px) {
    .admin-bar #toastContainer {
        top: 60px;
    }
}


/* admin-dashboard */
/* Container & Layout */
.wrd-dashboard-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin-top: 20px;
    max-width: 100%;
}

.wrd-mb-large {
    margin-bottom: 2rem;
}

/* Grids */
.wrd-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.wrd-grid-main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .wrd-grid-2 { grid-template-columns: 1fr 1fr; }
    .wrd-grid-main { grid-template-columns: 1fr 1fr; }
}

/* Cards */
.wrd-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    border: 1px solid #e5e7eb;
}

.wrd-card-header {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
}

/* Stat Cards (Top) */
.wrd-stat-title {
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0;
}

.wrd-stat-value {
    color: #1f2937;
    font-size: 1.875rem;
    font-weight: 700;
    margin: 0.5rem 0 0 0;
}

.wrd-border-blue { border-left: 4px solid #3b82f6; }
.wrd-border-green { border-left: 4px solid #22c55e; }

/* Charts Area : Modern Dark Theme */
.wrd-chart-wrapper {
    position: relative;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    
    background-color: #1e293b; /* หรือลอง #0f172a (เข้มกว่า) */
    
    border-radius: 24px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.3); 
    
    padding: 20px;
}

/* File Type Stats (Progress Bars) */
.wrd-file-stat-item { margin-bottom: 1rem; }

.wrd-stat-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.wrd-ext-badge {
    text-transform: uppercase;
    font-weight: 600;
    color: #4b5563;
}

.wrd-count-text {
    color: #6b7280;
    font-size: 0.85em;
}

.wrd-progress-bg {
    width: 100%;
    background-color: #f3f4f6;
    border-radius: 9999px;
    height: 8px;
}

.wrd-progress-bar {
    height: 8px;
    border-radius: 9999px;
    transition: width 0.5s ease;
}

/* Utility Colors for Bars lastname file document*/
.wrd-bg-blue  { background-color: #60a5fa; }
.wrd-bg-red  { background-color: #f87171; } 
.wrd-bg-green  { background-color: #4ade80; } 
.wrd-bg-orange  { background-color: #fb923c; } 
.wrd-bg-purple  { background-color: #a78bfa; } 
.wrd-bg-pink  { background-color: #f472b6; } 
.wrd-bg-green2  { background-color: #2dd4bf; }
.wrd-bg-yellow  { background-color: #facc15; } 
.wrd-bg-navy  { background-color: #818cf8; } 
.wrd-bg-gray { background-color: #9ca3af; }

/* List Styles (Recent Docs) */
.wrd-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wrd-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.wrd-list-item:last-child { border-bottom: none; }

.wrd-doc-title {
    color: #374151;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 1rem;
}

.wrd-doc-date {
    font-size: 0.75rem;
    color: #9ca3af;
    white-space: nowrap;
}

.wrd-text-muted { color: #9ca3af; font-style: italic; }

/* --- Premium SweetAlert2 Theme --- */

/* 1. ตัวกล่อง Popup หลัก */
.wrd-swal-popup {
    border-radius: 20px !important; /* มุมโค้งมนกว่าเดิม */
    padding: 2.5rem 2rem !important; /* เพิ่มพื้นที่หายใจ */
    box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.15) !important; /* เงาฟุ้งๆ นุ่มลึก */
    font-family: inherit !important; /* ใช้ Font เดียวกับเว็บ */
}

/* 2. หัวข้อ (Title) */
.wrd-swal-title {
    font-size: 1.6rem !important;
    font-weight: 600 !important;
    color: #1e293b !important; /* สีเทาเข้มแบบผู้ดี */
    margin-bottom: 0.5rem !important;
}

/* 3. ข้อความเนื้อหา (Content) */
.wrd-swal-content {
    font-size: 1.1rem !important;
    color: #64748b !important; /* สีเทากลาง อ่านสบายตา */
}

/* 4. ปุ่ม (Common Button Styles) */
.wrd-swal-btn {
    padding: 12px 28px !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    border-radius: 10px !important; /* ปุ่มมน */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important; /* Animation นุ่มๆ */
    border: none !important;
    margin: 0 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); /* เงาปุ่ม */
    cursor: pointer !important;
}

/* ปุ่มลบ (Confirm) - สีแดง Gradient สวยๆ */
.wrd-swal-confirm {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: white !important;
}

.wrd-swal-confirm:hover {
    transform: translateY(-2px); /* ลอยขึ้นนิดนึงเมื่อชี้ */
    box-shadow: 0 10px 15px -3px rgba(220, 38, 38, 0.3) !important; /* เงาแดงเรืองแสง */
}

.wrd-swal-confirm:active {
    transform: translateY(0);
}

/* ปุ่มยกเลิก (Cancel) - สีขาวคลีนๆ */
.wrd-swal-cancel {
    background: #f1f5f9 !important;
    color: #475569 !important;
}

.wrd-swal-cancel:hover {
    background: #e2e8f0 !important;
    color: #1e293b !important;
}

/* Test Button Dowload */
a br { 
    display:none;
}
