﻿.floating-animation {
    animation: float-up-down 4s ease-in-out infinite;
}

@keyframes float-up-down {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

@media (min-width: 992px) {
    #mainNav .navbar-nav > li.nav-item > a.nav-link.active {
        background: transparent !important;
    }
}

#mainNav {
    background-color: transparent;
    box-shadow: none;
    transition: background-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

    #mainNav .navbar-nav .nav-link {
        position: relative;
        padding-bottom: 0.75rem;
        transition: color 0.2s ease-in-out;
        color: #ffffff;
    }

        #mainNav .navbar-nav .nav-link::after {
            content: '';
            position: absolute;
            display: block;
            width: 0;
            height: 2px;
            bottom: 0.25rem;
            left: 50%;
            transform: translateX(-50%);
            transition: width 0.3s ease-in-out;
        }

    #mainNav .nav-link::after {
        background: #ffffff;
    }

    #mainNav .nav-link:hover::after,
    #mainNav .nav-link.active::after {
        width: 80%;
    }

    #mainNav.navbar-shrink {
        background-color: #ffffff;
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    }

        #mainNav.navbar-shrink .nav-link {
            color: #212529 !important;
        }

            #mainNav.navbar-shrink .nav-link::after {
                background: #212529 !important;
            }

            #mainNav.navbar-shrink .nav-link:hover,
            #mainNav.navbar-shrink .nav-link.active {
                color: #212529 !important;
            }

    #mainNav .btn-primary {
        background-color: transparent;
        color: #ffffff;
        border-color: #ffffff;
        border-width: 2px;
        transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
    }

        #mainNav .btn-primary:hover {
            background-color: #ffffff;
            color: #005bea;
        }

    #mainNav.navbar-shrink .btn-primary {
        background-color: #005bea;
        color: #ffffff;
        border-color: #005bea;
    }

        #mainNav.navbar-shrink .btn-primary:hover {
            background-color: #004ab6;
            border-color: #004ab6;
        }

.masthead {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background-color: #f8f9fa; /* พื้นหลังสำรอง */
    overflow: hidden;
}

    .masthead::before {
        content: '';
        position: absolute;
        top: 0;
        left: -30%;
        width: 130%;
        height: 100%;
        background: linear-gradient(45deg, #005bea 0%, #00c6fb 100%);
        transform: skewY(-8deg);
        transform-origin: top left;
        z-index: 0;
        border-bottom-right-radius: 20%;
    }

    .masthead .container {
        position: relative;
        z-index: 1;
    }

.masthead-text-content {
    color: #ffffff;
}

    .masthead-text-content .display-4 {
        font-weight: 700;
    }

    .masthead-text-content .lead {
        color: rgba(255, 255, 255, 0.85);
    }

    .masthead-text-content .btn {
        background-color: #ffffff;
        color: #005bea;
        font-weight: bold;
        border: none;
        padding: 0.8rem 2rem;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        transition: transform 0.2s ease-out;
    }

        .masthead-text-content .btn:hover {
            transform: translateY(-3px);
        }

.analytic-item a {
    text-decoration: none;
    color: #2c3e50;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    display: block;
    padding: 1.5rem;
    border-radius: 0.5rem;
}

    .analytic-item a:hover {
        transform: translateY(-5px);
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    }

.row.g-4 > [class*='col-'] {
    display: flex;
}

.stat-item {
    display: flex;
    flex-direction: column;
    width: 100%;
}

    .stat-item .stat-link {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
    }

    .stat-item .stat-content {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

.stat-link {
    text-decoration: none;
    display: inline-block;
    transition: transform 0.2s ease-out;
}

    .stat-link:hover {
        transform: translateY(-8px);
    }

.icon-circle {
    width: 110px;
    height: 110px;
    margin: 0 auto;
    background-color: #0035ad;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    border: 5px solid #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

    .icon-circle img {
        width: 50px;
        height: 50px;
        filter: brightness(0) invert(1);
    }

.stat-content {
    position: relative;
    background-color: #eaf2f8;
    padding: 4rem 1.5rem 2.5rem 1.5rem;
    margin-top: -55px;
    border-radius: 0.5rem;
    min-width: 220px;
}

    .stat-content::after {
        content: '';
        position: absolute;
        bottom: -19px;
        left: 50%;
        transform: translateX(-50%);
        width: 0;
        height: 0;
        border-left: 20px solid transparent;
        border-right: 20px solid transparent;
        border-top: 20px solid #eaf2f8;
    }

    .stat-content h5 {
        color: #6c757d;
        font-size: 1rem;
        font-weight: bold;
        margin: 0;
    }

.stat-number {
    color: #0035ad;
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.1;
}


/*body {
    overflow-x: hidden;
}

@media (max-width: 991.98px) {*/

    /* (ส่วนที่ 2: บังคับให้รูปภาพปรับขนาดเสมอ) ซึ่งเป็นต้นเหตุหลัก */
    /*.masthead img {
        max-width: 100%;
        height: auto;
    }*/

    /* (ส่วนที่ 3: จัดการ Layout และการตัดคำเหมือนเดิม) */
    /*.masthead .container {
        flex-direction: column-reverse;
        gap: 2rem;
    }

    .masthead-text-content {
        margin-right: 0 !important;
    }

    .masthead h1.display-4 {
        font-size: 2.25rem;
    }

    .masthead p.lead {
        font-size: 1.1rem;
        word-break: keep-all;
        word-wrap: break-word;
    }

    .masthead .btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
}*/
