/**
 * Kruboat - Custom CSS
 * วิชาวิทยาการคำนวณ
 * สีธีม: #1a353d #2d5556 #3a6964 #b6d8dd #c9d6d5 #385d7a #608eae #8bbce2
 */

/* =========================================
   การตั้งค่าพื้นฐาน
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Sarabun', sans-serif;
    background: linear-gradient(135deg, #c9d6d5 0%, #b6d8dd 100%);
    min-height: 100vh;
    color: #1a353d;
}

/* =========================================
   Navigation Bar (เมนูหลัก)
   ========================================= */
.navbar {
    background: linear-gradient(135deg, #1a353d 0%, #2d5556 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 24px;
    font-weight: 700;
    color: #8bbce2 !important;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    color: #b6d8dd !important;
    transform: translateY(-2px);
}

.navbar-brand img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 10px;
    background: white;
    padding: 5px;
}

.navbar-nav .nav-link {
    color: #b6d8dd !important;
    font-size: 18px;
    font-weight: 500;
    padding: 12px 20px !important;
    margin: 0 5px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.navbar-nav .nav-link:hover {
    background: rgba(184, 216, 221, 0.1);
    color: #8bbce2 !important;
    transform: translateY(-2px);
}

.navbar-nav .nav-link.active {
    background: #3a6964;
    color: white !important;
    font-weight: 600;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: #8bbce2;
    transition: width 0.3s ease;
}

.navbar-nav .nav-link:hover::after {
    width: 60%;
}

.navbar-toggler {
    border: 2px solid #b6d8dd;
    padding: 8px 12px;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(184, 216, 221, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* =========================================
   Search Bar ในเมนู
   ========================================= */
.search-form {
    display: flex;
    gap: 8px;
    margin-left: 20px;
}

.search-form .form-control {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(184, 216, 221, 0.3);
    color: white;
    padding: 8px 15px;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.search-form .form-control:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: #8bbce2;
    color: white;
    box-shadow: 0 0 0 0.2rem rgba(139, 188, 226, 0.25);
}

.search-form .form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-form .btn {
    background: #3a6964;
    border: none;
    color: white;
    padding: 8px 20px;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.search-form .btn:hover {
    background: #608eae;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* =========================================
   Container หลัก
   ========================================= */
/*.main-container {
    min-height: calc(100vh - 200px);
    padding: 0 0 10px 0;
}*/

/* =========================================
   Banner Carousel
   ========================================= */

.banner-carousel {
    width: 100%;
    margin: 20px 0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.banner-carousel .carousel-inner {
    border-radius: 0 !important;
}

.banner-carousel .carousel-inner {
    width: 100% !important;
    border-radius: 0 !important;
    overflow: hidden;
}

.banner-carousel .carousel-item {
    height: 200px; /* ปรับความสูงตามต้องการ */
    background: linear-gradient(135deg, #1a353d, #3a6964);
}

.banner-carousel .carousel-item img {
    height: 200px; /* ต้องตรงกับด้านบน */
    object-fit: cover;
    border-radius: 0 !important;
}

/* ปุ่ม Previous/Next */
.banner-carousel .carousel-control-prev,
.banner-carousel .carousel-control-next {
    width: 50px;
    height: 50px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(26, 53, 61, 0.7);
    border-radius: 50%;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.banner-carousel .carousel-control-prev {
    left: 15px;
}

.banner-carousel .carousel-control-next {
    right: 15px;
}

.banner-carousel .carousel-control-prev:hover,
.banner-carousel .carousel-control-next:hover {
    opacity: 1;
    background: rgba(26, 53, 61, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.banner-carousel .carousel-control-prev-icon,
.banner-carousel .carousel-control-next-icon {
    width: 25px;
    height: 25px;
}

/* Indicators (จุดด้านล่าง) */
.banner-carousel .carousel-indicators {
    margin-bottom: 15px;
}

.banner-carousel .carousel-indicators [data-bs-target] {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    border: 2px solid white;
    transition: all 0.3s ease;
}

.banner-carousel .carousel-indicators .active {
    width: 30px;
    border-radius: 5px;
    background-color: white;
}


/* Responsive สำหรับมือถือ */
@media (max-width: 768px) {
    .banner-carousel {
        padding: 0px 0px;
    }
    
    .banner-carousel .carousel-item,
    .banner-carousel .carousel-item img {
        height: 150px;
        border-radius: 15px;
    }
    
    .banner-carousel .carousel-caption {
        padding: 15px 15px 10px;
    }
    
    .banner-carousel .carousel-caption h5 {
        font-size: 16px;
    }
    
    .banner-carousel .carousel-control-prev,
    .banner-carousel .carousel-control-next {
        width: 35px;
        height: 35px;
    }
    
    .banner-carousel .carousel-control-prev {
        left: 10px;
    }
    
    .banner-carousel .carousel-control-next {
        right: 10px;
    }
    
    .banner-carousel .carousel-control-prev-icon,
    .banner-carousel .carousel-control-next-icon {
        width: 18px;
        height: 18px;
    }
    
    .banner-carousel .carousel-indicators [data-bs-target] {
        width: 8px;
        height: 8px;
    }
    
    .banner-carousel .carousel-indicators .active {
        width: 24px;
    }
}

/* =========================================
   Header Section (หัวหน้า)
   ========================================= */
.page-header {
    background: linear-gradient(135deg, #1a353d 0%, #3a6964 100%);
    color: white;
    padding: 35px 0;
    text-align: center;
    margin-bottom: 40px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.page-header h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.page-header p {
    font-size: 20px;
    color: #b6d8dd;
    font-weight: 400;
}

/* =========================================
   Card สำหรับห้องเรียน/เว็บไซต์
   ========================================= */
.classroom-grid,
.site-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.classroom-card,
.site-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(26, 53, 61, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.classroom-card::before,
.site-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #385d7a, #608eae, #8bbce2);
}

.classroom-card:hover,
.site-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(26, 53, 61, 0.2);
    border-color: #608eae;
}

.classroom-icon,
.site-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.classroom-card h3,
.site-card h3 {
    color: #1a353d;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
}

.classroom-card p,
.site-card p {
    color: #666;
    font-size: 16px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.btn-classroom,
.btn-site {
    display: inline-block;
    background: linear-gradient(135deg, #3a6964, #608eae);
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-classroom:hover,
.btn-site:hover {
    background: linear-gradient(135deg, #608eae, #8bbce2);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(96, 142, 174, 0.4);
}

/* ปุ่ม Disabled */
.btn-classroom.btn-disabled,
.btn-site.btn-disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-classroom.btn-disabled:hover,
.btn-site.btn-disabled:hover {
    background: #6c757d;
    transform: none;
    box-shadow: none;
}

/* =========================================
   Welcome Section (หน้าแรก)
   ========================================= */
.welcome-section {
    background: white;
    border-radius: 20px;
    padding: 40px 60px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(26, 53, 61, 0.1);
    margin-bottom: 40px;
}

.welcome-section .logo {
    width: 150px;
    height: 150px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #1a353d, #3a6964);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(26, 53, 61, 0.3);
}

.welcome-section .logo img {
    width: 130px;
    height: 130px;
    object-fit: contain;
}

.welcome-section h1 {
    color: #1a353d;
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.3;
}

.welcome-section p {
    color: #666;
    font-size: 18px;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
}

/* =========================================
   Menu Cards (หน้าแรก)
   ========================================= */
.menu-cards {
    display: grid;
    /* แก้เป็นบรรทัดนี้ครับ บังคับ 4 ช่องแนวนอน */
    grid-template-columns: repeat(4, 1fr); 
    gap: 30px;
    margin-top: 40px;
}

.menu-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(26, 53, 61, 0.1);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    border: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.menu-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 188, 226, 0.2), transparent);
    transition: left 0.5s ease;
}

.menu-card:hover::before {
    left: 100%;
}

.menu-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 12px 35px rgba(26, 53, 61, 0.2);
    border-color: #608eae;
}

.menu-card .icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.menu-card h3 {
    color: #1a353d;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 15px;
}

.menu-card p {
    color: #666;
    font-size: 18px;
    line-height: 1.6;
}

/* =========================================
   Footer
   ========================================= */
.footer {
    background: linear-gradient(135deg, #1a353d 0%, #2d5556 100%);
    color: #b6d8dd;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    text-align: center;
}

.footer h4 {
    color: #8bbce2;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
}

.footer p {
    font-size: 16px;
    margin-bottom: 10px;
}

.footer a {
    color: #8bbce2;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: white;
}

.footer-divider {
    border-top: 1px solid rgba(184, 216, 221, 0.2);
    margin: 30px 0 20px;
}

.footer-bottom {
    text-align: center;
    font-size: 14px;
    color: rgba(184, 216, 221, 0.7);
}

/* =========================================
   Alert Messages
   ========================================= */
.alert {
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.alert-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.alert-danger {
    background: linear-gradient(135deg, #dc3545, #e83e8c);
    color: white;
}

.alert-warning {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    color: #333;
}

.alert-info {
    background: linear-gradient(135deg, #385d7a, #608eae);
    color: white;
}

/* =========================================
   Responsive Design
   ========================================= */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 36px;
    }
    
    .page-header p {
        font-size: 18px;
    }

    .welcome-section {
        padding: 40px 20px;
    }
    
    .welcome-section h1 {
        font-size: 32px;
    }
    
    .welcome-section .logo {
        width: 150px;
        height: 150px;
    }
    
    .welcome-section .logo img {
        width: 130px;
        height: 130px;
    }
    
    .classroom-grid,
    .site-grid {
        grid-template-columns: 1fr;
    }
    
    .menu-cards {
        grid-template-columns: 1fr;
    }
    
    .search-form {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
    }
    
    .search-form .form-control {
        width: 100%;
    }
}

/* =========================================
   Loading Animation
   ========================================= */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =========================================
   Utilities
   ========================================= */
.text-gradient {
    background: linear-gradient(135deg, #385d7a, #608eae, #8bbce2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-custom {
    box-shadow: 0 4px 15px rgba(26, 53, 61, 0.15);
}

.hover-lift {
    transition: transform 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
}

/* =========================================
   Info Box (กล่องข้อมูลเพิ่มเติม)
   ========================================= */
.info-box {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(26, 53, 61, 0.1);
    border-left: 5px solid #3a6964;
}

.info-box h4 {
    color: #1a353d;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
}

.info-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-box ul li {
    padding: 12px 0 12px 35px;
    position: relative;
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    border-bottom: 1px solid #f0f0f0;
}

.info-box ul li:last-child {
    border-bottom: none;
}

.info-box ul li:before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 12px;
    width: 24px;
    height: 24px;
    background: #3a6964;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

/* =========================================
   Search Page (หน้าค้นหา)
   ========================================= */
.search-box-main {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(26, 53, 61, 0.1);
    margin-bottom: 40px;
}

.search-input-main {
    border: 2px solid #b6d8dd;
    border-radius: 15px 0 0 15px;
    padding: 15px 25px;
    font-size: 18px;
    transition: all 0.3s ease;
}

.search-input-main:focus {
    border-color: #3a6964;
    box-shadow: 0 0 0 0.2rem rgba(58, 105, 100, 0.25);
}

.btn-search-main {
    background: linear-gradient(135deg, #3a6964, #608eae);
    color: white;
    border: none;
    border-radius: 0 15px 15px 0;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-search-main:hover {
    background: linear-gradient(135deg, #608eae, #8bbce2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(96, 142, 174, 0.4);
}

/* ผลการค้นหา */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.result-item {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(26, 53, 61, 0.08);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
    border-left: 5px solid transparent;
}

.result-item:hover {
    transform: translateX(5px);
    box-shadow: 0 6px 20px rgba(26, 53, 61, 0.15);
    border-left-color: #3a6964;
}

.result-icon {
    font-size: 48px;
    min-width: 60px;
    text-align: center;
}

.result-content {
    flex: 1;
}

.result-content h4 {
    color: #1a353d;
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 8px;
}

.result-category {
    color: #666;
    font-size: 14px;
    margin-bottom: 12px;
}

.btn-result {
    background: #3a6964;
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-result:hover {
    background: #608eae;
    color: white;
    transform: translateX(3px);
}

.result-date {
    min-width: 150px;
    text-align: right;
}

/* ไม่พบผลการค้นหา */
.no-results {
    background: white;
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(26, 53, 61, 0.08);
}

.no-results-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-results h4 {
    color: #1a353d;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 15px;
}

.no-results p {
    color: #666;
    font-size: 18px;
    margin-bottom: 30px;
}

.search-tips {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin-top: 30px;
    text-align: left;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-tips h5 {
    color: #1a353d;
    font-size: 20px;
    margin-bottom: 15px;
}

.search-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.search-tips ul li {
    padding: 8px 0 8px 30px;
    position: relative;
    color: #666;
}

.search-tips ul li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: #3a6964;
    font-weight: bold;
}

/* Search Guide */
.search-guide {
    padding: 20px 0;
}

.guide-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(26, 53, 61, 0.08);
    transition: all 0.3s ease;
    height: 100%;
}

.guide-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(26, 53, 61, 0.15);
}

.guide-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.guide-card h4 {
    color: #1a353d;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
}

.guide-card p {
    color: #666;
    font-size: 16px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.guide-examples {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.guide-examples .badge {
    background: #b6d8dd;
    color: #1a353d;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.quick-links {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(26, 53, 61, 0.08);
}

.quick-links h5 {
    color: #1a353d;
    font-size: 20px;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .search-box-main {
        padding: 25px 20px;
    }
    
    .search-input-main,
    .btn-search-main {
        font-size: 16px;
        padding: 12px 20px;
    }
    
    .result-item {
        flex-direction: column;
        text-align: center;
    }
    
    .result-date {
        text-align: center;
    }
    
    .no-results {
        padding: 40px 20px;
    }
    
    .no-results-icon {
        font-size: 60px;
    }
}

/* แท็กหมวดหมู่ที่อยู่ขอบล่าง */
.category-tags-bottom {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

/* แบดจ์แต่ละอัน - สี่เหลี่ยมมุมมน */
.category-tags-bottom {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 20px;
    padding-top: 15px;
}

.category-tags-bottom .category-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 18px;
    color: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    cursor: default;
}


/* Responsive */
@media (max-width: 768px) {
    .category-tags-bottom {
        gap: 6px;
        margin-top: 15px;
        padding-top: 12px;
    }
    
    .category-tags-bottom .category-badge {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
}

/* ไอคอนเว็บไซต์แบบรูปภาพ */
.site-icon-image {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.site-icon-image img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

/* =========================================
   ส่วนกรองหมวดหมู่
   ========================================= */
.filter-section {
    background: white;
    border-radius: 15px;
    padding: 25px 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(26, 53, 61, 0.1);
}

.filter-label {
    font-size: 18px;
    font-weight: 600;
    color: #1a353d;
    margin-bottom: 10px;
    display: block;
}

.category-dropdown {
    font-size: 16px;
    padding: 12px 20px;
    border: 2px solid #b6d8dd;
    border-radius: 10px;
    background: white;
    color: #1a353d;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.category-dropdown:focus {
    border-color: #3a6964;
    box-shadow: 0 0 0 0.2rem rgba(58, 105, 100, 0.25);
    outline: none;
}

.category-dropdown:hover {
    border-color: #608eae;
}

.result-count {
    text-align: right;
    font-size: 18px;
    font-weight: 600;
    color: #3a6964;
    padding: 12px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px; 
    /*margin-top: 18px; /* ขยับลงมาให้เท่ากับความสูงของ label */
}

.result-count span {
    font-size: 18px;
    color: #608eae;
    font-weight: 700;
}

/* ข้อความไม่มีผลลัพธ์ */
.no-results-filter {
    margin: 40px 0;
}

/* Animation Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ไอคอนเว็บไซต์แบบรูปภาพ */
.site-icon-image {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.site-card:hover .site-icon-image {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.site-icon-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* แท็กหมวดหมู่ที่อยู่ขอบล่าง */
.category-tags-bottom {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

/* แบดจ์แต่ละอัน - สี่เหลี่ยมมุมมน */
.category-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: 18px;
    color: white;
    background: #6c757d;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: help;
}

.category-badge:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Responsive สำหรับมือถือ */
@media (max-width: 768px) {
    .filter-section {
        padding: 20px;
    }
    
    .result-count {
        text-align: center;
        margin-top: 15px;
    }
    
    .category-dropdown {
        font-size: 15px;
        padding: 10px 15px;
    }
    
    .site-icon-image {
        width: 64px;
        height: 64px;
        margin-bottom: 15px;
    }
    
    .category-tags-bottom {
        gap: 5px;
        margin-top: 15px;
        padding-top: 12px;
    }
    
    .category-badge {
        min-width: 32px;
        height: 32px;
        font-size: 16px;
    }
}

/* ปุ่มรีเซ็ท */
.btn-reset {
    width: 50px; /* กว้าง = สูง = สี่เหลี่ยมจัตุรัส */
    height: 50px;
    min-height: 50px;
    background: linear-gradient(135deg, #2f9a8f, #3a6964);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 22px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px #95fff4;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-reset:hover {
    background: linear-gradient(135deg, #9af9ef, #64c9bf);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px #c7fff9;
}

.btn-reset:active {
    transform: translateY(0);
}
/* =========================================
   Mobile Optimization (ปรับเฉพาะมือถือ)
   ========================================= */
@media (max-width: 768px) {
    
    /* --- 1. ปรับเมนูให้เป็นตาราง 2 คอลัมน์ (เฉพาะมือถือ) --- */
    .menu-cards {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important; /* บังคับ 2 คอลัมน์ ซ้าย-ขวา */
        gap: 15px !important;
        margin-top: 20px !important;
    }

    /* ปรับขนาดการ์ดให้พอดีกับช่องที่เล็กลง */
    .menu-card {
        padding: 15px 10px !important;
        height: 100% !important;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        min-height: 140px;
    }

    .menu-card .icon {
        font-size: 32px !important;
        margin-bottom: 10px !important;
    }

    .menu-card h3 {
        font-size: 16px !important;
        margin-bottom: 5px !important;
    }

    .menu-card p {
        font-size: 12px !important;
        line-height: 1.3 !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* --- 2. แก้ไขส่วนอื่นๆ ในมือถือ --- */
    .btn-reset {
        width: 45px;
        height: 45px;
        min-height: 45px;
        margin-top: 0; 
    }
    
    .result-count {
        margin-top: 15px;
        text-align: center;
    }
}

/* =========================================
   แก้ไข Navbar (Header)
   ========================================= */

/* 1. เพิ่มระยะห่างแนวตั้งให้ Navbar */
.navbar {
    padding-top: 12px !important;
    padding-bottom: 12px !important;
}

/* 2. ปรับแต่งเฉพาะตอนเป็น Mobile/Tablet (เมนูย่อ) */
@media (max-width: 991.98px) {
    
    .navbar-collapse {
        background: rgba(0, 0, 0, 0.05);
        margin-top: 15px;
        padding: 20px;
        border-radius: 15px;
    }

    .navbar-nav .nav-link {
        padding-left: 10px !important;
        margin-bottom: 5px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .search-form {
        margin-top: 15px !important;
        width: 100%;
    }
    
    .search-form .form-control {
        background-color: rgba(255, 255, 255, 0.9);
        border: none;
    }
    
    .search-form .btn {
        background-color: rgba(255, 255, 255, 0.2);
        color: white;
        margin-left: 5px;
    }
}