/* =========================================
   TEMPLATE PORTFOLIO SECTION (OrnexDev)
   ========================================= */

/* --- 1. Main Section Layout --- */
/* ย้ายมาจาก style="..." ใน <section> */
#template-section {
    background-color: #f8f9fa;
    padding: 80px 0;
}

/* สีหัวข้อหลัก */
#template-section h2.display-6 {
    color: #243245;
}

/* เส้นขีดใต้หัวข้อ (Separator) */
#template-section .section-separator {
    width: 60px;
    height: 3px;
    background: #b70000;
    margin: 0 auto;
}

/* --- 2. Custom Tabs (เมนูตัวกรอง) --- */
.custom-tabs {
    border: 1px solid #e9ecef;
}

.custom-tabs .nav-link {
    color: #6c757d;
    font-weight: 500;
    border-radius: 50px !important;
    padding: 10px 25px;
    transition: all 0.3s ease;
    border: none !important;
}

.custom-tabs .nav-link:hover {
    color: #b70000;
    background: rgba(183, 0, 0, 0.05) !important;
}

.custom-tabs .nav-link.active {
    background-color: #b70000 !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(183, 0, 0, 0.3);
}

/* --- 3. Template Cards (การ์ดแสดงผล) --- */
.template-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
    border-radius: 12px !important;
}

.template-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1) !important;
}

.template-card .card-img-top {
    height: 240px; /* กำหนดความสูงภาพให้เท่ากัน */
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    position: relative;
    overflow: hidden;
}

.template-card .card-img-top img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* Effect: Zoom ภาพเมื่อเอาเมาส์ชี้ */
.template-card:hover .card-img-top img {
    transform: scale(1.1);
}

/* --- 4. Image Overlay (ปุ่ม Live Demo) --- */
.template-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.template-card:hover .template-overlay {
    opacity: 1;
}

/* ปุ่มใน Overlay */
.template-overlay .btn {
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.template-card:hover .template-overlay .btn {
    transform: translateY(0);
}

/* --- 5. Badges (ป้ายสีประเภทงาน) --- */
.badge.bg-light.text-primary { background-color: #e8f2ff !important; color: #0d6efd !important; }
.badge.bg-light.text-success { background-color: #e6f8ef !important; color: #0f5132 !important; }
.badge.bg-light.text-warning { background-color: #fff8e6 !important; color: #997404 !important; }
.badge.bg-light.text-info { background-color: #e0f6fc !important; color: #055160 !important; }
.badge.bg-light.text-danger { background-color: #fce8e6 !important; color: #dc3545 !important; }
.badge.bg-light.text-dark { background-color: #e9ecef !important; color: #212529 !important; }
.badge.bg-light.text-secondary { background-color: #e2e3e5 !important; color: #6c757d !important; }

/* --- 6. Responsive (ปรับแต่งบนมือถือ) --- */
@media (max-width: 768px) {
    #template-section {
        padding: 50px 0;
    }
    
    .custom-tabs .nav-link {
        padding: 8px 15px;
        font-size: 14px;
        margin-bottom: 5px;
    }
    
    .template-card .card-img-top {
        height: 200px;
    }
}