/* Research Module Custom Styles */

/* ==================
   General Styling
================== */
.research-body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    line-height: 1.6;
}

/* ==================
   Header & Navigation
================== */
.research-header {
    /* เปลี่ยนจาก solid color เป็น gradient สีละมุนมากขึ้น */
    background: linear-gradient(135deg, #3498db 0%, #2c3e50 100%) !important;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.research-logo {
    max-height: 60px;
    transition: all 0.4s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.navbar-brand:hover .research-logo {
    transform: scale(1.05);
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3)) brightness(1.05);
}

/* ปรับ style ของ navbar-dark ให้มีสีที่ละมุนมากขึ้น */
.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* เพิ่ม highlight effect เมื่อ hover */
.navbar-dark .navbar-nav .nav-link:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    z-index: -1;
    transition: all 0.6s ease;
}

.navbar-dark .navbar-nav .nav-link:hover:before {
    left: 100%;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .active > .nav-link {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* ปรับปรุง dropdown menu ให้ดูทันสมัยขึ้น */
.dropdown-menu {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-top: 3px solid #21a7d0;
    animation: fadeInDown 0.3s ease;
    overflow: hidden;
}

/* ปรับ style ของ dropdown item */
.dropdown-item {
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    color: #2c3e50;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: linear-gradient(135deg, #21a7d0 0%, #3498db 100%);
    color: #fff;
    transform: translateX(5px);
}

/* ปรับ style สำหรับ dropdown submenu */
.dropdown-submenu .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -3px;
    margin-left: 1px;
    border-radius: 0 0.5rem 0.5rem 0.5rem;
}

/* ปรับ animation เพิ่มเติม */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ปรับให้เมนูเข้ากับ mobile มากขึ้น */
@media (max-width: 768px) {
    .research-header {
        background: linear-gradient(135deg, #2980b9 0%, #2c3e50 100%) !important;
    }
    
    .navbar-toggler {
        border-color: rgba(255, 255, 255, 0.3);
        padding: 0.25rem 0.5rem;
    }
    
    .navbar-toggler:focus {
        outline: none;
        box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
    }
    
    .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    }
}

/* ==================
   Section Styling
================== */
.section-title {
    border-left: 5px solid #21a7d0;
    padding-left: 15px;
    font-weight: 600;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    background: none;
}

/* ==================
   Research Card
================== */
.research-card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(39,60,102,0.07);
    transition: box-shadow 0.2s, transform 0.2s;
    background: #fff;
}

.research-card:hover {
    box-shadow: 0 8px 32px rgba(33,167,208,0.15);
    transform: translateY(-4px) scale(1.02);
}

.research-card .card-img-top {
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    height: 180px;
    object-fit: cover;
    background: #f5f5f5;
}

.research-card-placeholder {
    height: 180px;
    background: #f5f5f5;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.research-card .card-title {
    font-size: 1.05rem;
    font-weight: 500;
    color: #273c66;
    margin-bottom: 0;
    transition: color 0.2s;
}

.research-card .card-title:hover {
    color: #21a7d0;
    text-decoration: underline;
}

/* ==================
   Buttons & Links
================== */
.btn-outline-primary {
    border-radius: 20px;
    font-size: 0.95rem;
    padding: 3px 18px;
    border-width: 2px;
}

/* ==================
   Stats & Counters
================== */
.research-stats {
    background: #f8f9fa;
    padding: 60px 0;
}

.counter-item {
    text-align: center;
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.counter-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.counter-number {
    font-size: 36px;
    font-weight: 700;
    color: #273c66;
    margin-bottom: 10px;
}

.counter-text {
    font-weight: 500;
    color: #555;
}

/* ==================
   Footer
================== */
.bg-dark {
    background-color: #152342 !important;
}

/* ==================
   Back to Top Button
================== */
#scrollUp {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 45px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: none;
}

#scrollUp:hover {
    background: #21a7d0;
    transform: translateY(-3px);
}

/* ==================
   Responsive Design
================== */
@media (max-width: 767px) {
    .section-title {
        font-size: 1.15rem;
        padding-left: 10px;
    }
    
    .research-card .card-img-top,
    .research-card-placeholder {
        height: 130px;
    }
    
    .counter-number {
        font-size: 32px;
    }
    
    .counter-item {
        margin-bottom: 20px;
    }
}

@media (max-width: 575px) {
    .research-stats {
        padding: 40px 0;
    }
    
    .counter-number {
        font-size: 28px;
    }
}