.hero_area {
    height: 40vh;
    min-height: 400px;
    position: relative;
    display: flex;
    align-items: center;
}

.bg-box {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.bg-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.stat-card {
    background: #ffffff;
    border-radius: 15px;
    padding: 25px 20px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border: none;
    z-index: 1;
}

.stat-card.purple {
    background: linear-gradient(135deg, #fff 60%, #f3e5f5 100%);
}

.stat-card.orange {
    background: linear-gradient(135deg, #fff 60%, #fff3e0 100%);
}

.stat-card.blue {
    background: linear-gradient(135deg, #fff 60%, #e3f2fd 100%);
}

.stat-card.green {
    background: linear-gradient(135deg, #fff 60%, #e8f5e9 100%);
}

.stat-card::after {
    content: "\f080";
    font-family: "FontAwesome";
    position: absolute;
    right: -10px;
    bottom: -20px;
    font-size: 80px;
    color: rgba(0, 0, 0, 0.03);
    z-index: -1;
    transform: rotate(-15px);
}

.stat-card.purple::after {
    content: "\f073";
    color: rgba(111, 66, 193, 0.05);
}

.stat-card.orange::after {
    content: "\f02d";
    color: rgba(255, 152, 0, 0.05);
}

.stat-card.blue::after {
    content: "\f15c";
    color: rgba(0, 123, 255, 0.05);
}

.stat-card.green::after {
    content: "\f1ea";
    color: rgba(40, 167, 69, 0.05);
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.stat-card:hover::after {
    transform: scale(1.1) rotate(-10deg);
    transition: all 0.3s ease;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    margin-right: 15px;
    flex-shrink: 0;
}

.purple-bg {
    background: rgba(111, 66, 193, 0.1);
    color: #6f42c1;
}

.orange-bg {
    background: rgba(255, 152, 0, 0.1);
    color: #ff9800;
}

.blue-bg {
    background: rgba(0, 123, 255, 0.1);
    color: #007bff;
}

.green-bg {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.stat-number {
    margin: 0;
    font-weight: 800;
    font-size: 1.5rem;
    color: #333;
}

.stat-label {
    margin: 0;
    font-size: 13px;
    color: #888;
    white-space: nowrap;
}

.blog-simple-card {
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #eee;
    height: auto;
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.report .img-box {
    background-color: #fdfdfd !important;
    border-bottom: 1px solid #eee;
}

.blog .detail-box {
    flex-grow: 1;
    padding-top: 30px;
}

.blog-simple-card:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-3px);
}

.blog-simple-card .img-box {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background-color: #f8f9fa;
}

.blog-simple-card .img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.5s ease;
}

.blog-simple-card:hover .img-box img {
    transform: scale(1.1);
}

.blog-simple-card .detail-box {
    padding: 15px;
    color: #333;
    display: flex;
    flex-direction: column;
}

.blog-simple-card .detail-box h5 {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 12px;
    color: #680268;
}

.blog-simple-card .detail-box p {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}
.blog-footer {
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f5f5f5;
    padding-top: 10px;
}

.post-date {
    font-size: 12px;
    color: #999;
}

.read-more-btn {
    color: #680268;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.read-more-btn:hover {
    text-decoration: underline;
    color: #9e059e;
}

/* =======================================================
   ปรับสมดุล Modal แบบเด็ดขาด (ล็อกปุ่ม + ไถเลื่อนเนื้อหาได้)
   ======================================================= */

/* 1. จัดตำแหน่ง Modal ให้อยู่กลางจอ และห่างขอบบน-ล่างอย่างน้อย 1rem */
#uploadHeroModal .modal-dialog {
    display: flex !important;
    align-items: center !important;
    min-height: calc(100% - 2rem) !important;
    margin: 1rem auto !important;
}

/* 2. บังคับความสูงสูงสุดที่ 85% ของจอ และซ่อนส่วนที่ล้น */
#uploadHeroModal .modal-content {
    max-height: 90vh !important;
    display: flex !important;
    flex-direction: column !important;
}

/* 3. เนื้อหาตรงกลางไถเลื่อน (Scroll) ได้ */
#uploadHeroModal .modal-body {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

/* 4. ล็อกปุ่มไว้ด้านล่างสุดเสมอ ห้ามโดนบีบ ห้ามหาย */
#uploadHeroModal .modal-footer {
    flex-shrink: 0 !important;
}

/* 5. ล็อกความสูงกล่องรูปภาพให้คงที่ (กันกล่องยืดจนทะลุจอ) */
#reposition-wrapper {
    height: 250px !important;
    min-height: 250px !important;
}

/* ป้องกันรูประเบิดผิดสัดส่วน */
#hero-preview-img {
    max-width: none !important; 
}

@media (max-height: 800px) {
    #uploadHeroModal .modal-dialog {
        margin-top: 1.5rem !important;
    }
}