/* Basic Reset & Box Sizing */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Open Sans', sans-serif;
    background-color: #F8F8F8; /* #F8F8F8 Light Gray Background */ /*  */
    color: #333333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Ensure footer sticks to bottom */
    position: relative;
}

/* Header */
.header {
    background-color: #eef0f6; /* Very Light Blue */
    padding: 15px 30px;
    border-bottom: 1px solid #E0E0E0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px; /* Limit content width */
    margin: 0 auto;
}

.logo {
    font-weight: 700;
    font-size: 1.2em;
    color: #007BFF; /* Accent color */
}

.site-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #333333;
}

.header-right .fas {
    font-size: 1.2em;
    color: #666666;
    cursor: pointer;
    transition: color 0.2s ease;
}

.header-right .fas:hover {
    color: #007BFF;
}

/* Main Content Area */
.main-content {
    flex-grow: 1; /* Allows main content to take up available space */
    max-width: 1300px;
    margin: 20px auto;
    padding: 0 20px;
    display: grid;
    gap: 30px; /* Space between sections */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Responsive columns */
}

.section-group {
    background-color: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    overflow: hidden; /* For scrollable link container */
    display: flex; /* Flex container for header and link-container */
    flex-direction: column;
    padding-bottom: 10px;
}

.section-header {
    transition: background-color .6s ease-in-out;
    padding: 15px 20px;
    border-bottom: 1px solid #E0E0E0;
    display: flex;
    align-items: center;
    background-color: #e1eaff; /* Slightly different background for header */
}

.section-title {
    font-size: 1.4em;
    font-weight: 600;
    color: #333333;
    margin-bottom: 0; /* Override default h2 margin */
    display: flex;
    align-items: center;
}

.section-icon {
    color: #007BFF; /* Accent color for section icons */
    margin-right: 10px;
    font-size: 1.1em;
}

.link-container {
    padding: 15px 20px;
    max-height: 800px; /* Max height before scrolling */
    overflow-y: auto; /* Enable vertical scrolling */
    display: flex;
    flex-direction: column;
    gap: 10px; /* Space between link cards */
    transition: height .3s , max-height .3s;
}

/* Custom Scrollbar */
.link-container::-webkit-scrollbar {
    width: 8px;
}

.link-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.link-container::-webkit-scrollbar-thumb {
    background: #B0B0B0;
    border-radius: 10px;
}

.link-container::-webkit-scrollbar-thumb:hover {
    background: #888;
}


/* Link Card */
.link-card {
    display: flex;
    align-items: center;
    background-color: #F8F8F8; /* Card background */
    padding: 12px 15px;
    border-radius: 6px;
    text-decoration: none;
    color: #333333;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #E0E0E0; /* Subtle border */
}

.link-card:hover {
    background-color: #E6F0FF; /* Lighter accent on hover */
    transform: translateY(-2px); /* Slight lift */
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.link-card.clicked-feedback {
    background-color: #C0DFFF; /* A bit darker accent on click */
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.link-icon {
    color: #007BFF; /* Accent color for link icons */
    margin-right: 12px;
    font-size: 1.1em;
    min-width: 20px; /* Ensure consistent alignment */
    text-align: center;
}

.link-name {
    font-weight: 500;
    font-size: .9em;
}

/* Footer */
.footer {
    background-color: #EEF2F6; /* Same as header */
    padding: 15px 30px;
    border-top: 1px solid #E0E0E0;
    text-align: center;
    margin-top: 20px; /* Space above footer */
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    color: #666666;
    font-size: 0.9em;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .site-title {
        margin-top: 10px;
        font-size: 1.5em;
    }

    .header-right {
        margin-top: 10px;
    }

    .main-content {
        grid-template-columns: 1fr; /* Stack columns on smaller screens */
        padding: 0 15px;
        margin: 15px auto;
    }

    .link-container {
        max-height: 350px; /* Adjust max height for smaller screens */
    }

    .section-group {
        margin-bottom: 20px;
    }

    .footer {
        padding: 10px 15px;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 1.3em;
    }

    .section-title {
        font-size: 1.2em;
    }

    .link-card {
        padding: 10px;
    }

    .link-icon {
        margin-right: 10px;
        font-size: 1em;
    }
}

.section-header:hover{
    transition: background-color .2s ease-in-out;
    cursor: pointer;
    background-color: rgb(198, 212, 255);
}

.link-container.active{
    max-height: 400px!important;
}

        .new-thing {
            /* position: absolute;
            transform: rotate(45deg); */
            font-weight: bold;
            font-size: 1.5vh;
            animation: colorBlink 1.5s infinite;
        }


        /* modal news 2 */
        
        .wrap-news-aside.active {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 100%;
            height: 100%;
            background-color: rgba(35, 32, 48, 0.64);
        }

        .wrap-news-aside .img-news-aside {
            position: absolute;
            top: 30%;
            left: -100%;
            transform: translate(-50%, -50%);
            height: 200vh;
            /* transition: left .4s ease-out; */
            width: fit-content;
            height: fit-content;
            object-fit: cover;
        }

        .wrap-news-aside .img-news-aside.active {
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            object-fit: contain;
            /* width: 100%;
            height: 100%; */
            /*  border: solid 10px red; */
            width: fit-content;
            height: 85%;
        }

        .wrap-news-aside .img-news-aside img {
            height: 100%;
            width: 100%;
        }

        .wrap-news-aside .img-news-aside.news-aside-mobile {
            height: 85% !important;
            width: 90% !important;

        }

        .button-vimi:hover{
            cursor: pointer;
        }


        /* 365 Menu */
        .menu-container {
            position: fixed;
            justify-content: center;
            align-items: center;
            width: 200px; /* เพิ่มขนาด container */
            height: 250px;
            bottom: 0;
            left: -50px;
            /* border: solid 1px black; */
        }

        .menu-toggle-button {
            position: absolute;
            width: 70px;
            height: 70px;
            border-radius: 50%;
            background-color: #7e9ded; /* สีแดง */
            color: white;
            font-size: 30px;
            border: none;
            cursor: pointer;
            /* display: flex;
            justify-content: center;
            align-items: center; */
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
            z-index: 10;
            transition: transform 0.3s ease, opacity .3s;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%); /* จัดปุ่มกลาง */
            background-image: url("assets/imgs/365_ico/20e0dda15bd87a659accee85c2eb36e7.webp") ;
            background-repeat : no-repeat;
            background-size: 70px 75px;
            box-shadow: 1px 5px 10px grey;
            opacity: .3;
        }
        .menu-toggle-button:hover{
            opacity: 1;
        }

        .menu-toggle-button.active {
            transform: translate(-50%, -50%) rotate(45deg); /* หมุน + เป็น X */
            transition: transform 0.3s ease ;
            width: 70px;
            height: 70px;
            box-shadow: 1px 5px 10px skyblue;
            background-image: none!important;
            opacity: 1;
        }
        .menu-toggle-button.active:before{
        content: "+";
        font-size: 30px;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        }

        .menu-items {
            list-style: none;
            padding: 0;
            margin: 0;
            position: absolute;
            top: 50%; 
            left: 50%; 
            transform: translate(-50%, -50%); 
            pointer-events: none;
            z-index: 5;
        }

        .menu-item {
            position: absolute;
            width: 50px;
            height: 50px;
            background-color: skyblue; /* สีเขียว */
            color: white;
            display: flex;
            justify-content: center;
            align-items: center;
            border-radius: 50%;
            font-size: 24px; 
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
            
            opacity: 0; 
            transform: translate(0, 0) scale(0.5); 
            transition: opacity 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
                        transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            transition-delay: 0s;
            box-shadow: 1px 10px 10px skyblue;
            border: solid 1px #fff;
            background-size: 50px 50px!important;
        }

        .menu-items:hover{
            cursor: pointer;
        }

        /* เมื่อเมนูเปิด */
        .menu-items.active .menu-item {
            opacity: 1;
            transform: scale(1); 
            pointer-events: auto; 
        }

        /* *** ตำแหน่งการกระจายโค้งตามภาพล่าสุด *** */
        /* ไอเทมจะกระจายจากบนสุด วนลงมาทางขวา */
        .menu-items.active .menu-item:nth-child(1) { /* เค้ก */
            transform: translate(-25px, -120px) scale(1); /* บนขวา */
            transition-delay: 0.1s;
            background: url("assets/imgs/365_ico/ms-exchange.png") no-repeat;
            background-position: center;
        }

        .menu-items.active .menu-item:nth-child(2) { /* ดาวประกาย */
            transform: translate(40px, -100px) scale(1); /* บนขวา */
            transition-delay: 0.2s;
            background: url("assets/imgs/365_ico/microsoft-onedrive-logo-cloud-storage-microsoft-office-365-logotype-microsoft-corporation-software-editorial_661108-17044.jpg") no-repeat;
            background-position: center;
        }

        .menu-items.active .menu-item:nth-child(3) { /* หัวใจ */
            transform: translate(70px, -42px) scale(1); /* ขวาขึ้น */
            background: url("assets/imgs/365_ico/png-transparent-microsoft-sharepoint-logo-office-365-icon-thumbnail.png") no-repeat;
            background-position: center;
            transition-delay: 0.3s;
        }
        
        .menu-items.active .menu-item:nth-child(4) { /* หน้ายิ้ม */
            transform: translate(50px, 20px) scale(1); /* ขวาตรงกลาง */
            background: url("assets/imgs/365_ico/logo_manual.png") no-repeat;
            background-position: center;
            transition-delay: 0.4s;
        }

        .menu-items.active .menu-item:nth-child(5) { /* สายฟ้า */
            transform: translate(150px, 90px) scale(1); /* ขวาล่าง */
            transition-delay: 0.5s;
        }
        
        .menu-items.active .menu-item:nth-child(6) { /* กล้ามเนื้อ */
            transform: translate(90px, 140px) scale(1); /* ขวาล่าง */
            transition-delay: 0.6s;
        }

        .menu-items.active .menu-item:nth-child(7) { /* แว่นขยาย */
            transform: translate(0px, 170px) scale(1); /* ล่างตรงกลาง */
            transition-delay: 0.7s;
        }

        /* ตอนปิดเมนู */
        .menu-items .menu-item {
            opacity: 0;
            transform: translate(0, 0) scale(0.5); /* กลับไปอยู่ตรงกลางปุ่มหลัก */
            pointer-events: none; 
            transition-delay: 0s;
        }
        .text-left{
        	text-align: left;
        }
        /* Close 365 Menu */