body {
    background-color: var(--bg-body);
    display: flex;
    flex-direction: column;
    margin: 0;
    padding-top: 50px;
}
/* tab-bar */
.logo {
    margin: 0;
}

.logodeptabbar {
    width: 200px;
    height: auto;
}

.topbar {
    display: flex;
    position: relative;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background-color: var(--bg-home);
}

.indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 80px;
    height: 40px;
    border-radius: 30px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1), width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.tab-container {
    position: relative;
    display: flex;
    width: fit-content;
    margin: 10px 10px 10px auto;
    gap: 25px;
    background-color: #F3E6A2;
    border-radius: 33px;
    padding: 10px 15px;
    z-index: 999;
}

.tab-link {
    font-family: 'Kodchasan', sans-serif;
    position: relative;
    z-index: 1;
    text-decoration: none;
    display: flex;
    align-items: center;
    color: #184274;
    padding: 10px 15px;
    border-radius: 30px;
    transition: all 0.4s ease;
    opacity: 0.6;
}

.tab-link .icon {
    width: 20px;
    height: 20px;
    display: block;
}

.tab-link .label {
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    white-space: nowrap;
    transition: all 0.4s ease, opacity 0.3s ease;
    font-weight: bold;
    margin-left: 0;
}

.tab-link.active {
    color: #184274 ;
    background-color: #78C0E6;
    opacity: 1;
    animation: pop 0.3s ease;
}

@keyframes pop {
    0% {
        transform: scale(0.9);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}



.tab-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tab-link.active .label {
    display: inline-block;
    max-width: 150px;
    opacity: 1;
    margin-left: 10px;
    color: #184274;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 6px;
}

.hamburger span {
    width: 40px;
    height: 4px;
    background-color: #F3E6A2;
    border-radius: 5px;
    transition: all 0.4s ease;
}


/* footer */
.footer {
    font-family: 'K2D', sans-serif;
    margin-top: auto;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    background-color: var(--color-footer1);
    color: #F3E6A2;
    gap: 10px;
    padding: 40px;
}
.footer-logo-img {
    width: 200px;
    height: auto;
    margin: 0;
}


.footer-contact p {
    margin: 6px 0;
    line-height: 1.6;
}

.footer-address p {
    margin: 6px 0;
    line-height: 1.6;
}

.footer .social {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.footer-bottom {
    display: flex;
    color: #040518;
    background-color: #F3E6A2;
    justify-content: center;
    padding: 12px 16px;
    text-align: center;
    width: 100%;
}

.main-header {
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin: 40px auto;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-top .social {
    display: flex;
    gap: 18px;
    margin-bottom: 30px;
}

.header-top .social img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    display: block;
    filter: brightness(0) saturate(100%) invert(63%) sepia(30%) saturate(500%) hue-rotate(170deg) brightness(90%);
    transition: filter 0.3s ease;
}

.kmitl {
    background-color: #6fa7c4;
    border-radius: 35px 35px 0px 0px;
    padding: 33px 20px;
    font-size: 18px;
    color: #fff;
    transition: background-color 0.35s ease, color 0.35s ease;
}

.full {
    display: none;
}

.short {
    display: inline;
}

.header-content {
    background-color: #6fa7c4;
    border-radius: 40px 0px 40px 40px;
    padding: 30px 50px;
    text-align: center;
    transition: background-color 0.35s ease, color 0.35s ease;
}

.header-content h1 {
    font-size: 36px;
    margin-bottom: 25px;
}

.header-content p {
    font-size: 20px;
    color: #fff8e1;
}

@media (min-width: 750px) {
    .main-header {
        padding: 120px 80px 40px;
        border-top-left-radius: 180px;
        border-top-right-radius: 180px;
    }

    .header-top {
        position: absolute;
        top: 40px;
        left: 80px;
        right: 80px;
    }

    .short {
        display: none;
    }

    .full {
        display: inline;
    }

    .header-content h1 {
        font-size: 72px;
    }

    .header-content p {
        font-size: 30px;
    }
}

/* Course */
.courses {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;
}

.onedegree {
    position: relative;
    width: 250px;
    margin-left: auto;
    margin-right: auto;
}

.twodegree {
    position: relative;
    width: 250px;
    margin-left: auto;
    margin-right: auto;
}

.continuedegree {
    position: relative;
    width: 250px;
    margin-left: auto;
    margin-right: auto;
}

.Meng {
    position: relative;
    width: 250px;
    margin-left: auto;
    margin-right: auto;
}

.box {
    background-color: var(--bg-gallery2);
    border-radius: 30px 30px 30px 0px;
    padding: 5px 20px 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    color: var(--color-text);
}

.box2 {
    background-color: var(--bg-gallery2);
    border-radius: 0px 0px 30px 30px;
    width: 160px;
    height: 70px;
    margin-top: -20px;
}

.box p {
    color: var(--color-text);
    font-size: 1rem;
    line-height: 1.8;
    text-align: center;
}
.box b {
    font-size: 1.2rem;
}

.arrow-btn {
    background-color: var(--color-h1-bg);
    border-radius: 10px;
    width: 45px;
    height: 45px;
    position: absolute;
    right: 70px;
    bottom: 30px;
    padding: 10px;
    display: flex;
    object-fit: contain;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.arrow-btn img {
    width: 45px;
}

.arrow-btn:hover {
    transform: translate(-5px);
}

@media (min-width: 576px) {
    .courses {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .courses {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .courses {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Information */
* {
    box-sizing: border-box;
}

.info-slider {
    position: relative;
    max-width: 1320px;
    width: 100%;
    margin: 20px auto;
    overflow: hidden;
}

.slider-track {
    display: flex;
    transition: transform 0.5s ease;
    width: 100%;
}

.slide {
    min-width: 100%;
    background: #e3b654;
    border-radius: 25px;
    padding: 20px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;

    min-height: 250px;

    box-shadow:
        inset 0 10px 25px rgba(0, 0, 0, 0.2),
        inset 0 -8px 20px rgba(255, 255, 255, 0.3);
}

.slide img {
    width: 35%;
    max-width: 400px;
    aspect-ratio: 4 / 3;
    border-radius: 20px;
    object-fit: cover;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

.slide-text {
    max-width: 500px;
    font-size: 1.5rem;
    color: var(--color-text);
}

.nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #F3E6A2;
    border: none;
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 10;
}

.prev {
    left: 10px;
}

.next {
    right: 10px;
}

.nav:hover {
    background: #f0c356;
}

.slide-text a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.slide-text a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {

    .slide {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .slide img {
        width: 100%;
        height: 300px;
    }

    .slide-text {
        width: 100%;
        font-size: 1rem;
    }

    .nav {
        padding: 8px 12px;
        font-size: 1rem;
    }
}

/* Circle */
.line {
    stroke: var(--color-text);
}
.circle-wrapper {
    width: 90vw;
    max-width: 600px;
    aspect-ratio: 1/1;
    margin: 30px auto;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.circle-svg text {
    fill: var(--color-text);
    paint-order: stroke;
}

.circle-svg {
    width: 100%;
    height: 100%;
}

.slice path {
    fill: var(--bg-gallery2);
    transition: 0.3s ease;
}

.slice {
    transition: 0.3s ease;
    transform-origin: center;
    cursor: pointer;
}

@media (hover: hover) {
    .slice:hover path {
        fill: #f0b84f;
    }

    .slice:hover .desc {
        opacity: 1;
    }

    .slice:hover {
        transform: scale(1.05);
    }

    .circle-wrapper:hover .center-box {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}

.slice.active path {
    fill: #f0b84f;

}

.slice.active .desc {
    opacity: 1;
}

.slice.active {
    transform: scale(1.05);
}

.label {
    text-anchor: middle;
    font-weight: bold;
    font-size: 1.1rem;
    pointer-events: none;
    border-width: 3px;
    border-color: var(--color-h1-bg);
    color: var(--color-text);
}

.desc {
    text-anchor: middle;
    font-size: 10px;
    opacity: 0;
    transition: 0.3s ease;
    pointer-events: none;
    color: var(--color-text);
}

.center-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--color-h1-bg);
    padding: 14px 22px;
    border-radius: 14px;
    font-weight: bold;
    text-align: center;
    transition: 0.3s ease, background-color 0.35s ease, color 0.35s ease;
    font-size: 2rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    color: var(--color-h1-text);
}

/*PJCard*/
.project-interactive-container {
    display: flex;
    height: 100%;
}

.project-card {
    background-color: #f0c356;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    text-align: center;
    animation: fadeIn 0.4s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    transition: background-color 0.35s ease, color 0.35s ease;
}

.hidden {
    display: none !important;
}



@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.compact-view .project-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 30px;
    margin-bottom: 15px;
    border: 5px solid #F3E6A2;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

.project-title {
    font-weight: 700;
    color: var(--color-text);
    text-shadow:
        -1px 0 #F3E6A2,
        1px 0 #F3E6A2,
        0 -1px #F3E6A2,
        0 1px #F3E6A2;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.project-desc {
    color: var(--color-text);
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

.read-more-btn {
    background-color: #fdf1cd;
    border: 1px solid #c7a14e;
    border-radius: 25px;
    padding: 10px 40px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #1e2b40;
    font-weight: 600;
    transition: 0.3s;
    margin-top: auto;
}

.read-more-btn:hover {
    background-color: #fff8e1;
    transform: scale(1.05);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 25px;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #d19a3b;
    cursor: pointer;
    transition: 0.3s;
}

.close-btn:hover {
    color: #a37222;
    transform: scale(1.1);
}

.expanded-header {
    display: flex;
    gap: 20px;
    align-items: center;
    text-align: left;
    margin-bottom: 30px;
    margin-top: 15px;
}

.project-img-large {
    width: 45%;
    border-radius: 15px;
    border: 3px solid #F3E6A2;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

.expanded-title-area {
    width: 55%;
}

.expanded-content-area {
    position: relative;
    background-color: #fdf1cd;
    border-radius: 15px;
    padding: 40px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-content p {
    font-size: 0.95rem;
    color: #444;
    line-height: 1.8;
    margin: 0;
    text-align: left;
}

.side-tab-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    writing-mode: vertical-rl;
    background-color: #dfb241;
    border: none;
    padding: 20px 10px;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'K2D', sans-serif;
    font-size: 1rem;
    color: #9c731e;
    font-weight: 600;
    height: 140px;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.side-tab-btn.left-tab {
    left: -15px;
    transform: translateY(-50%) rotate(180deg);
}

.side-tab-btn.right-tab {
    right: -15px;
}

.side-tab-btn.active,
.side-tab-btn:hover {
    background-color: #c79521;
    color: white;
    z-index: 10;
}

@media (max-width: 768px) {
    .expanded-header {
        flex-direction: column;
        text-align: center;
        margin-top: 25px;
    }

    .project--large {
        width: 100%;
        height: 200px;
        object-fit: cover;
    }

    .expanded-title-area {
        width: 100%;
    }

    .expanded-content-area {
        padding: 70px 20px 25px 20px;
        align-items: flex-start;
    }

    .tab-content p {
        font-size: 0.9rem;
    }

    .side-tab-btn {
        position: absolute;
        top: 0;
        writing-mode: horizontal-tb;
        height: 50px;
        width: 50%;
        font-size: 0.95rem;
        border-radius: 15px 15px 0 0;
        transform: none !important;
    }

    .side-tab-btn.left-tab {
        left: 0;
    }

    .side-tab-btn.right-tab {
        right: 0;
    }
}

.projects-grid {
    display: grid;
    gap: 30px;
    max-width: 1400px;
    margin: 60px auto;
    padding: 0 20px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    align-items: stretch;
}

.expanded-view {
    grid-column: 1 / -1;
}

@media (min-width: 1200px) {
    .projects-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 576px) and (max-width: 991px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

/* Scrollpic */
:root {
    --total-items: 9;
    --animation-duration: 30s;
}


.scrollingPic {

    width: 100%;

    position: relative;
    height: 150px;
    overflow: hidden;
    mask-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 20%, rgba(0, 0, 0, 1) 80%, rgba(0, 0, 0, 0));
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}


@keyframes scrollleft {
    to {
        left: -200px;
    }
}

.item {
    margin-top: 10px;
    margin-bottom: 10px;
    width: 250px;
    height: 120px;
    background-color: var(--bg-body);
    border-radius: 20px;
    position: absolute;
    overflow: hidden;
    left: max(calc(250px * var(--total-items)), 100%);

    animation-name: scrollleft;
    animation-duration: var(--animation-duration);
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

.item:nth-child(odd) {
    border: 3px solid #F3E6A2;
}

.item:nth-child(even) {
    border: 3px solid #EFBB58;
}

.item1 {

    animation-delay: calc(var(--animation-duration) / var(--total-items) * (var(--total-items) - 1) * -1);
}

.item2 {
    animation-delay: calc(var(--animation-duration) / var(--total-items) * (var(--total-items) - 2) * -1);
}

.item3 {
    animation-delay: calc(var(--animation-duration) / var(--total-items) * (var(--total-items) - 3) * -1);
}

.item4 {
    animation-delay: calc(var(--animation-duration) / var(--total-items) * (var(--total-items) - 4) * -1);
}

.item5 {
    animation-delay: calc(var(--animation-duration) / var(--total-items) * (var(--total-items) - 5) * -1);
}

.item6 {
    animation-delay: calc(var(--animation-duration) / var(--total-items) * (var(--total-items) - 6) * -1);
}

.item7 {
    animation-delay: calc(var(--animation-duration) / var(--total-items) * (var(--total-items) - 7) * -1);
}

.item8 {
    animation-delay: calc(var(--animation-duration) / var(--total-items) * (var(--total-items) - 8) * -1);
}

.item9 {
    animation-delay: calc(var(--animation-duration) / var(--total-items) * (var(--total-items) - 9) * -1);
}

@media (max-width: 768px) {
    .indicator {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .hamburger span {
        background-color: #F3E6A2;
    }

    .topbar {
        position: relative;
        z-index: 3000;
    }

    #menu {
        position: absolute;
        top: 65px;
        right: 0;
        width: 150px;

        display: flex;
        flex-direction: column;
        gap: 14px;

        padding: 20px;
        border-radius: 20px;

        transition: transform .35s ease, opacity .35s ease;
    }

    #menu .tab-link {
        display: flex;
        align-items: center;
        gap: 10px;
        text-decoration: none;
        color: #184274;
        font: 16px;
        background: transparent;
        opacity: 1;
        width: 125px;
        justify-content: flex-start;
    }

    #menu .tab-link .label {
        display: inline !important;
        color: inherit !important;
        opacity: 1 !important;
        visibility: visible !important;
        font-size: 16px !important;
        line-height: 1.3 !important;
        max-width: none !important;
        overflow: visible !important;
        opacity: 1 !important;
        margin-left: 0 !important;
    }

    #menu .tab-link.active {
        width: 125px;
        color: #184274;
        background-color: #78C0E6;
        opacity: 1;
        animation: pop 0.3s ease;
    }

    .tab-container {
        position: absolute;
        top: 65px;
        height: fit-content;
        width: 150px;

        display: flex;
        flex-direction: column;
        gap: 15px;

        color: #184274;
        background-color: #F3E6A2;
        padding: 20px;
        border-radius: 20px;

        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateX(120%);
        transition: transform 0.35s ease;
    }


    .tab-container.active {
        transform: translateX(0);
        right: 0px;
        pointer-events: auto;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* footer */
    .footer-logo {
        width: 160px;
        margin-left: 0;
    }

    .footer-row {
        flex-direction: column;
        gap: 20px;
    }

    .footer-col,
    .footer-contact,
    .footer-address {
        flex: none;
        width: 100%;
    }

    .footer .social {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
    }

    .project-header {
        font-size: 18px;
        padding: 14px 16px;
        gap: 12px;
    }

    .project-header .proj-notop-icon {
        width: 22px;
    }
}

body.dark-mode .header-top .social img {
    filter: brightness(0) saturate(100%) invert(94%) sepia(20%) saturate(400%) hue-rotate(5deg) brightness(105%);
}

/* footer - เหลืองตลอด ไม่เปลี่ยนตามโหมด */
.social-footer .social img {
    filter: brightness(0) saturate(100%) invert(94%) sepia(20%) saturate(400%) hue-rotate(5deg) brightness(105%);
}

.topbar-controls {
    position: fixed;
    top: 10px;
    left: 10px;        /* ชิดซ้าย */
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10000;
}
.lang-toggle-container {
    position: absolute;
    top: 12px;
    right: 80px;
    z-index: 10001;
    display: flex;
    gap: 4px;
    background-color: #F3E6A2;
    border-radius: 20px;
    padding: 4px;
}

.lang-btn {
    background: transparent;
    border: none;
    border-radius: 15px;
    padding: 4px 12px;
    font-size: 13px !important;
    font-weight: bold !important;
    font-family: inherit !important;
    color: #184274;
    cursor: pointer;
    transition: background 0.3s ease;
    min-width: 40px;       
    text-align: center;
}

.lang-btn.active {
    background-color: #78C0E6;
    animation: pop 0.3s ease;
}

.goog-te-banner-frame,
.skiptranslate { display: none !important; }
body.translated-ltr { top: 0 !important; }
body { top: 0 !important; }