/* 
   Modern Premium Design System for Faculty of Engineering Website
   School of Engineering, University of Phayao (มพ.)
   Colors: Deep Crimson Red (#8B0000) & Elegant Gold (#D4AF37)
*/

:root {
    --primary: #8B0000;
    --primary-dark: #660000;
    --primary-light: #b30000;
    --primary-rgb: 139, 0, 0;
    
    --accent: #D4AF37;
    --accent-dark: #b38f24;
    --accent-light: #e5c765;
    
    --dark: #121416;
    --dark-card: #1c1e22;
    --light: #f8f9fa;
    --gray: #6c757d;
    --gray-light: #e9ecef;
    --border-color: rgba(0, 0, 0, 0.08);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    --hover-shadow: 0 15px 35px rgba(139, 0, 0, 0.12);
    
    --font-thai: 'Kanit', sans-serif;
    --font-eng: 'Inter', sans-serif;
}

/* Global Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-thai);
    background-color: #f5f6f8;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-thai);
    font-weight: 600;
    color: #1a1d20;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* Sticky Header & Nav */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    z-index: 1000;
    transition: all 0.4s ease;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
}

.main-header.scrolled {
    background: #700016;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 88px;
    transition: height 0.4s ease;
}

.main-header.scrolled .header-container {
    height: 68px;
}

.logo-area {
    display: flex;
    align-items: center;
}

.logo-area a {
    display: inline-flex;
    align-items: center;
}

.logo-area img {
    height: 64px;
    width: auto;
    max-width: 280px;
    object-fit: contain;
    transition: all 0.4s ease;
    display: block;
}

.main-header.scrolled .logo-area img {
    height: 48px;
    filter: brightness(0) invert(1); /* Turns logo white on dark background */
}

/* Navigation items */
.main-nav {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 5px;
}

.nav-link {
    display: block;
    padding: 10px 15px;
    font-size: 15px;
    font-weight: 500;
    color: #444;
    border-radius: 6px;
}

.main-header.scrolled .nav-link {
    color: #f5f6f8;
}

.nav-link:hover, .nav-item.active .nav-link {
    color: var(--primary);
    background: rgba(139, 0, 0, 0.05);
}

.main-header.scrolled .nav-link:hover {
    color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

/* Dropdown Menu */
.nav-item.has-dropdown {
    position: relative;
}

.nav-icon {
    font-size: 10px;
    margin-left: 4px;
    transition: transform 0.3s;
}

.nav-item.has-dropdown:hover .nav-icon {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 240px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
    border: 1px solid rgba(0,0,0,0.06);
    list-style: none;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.nav-item.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li a {
    display: block;
    padding: 10px 20px;
    font-size: 14px;
    color: #444;
    transition: all 0.2s ease;
}

.dropdown-menu li a:hover {
    background: rgba(139, 0, 0, 0.04);
    color: var(--primary);
    padding-left: 25px;
}

/* 2nd-Level Sub-Dropdown (Flyout Menu - Ultra Modern) */
.dropdown-menu li.has-sub-dropdown {
    position: relative;
}

.dropdown-item-link {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    font-weight: 500;
}

.sub-nav-icon {
    font-size: 11px;
    margin-left: 12px;
    opacity: 0.65;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sub-dropdown-menu {
    position: absolute;
    top: -6px;
    left: 100%;
    background: #ffffff;
    min-width: 230px;
    border-radius: 14px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.16);
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-left: 4px solid var(--accent);
    list-style: none;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateX(12px) scale(0.98);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1000;
}

.has-sub-dropdown:hover > .sub-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(4px) scale(1);
}

.has-sub-dropdown:hover > .dropdown-item-link .sub-nav-icon {
    transform: translateX(4px);
    opacity: 1;
    color: var(--primary);
}

.sub-dropdown-menu li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #334155;
    transition: all 0.2s ease;
}

.sub-dropdown-menu li a:hover {
    background: #fff8f8;
    color: #8b0000;
    padding-left: 22px;
}

/* Header CTA Button */
.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: #fff !important;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 500;
    font-size: 14px;
    box-shadow: 0 4px 10px rgba(139, 0, 0, 0.2);
}

.nav-btn:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(139, 0, 0, 0.3);
}

.main-header.scrolled .nav-btn {
    background: var(--accent);
    color: #4a000e !important;
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.2);
}

.main-header.scrolled .nav-btn:hover {
    background: #fff;
    color: var(--primary) !important;
}

/* Language Switcher [ TH | EN ] */
.lang-switcher-wrap {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 3px;
    margin-left: 6px;
    gap: 2px;
}

.lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 0.78rem;
    font-weight: 800;
    color: #64748b;
    text-decoration: none;
    transition: all 0.2s ease;
    line-height: 1.2;
    cursor: pointer;
    letter-spacing: 0.5px;
}

.lang-btn:hover {
    color: #1e293b;
}

.lang-btn.active {
    background: var(--primary);
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(139, 0, 0, 0.25);
}

.main-header.scrolled .lang-switcher-wrap {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

.main-header.scrolled .lang-btn {
    color: #f8fafc;
}

.main-header.scrolled .lang-btn.active {
    background: #ffffff;
    color: var(--primary) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

@media (max-width: 992px) {
    .header-actions-mobile {
        display: flex;
        align-items: center;
        gap: 8px;
    }
}

/* Mobile Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.mobile-menu-toggle .bar {
    width: 25px;
    height: 3px;
    background: #444;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.main-header.scrolled .mobile-menu-toggle .bar {
    background: #fff;
}

/* Hero Carousel Slider (1970 x 720 px Standard Banner Ratio) */
.hero-carousel {
    position: relative;
    width: 100%;
    aspect-ratio: 1970 / 720;
    max-height: 720px;
    margin-top: 80px;
    overflow: hidden;
    background: #0f172a;
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    z-index: 1;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.carousel-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
    pointer-events: auto;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transform: none !important;
    transition: none !important;
}

.carousel-slide.active img {
    transform: none !important;
}

.carousel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.25) 50%, rgba(0,0,0,0.7) 100%);
    display: flex;
    align-items: flex-end;
    padding-bottom: 45px;
}

.overlay-content {
    color: #fff;
    padding: 0 30px;
}

.overlay-content h2 {
    font-size: clamp(1.3rem, 2.6vw, 2.3rem);
    color: #fff;
    margin-bottom: 14px;
    font-weight: 700;
    text-shadow: 0 3px 12px rgba(0,0,0,0.6);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.7s ease 0.2s;
    line-height: 1.3;
}

.carousel-slide.active .overlay-content h2 {
    opacity: 1;
    transform: translateY(0);
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--accent), #f59e0b);
    color: #4a000e !important;
    padding: 10px 24px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.92rem;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.35);
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.7s ease 0.4s;
    text-decoration: none;
}

.btn-primary:hover {
    background: #ffffff;
    color: var(--primary) !important;
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.45);
}

.carousel-slide.active .btn-primary {
    opacity: 1;
    transform: translateY(0);
}

.placeholder-slide {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

/* Slider Controls */
.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.25s ease;
}

.carousel-control:hover {
    background: #8B0000;
    color: #fff;
    border-color: #f87171;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 15px rgba(139,0,0,0.5);
}

.carousel-control.prev { left: 24px; }
.carousel-control.next { right: 24px; }

.carousel-dots {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dot.active {
    background: #fde047;
    width: 28px;
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(253, 224, 71, 0.6);
}

@media (max-width: 768px) {
    .hero-carousel {
        aspect-ratio: 1970 / 720;
        min-height: 180px;
        height: auto;
        margin-top: 70px;
    }
    .carousel-control {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }
    .carousel-control.prev { left: 10px; }
    .carousel-control.next { right: 10px; }
    .carousel-dots {
        bottom: 10px;
        padding: 4px 10px;
        gap: 6px;
    }
}

/* Motto Section */
.motto-section {
    padding: 60px 0;
    background: #fff;
    position: relative;
    z-index: 5;
    box-shadow: 0 10px 40px rgba(0,0,0,0.03);
}

.text-center { text-align: center; }

.motto-badge {
    display: inline-block;
    background: rgba(139,0,0,0.08);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.motto-thai {
    font-size: 28px;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 12px;
}

.motto-eng {
    font-family: var(--font-eng);
    font-size: 16px;
    color: var(--gray);
    font-style: italic;
    font-weight: 400;
}

/* Call To Actions Grid */
.quick-actions-section {
    position: relative;
    z-index: 10;
    margin-top: -30px;
    padding-bottom: 40px;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
}

.action-card {
    display: flex;
    align-items: center;
    padding: 25px 20px;
    border-radius: 16px;
    color: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.action-card::after {
    content: '';
    position: absolute;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    right: -40px;
    bottom: -40px;
    transition: all 0.5s ease;
}

.action-card:hover::after {
    transform: scale(1.3);
    background: rgba(255, 255, 255, 0.1);
}

.action-card:hover {
    transform: translateY(-5px);
}

.card-crimson { background: linear-gradient(135deg, #700016 0%, #a30020 100%); }
.card-gold { background: linear-gradient(135deg, #b38f24 0%, #d4af37 100%); color: #4a000e; }
.card-gold::after { background: rgba(0, 0, 0, 0.03); }
.card-gold:hover::after { background: rgba(0, 0, 0, 0.06); }
.card-gold .action-icon i { color: #4a000e; }
.card-gold .action-arrow i { color: #4a000e; }
.card-gold p { color: #614400; }
.card-dark { background: linear-gradient(135deg, #1A1D20 0%, #2D3238 100%); }

.action-icon {
    font-size: 36px;
    margin-right: 20px;
}

.action-icon i {
    color: var(--accent);
}

.action-info {
    flex-grow: 1;
}

.action-info h3 {
    color: inherit;
    font-size: 18px;
    margin-bottom: 5px;
}

.action-info p {
    font-size: 13px;
    opacity: 0.85;
    font-weight: 300;
}

.action-arrow {
    font-size: 16px;
    opacity: 0.7;
    margin-left: 10px;
    transition: transform 0.3s;
}

.action-card:hover .action-arrow {
    transform: translateX(5px);
}

/* E-Services Dashboard (Quick links) */
.internal-services-section {
    padding: 60px 0;
}

.section-title-wrap {
    text-align: center;
    margin-bottom: 40px;
}

.section-title-wrap h2 {
    font-size: 26px;
    margin-bottom: 8px;
    position: relative;
    display: inline-block;
}

.section-title-wrap h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--primary);
    margin: 8px auto 0;
    border-radius: 2px;
}

.text-gold { color: var(--accent); }

.section-title-wrap p {
    color: var(--gray);
    font-size: 15px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 16px;
    max-width: 1280px;
    margin: 0 auto;
}

.service-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px 14px 20px;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 145px;
}

.service-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 26px rgba(0,0,0,0.08);
    border-color: #cbd5e1;
}

.service-icon {
    font-size: 2rem;
    color: var(--primary);
    width: 64px;
    height: 64px;
    background: rgba(139,0,0,0.06);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.service-icon i {
    font-size: 2rem;
    line-height: 1;
}

.service-item:hover .service-icon {
    transform: scale(1.1);
}

.service-item h4 {
    font-size: 0.98rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 4px 0;
    line-height: 1.35;
}

.service-item p {
    font-family: var(--font-eng);
    font-size: 0.74rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
    margin: 0;
}

/* News Section */
.news-section {
    padding: 70px 0;
    background: #fff;
}

.news-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
}

.tab-btn {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 12px 25px;
    border-radius: 30px;
    cursor: pointer;
    font-family: var(--font-thai);
    font-size: 15px;
    font-weight: 500;
    color: #444;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    background: #eaecef;
}

.tab-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 5px 15px rgba(139, 0, 0, 0.25);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 30px;
}

.no-news {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px dashed #ced4da;
    color: #777;
}

.no-news i {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--primary);
}

/* News Card */
.news-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: all 0.3s ease;
}

.news-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
}

.news-card-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #eaeaea;
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .news-card-image img {
    transform: scale(1.05);
}

.news-card-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #eee 0%, #ddd 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--primary);
}

.news-category-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    color: #fff;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.badge-announcement { background: #E74C3C; }
.badge-activity { background: #3498DB; }
.badge-procurement { background: #F39C12; }

.news-card-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.news-date {
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 10px;
}

.news-title {
    font-size: 17px;
    margin-bottom: 12px;
    line-height: 1.4;
    height: 48px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.news-excerpt {
    font-size: 14px;
    color: #555;
    font-weight: 300;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.news-card-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(0,0,0,0.05);
    background: #fafafa;
}

.btn-read-more {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: gap 0.2s;
    font-family: var(--font-thai);
}

.btn-read-more:hover {
    color: var(--accent-dark);
    gap: 8px;
}

/* Page Header layouts */
.page-header {
    margin-top: 0 !important;
    min-height: 290px !important;
    padding-top: 175px !important;
    padding-bottom: 45px !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    color: #fff !important;
    position: relative !important;
    box-sizing: border-box !important;
}

.header-about { background: linear-gradient(135deg, rgba(112,0,22,0.95) 0%, rgba(18,20,22,0.98) 100%); }
.header-courses { background: linear-gradient(135deg, rgba(212,175,55,0.95) 0%, rgba(112,0,22,0.98) 100%); }
.header-research { background: linear-gradient(135deg, rgba(18,20,22,0.95) 0%, rgba(112,0,22,0.98) 100%); }
.header-contact { background: linear-gradient(135deg, rgba(112,0,22,0.95) 0%, rgba(18,20,22,0.98) 100%); }

.page-title {
    font-size: 34px;
    color: #fff;
    margin-bottom: 8px;
    font-weight: 800;
    text-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.page-subtitle {
    font-size: 15px;
    color: var(--accent);
    font-weight: 400;
    margin-bottom: 0;
}

/* Page Section Navigation Bar */
.page-section-nav {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    position: sticky;
    top: 80px;
    z-index: 100;
}

.sec-nav-link {
    display: inline-block;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    border-radius: 30px;
    margin: 0 5px;
}

.sec-nav-link.active, .sec-nav-link:hover {
    background: var(--primary);
    color: #fff;
}

/* About Styles */
.about-section {
    padding: 80px 0;
}

.section-title {
    font-size: 26px;
    margin-bottom: 15px;
    color: var(--primary);
}

.title-line {
    width: 60px;
    height: 3px;
    background: var(--accent);
    margin-bottom: 25px;
}

.title-line.center {
    margin-left: auto;
    margin-right: auto;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
    gap: 50px;
    align-items: center;
}

.about-text p {
    color: #555;
    margin-bottom: 15px;
    font-size: 15px;
}

.image-frame-gold {
    border: 3px solid var(--accent);
    padding: 15px;
    border-radius: 20px;
    background: #fff;
}

.responsive-img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
}

/* Dark Section styling */
.section-bg-dark {
    background: linear-gradient(135deg, #1A1D20 0%, #111 100%);
    color: #fff;
}

.section-bg-dark h2 { color: #fff; }

.vision-badge {
    display: inline-block;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 5px 15px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
}

.vision-title {
    font-size: 26px;
    font-weight: 400;
    max-width: 800px;
    margin: 0 auto 50px;
    line-height: 1.5;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.card-glass {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    padding: 40px 25px;
    transition: all 0.3s ease;
}

.card-glass:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-5px);
    border-color: rgba(212, 175, 55, 0.3);
}

.mission-icon {
    font-size: 40px;
    margin-bottom: 20px;
}

.mission-card h3 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 12px;
}

.mission-card p {
    color: #bbb;
    font-size: 14px;
    font-weight: 300;
}

/* Org Structure Chart (Tree CSS) */
.org-structure-tree {
    margin-top: 50px;
}

.org-node {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    border-left: 5px solid var(--primary);
    display: inline-block;
}

.node-dean {
    border-left-color: var(--accent);
    min-width: 250px;
}

.node-board, .node-admin-office {
    min-width: 220px;
}

.node-dept {
    min-width: 200px;
    padding: 15px;
}

.node-dept h5 {
    font-size: 14px;
}

.node-dept p {
    font-size: 11px;
    color: var(--gray);
    font-family: var(--font-eng);
}

.org-connector {
    width: 2px;
    height: 40px;
    background: var(--accent);
    margin: 15px auto;
}

.org-mid-level {
    max-width: 700px;
    margin: 0 auto;
}

.dept-title-divider {
    font-size: 16px;
    color: var(--gray);
    margin: 40px auto 20px;
    position: relative;
    max-width: 300px;
}

.dept-title-divider::before, .dept-title-divider::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 1px;
    background: #ccc;
    top: 50%;
}

.dept-title-divider::before { left: 0; }
.dept-title-divider::after { right: 0; }

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Executives (Dean and Vice deans cards) */
.section-bg-light {
    background-color: #f0f2f5;
}

.dean-card-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.executive-card {
    background: #fff;
    border-radius: 16px;
    padding: 25px;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0,0,0,0.03);
    text-align: center;
    max-width: 350px;
    transition: all 0.3s;
}

.executive-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.exec-photo {
    width: 110px;
    height: 110px;
    background: var(--primary-light);
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 45px;
    color: #fff;
}

.exec-info h3 {
    font-size: 16px;
    margin-bottom: 6px;
}

.exec-title {
    display: inline-block;
    background: rgba(212,175,55,0.12);
    color: #8c721c;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 12px;
}

.exec-contact {
    font-size: 12px;
    color: var(--gray);
    font-family: var(--font-eng);
}

.exec-contact i { margin-right: 4px; }

/* Courses layout */
.courses-section {
    padding: 60px 0;
    scroll-margin-top: 90px;
}

.courses-section .container {
    max-width: 1560px;
    padding: 0 28px;
}

.course-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

@media (max-width: 1360px) {
    .courses-section .container {
        max-width: 100%;
        padding: 0 20px;
    }
}

@media (max-width: 1100px) {
    .course-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
}

@media (max-width: 640px) {
    .course-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.course-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0,0,0,0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 32px rgba(0,0,0,0.1);
}

.course-card:hover .course-head-media img {
    transform: scale(1.05);
}

.course-head {
    padding: 24px 18px;
    color: #fff;
    text-align: center;
}

.civil-bg { background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.75) 100%), url('../images/civil_engineering.jpg') center/cover no-repeat; }
.electrical-bg { background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.75) 100%), url('../images/electrical_engineering.jpg') center/cover no-repeat; }
.mechanical-bg { background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.75) 100%), url('../images/mechanical_engineering.jpg') center/cover no-repeat; }
.industrial-bg { background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.75) 100%), url('../images/industrial_engineering.jpg') center/cover no-repeat; }

.course-head h3 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 4px;
}

.course-head span {
    font-family: var(--font-eng);
    font-size: 12px;
    opacity: 0.8;
}

.course-body {
    padding: 22px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.course-body p {
    color: #555;
    font-size: 13.5px;
    line-height: 1.55;
    margin-bottom: 16px;
}

.course-meta {
    list-style: none;
    border-top: 1px solid #f0f2f5;
    padding-top: 12px;
    margin: 0 0 12px 0;
    padding-left: 0;
}

.course-meta li {
    font-size: 12.5px;
    color: #666;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.course-meta li i {
    color: var(--accent-dark);
}

@media (max-width: 992px) {
    .course-detail-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Horizontal Cards (Master/Phd) */
.course-card-horizontal {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0,0,0,0.03);
    display: flex;
    min-height: 280px;
}

.course-card-horizontal.h-reverse {
    flex-direction: row-reverse;
}

.course-h-image {
    width: 25%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    padding: 30px;
}

.master-gradient { background: linear-gradient(135deg, #700016 0%, #b30020 100%); }
.phd-gradient { background: linear-gradient(135deg, #1A1D20 0%, #3a424a 100%); }

.course-h-image i {
    font-size: 45px;
    margin-bottom: 15px;
    color: var(--accent);
}

.course-h-image h3 {
    color: #fff;
    font-size: 20px;
}

.course-h-body {
    width: 75%;
    padding: 40px;
}

.course-h-subtitle {
    display: block;
    font-family: var(--font-eng);
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 15px;
    margin-top: 2px;
}

.course-h-body p {
    color: #555;
    font-size: 15px;
    margin-bottom: 25px;
}

.course-details-mini {
    border-top: 1px solid #f0f2f5;
    padding-top: 20px;
}

.course-details-mini div strong {
    font-size: 13px;
    display: block;
    margin-bottom: 4px;
}

.course-details-mini div p {
    font-size: 13.5px;
    color: #666;
    margin-bottom: 0;
}

/* Research page details */
.research-section {
    padding: 80px 0;
}

.image-frame-crimson {
    border: 3px solid var(--primary);
    padding: 40px 20px;
    border-radius: 20px;
    background: #fff;
    text-align: center;
    box-shadow: var(--card-shadow);
}

.race-badge-big {
    font-family: var(--font-eng);
    font-size: 70px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 2px;
    text-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.check-list {
    list-style: none;
}

.check-list li {
    margin-bottom: 12px;
    font-size: 15px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 12px;
}

.check-list li i {
    font-size: 18px;
}

.mt-6 { margin-top: 30px; }
.mt-4 { margin-top: 20px; }
.mt-3 { margin-top: 15px; }
.font-bold { font-weight: 600; }
.text-lg { font-size: 18px; }
.text-crimson { color: var(--primary); }

.excellence-grid {
    max-width: 900px;
    margin: 0 auto;
}

.exc-icon {
    font-size: 40px;
    color: var(--accent);
    margin-bottom: 20px;
}

.excellence-card h3 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 12px;
}

.excellence-card p {
    color: #ccc;
    font-size: 14.5px;
}

.card-light {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.04);
    box-shadow: var(--card-shadow);
    padding: 35px 25px;
    border-radius: 16px;
    transition: all 0.3s;
}

.card-light:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
    border-color: rgba(139,0,0,0.1);
}

.group-header {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 15px;
}

.group-card h3 {
    font-size: 17px;
    margin-bottom: 10px;
    color: var(--primary);
}

.group-card p {
    font-size: 13.5px;
    color: #666;
}

/* Contact us page styling */
.contact-section {
    padding: 80px 0;
}

.contact-info-block {
    display: flex;
    margin-bottom: 25px;
}

.info-icon {
    font-size: 26px;
    color: var(--primary);
    margin-right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(139,0,0,0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.info-text h3 {
    font-size: 16px;
    margin-bottom: 5px;
}

.info-text p {
    font-size: 14.5px;
    color: #555;
    line-height: 1.5;
}

.map-container {
    height: 100%;
    min-height: 400px;
}

.form-card {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--card-shadow);
}

.form-intro {
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 30px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #444;
}

.required { color: #e74c3c; }

.form-group input[type="text"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    outline: none;
    font-family: var(--font-thai);
    font-size: 14.5px;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(139, 0, 0, 0.1);
}

.btn-submit {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    font-family: var(--font-thai);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-submit:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(139,0,0,0.25);
}

.hotline-card {
    background: linear-gradient(135deg, #700016 0%, #1A1D20 100%);
    border-radius: 20px;
    padding: 50px 40px;
    color: #fff;
    display: flex;
    align-items: center;
}

.hotline-icon {
    font-size: 50px;
    color: var(--accent);
    margin-bottom: 20px;
}

.hotline-header h2 {
    color: #fff;
    font-size: 26px;
}

.hotline-header p {
    font-family: var(--font-eng);
    font-size: 14px;
    color: var(--accent);
    margin-bottom: 25px;
}

.hotline-body p {
    font-size: 14.5px;
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 25px;
}

.btn-hotline {
    display: block;
    background: var(--accent);
    color: #4a000e;
    padding: 12px 25px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 4px 15px rgba(212,175,55,0.25);
}

.btn-hotline:hover {
    background: #fff;
    color: var(--primary);
    transform: translateY(-2px);
}

/* Alert Boxes */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-size: 14.5px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

.alert-danger {
    background-color: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}

.alert-info {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #ddd;
    font-size: 13.5px;
}

/* Document download section */
.downloads-list {
    padding: 10px 30px;
    background: #fff;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
}

.download-item {
    display: flex;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #f0f2f5;
}

.download-item:last-child {
    border-bottom: none;
}

.dl-icon {
    font-size: 32px;
    margin-right: 25px;
}

.pdf-color { color: #e74c3c; }
.word-color { color: #2b579a; }

.dl-info {
    flex-grow: 1;
}

.dl-info h4 {
    font-size: 16px;
    margin-bottom: 5px;
}

.dl-info p {
    font-size: 13px;
    color: var(--gray);
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #ccc;
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 13.5px;
    color: #555;
}

.btn-download:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Footer styling */
.main-footer {
    background-color: #1A1D20;
    color: #bbb;
    padding: 60px 0 0;
    font-size: 14px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 40px;
    padding-bottom: 40px;
}

.brand-col .footer-logo {
    height: 64px;
    width: auto;
    max-width: 280px;
    object-fit: contain;
    margin-bottom: 20px;
    filter: brightness(0) invert(1);
}

.footer-desc {
    font-weight: 300;
    line-height: 1.5;
    margin-bottom: 25px;
}

.social-links {
    display: flex;
    gap: 14px;
    margin-top: 20px;
}

.social-links a {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.15rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    box-sizing: border-box;
}

/* Facebook Brand Styling */
.social-links a.social-fb {
    background: linear-gradient(135deg, #1877f2 0%, #0866ff 100%);
    box-shadow: 0 4px 14px rgba(24, 119, 242, 0.4);
}
.social-links a.social-fb:hover {
    transform: translateY(-4px) scale(1.12);
    box-shadow: 0 8px 22px rgba(24, 119, 242, 0.7);
    color: #ffffff;
}

/* YouTube Brand Styling */
.social-links a.social-yt {
    background: linear-gradient(135deg, #ff0000 0%, #c0392b 100%);
    box-shadow: 0 4px 14px rgba(255, 0, 0, 0.4);
}
.social-links a.social-yt:hover {
    transform: translateY(-4px) scale(1.12);
    box-shadow: 0 8px 22px rgba(255, 0, 0, 0.7);
    color: #ffffff;
}

/* LINE Brand Styling */
.social-links a.social-line {
    background: linear-gradient(135deg, #06c755 0%, #00b900 100%);
    box-shadow: 0 4px 14px rgba(6, 199, 85, 0.4);
}
.social-links a.social-line:hover {
    transform: translateY(-4px) scale(1.12);
    box-shadow: 0 8px 22px rgba(6, 199, 85, 0.7);
    color: #ffffff;
}

.footer-col h3 {
    color: #fff;
    font-size: 16px;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-col h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 35px;
    height: 2px;
    background: var(--accent);
}

.links-col ul {
    list-style: none;
}

.links-col ul li {
    margin-bottom: 10px;
}

.links-col ul li a:hover {
    color: var(--accent);
    padding-left: 5px;
}

.contact-col p {
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.footer-icon {
    color: var(--accent);
    margin-top: 4px;
}

.footer-bottom {
    background-color: #121416;
    border-top: 1px solid rgba(255,255,255,0.04);
    padding: 20px 0;
    text-align: center;
    font-size: 13px;
    font-weight: 300;
}

.footer-bottom a {
    color: var(--accent);
}

/* Modal Popup window for News details */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: #fff;
    width: 90%;
    max-width: 750px;
    max-height: 85vh;
    border-radius: 20px;
    overflow-y: auto;
    box-shadow: 0 15px 50px rgba(0,0,0,0.3);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    z-index: 10;
    transition: background 0.3s;
}

.modal-close:hover {
    background: var(--primary);
}

.modal-image {
    display: none !important;
}

.modal-body {
    padding: 35px;
}

.modal-meta {
    font-size: 12.5px;
    color: var(--gray);
    margin-bottom: 12px;
}

.modal-title {
    font-size: 22px;
    margin-bottom: 20px;
    line-height: 1.4;
    color: var(--primary);
}

.modal-desc {
    font-size: 16px;
    color: #334155;
    line-height: 1.75;
    white-space: normal;
    font-weight: 400;
}

/* Animations CSS */
.animate-text {
    animation: fadeInUp 0.8s forwards;
}

.animate-btn {
    animation: fadeInUp 0.8s 0.3s forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive media queries */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    .brand-col {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .logo-area img {
        height: 50px;
        max-width: 230px;
    }
    
    .main-nav {
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        height: calc(100vh - 80px);
        background: #fff;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        padding: 40px 20px;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px);
        transition: all 0.3s ease;
    }
    
    .main-header.scrolled .main-nav {
        top: 65px;
        height: calc(100vh - 65px);
        background: #700016;
    }
    
    .main-nav.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .nav-link {
        font-size: 17px;
        border-bottom: 1px solid #f0f2f5;
        padding: 10px 5px;
    }
    
    .main-header.scrolled .nav-link {
        border-bottom-color: rgba(255,255,255,0.08);
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        border: none;
        transform: none;
        padding-left: 20px;
        background: rgba(0, 0, 0, 0.02);
        margin-top: 5px;
    }
    
    .main-header.scrolled .dropdown-menu {
        background: rgba(255, 255, 255, 0.03);
    }
    
    .main-header.scrolled .dropdown-menu li a {
        color: #eee;
    }
    
    .hero-carousel {
        aspect-ratio: 1970 / 720;
        height: auto;
        margin-top: 80px;
    }
    
    .overlay-content h2 {
        font-size: 26px;
    }
    
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .course-card-horizontal, .course-card-horizontal.h-reverse {
        flex-direction: column;
    }
    
    .course-h-image {
        width: 100%;
        padding: 30px;
    }
    
    .course-h-body {
        width: 100%;
        padding: 30px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .page-section-nav {
        top: 80px;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .page-section-nav .container {
        display: flex;
    }
}

/* ============================================================
   CALENDAR & BOOKING SYSTEM STYLES
   ============================================================ */

.cal-hero {
    background: linear-gradient(135deg, #8B0000 0%, #4A0000 100%);
    color: #fff;
    padding: 50px 0;
    margin-bottom: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
.cal-hero-rooms {
    background: linear-gradient(135deg, #1A365D 0%, #0D1B2A 100%);
}
.cal-hero-vans {
    background: linear-gradient(135deg, #1C453B 0%, #0F2822 100%);
}

.cal-hero-content {
    display: flex;
    align-items: center;
    gap: 24px;
}

.cal-hero-icon {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #D4AF37;
    flex-shrink: 0;
}

.cal-hero-title {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.cal-hero-sub {
    font-size: 0.95rem;
    opacity: 0.85;
    margin-top: 4px;
    font-weight: 300;
}

.section-cal {
    padding-bottom: 60px;
}

.cal-layout {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 30px;
    align-items: start;
}

@media (max-width: 992px) {
    .cal-layout {
        grid-template-columns: 1fr;
    }
}

.cal-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
}

.cal-card:hover {
    box-shadow: 0 16px 45px rgba(139, 0, 0, 0.08);
}

/* Glassmorphic Navigation Header */
.cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 16px 22px;
    background: linear-gradient(135deg, #1c1e22 0%, #2b1418 100%);
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.cal-month-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: 0.3px;
}
.cal-month-title i {
    color: var(--accent);
    font-size: 1.2rem;
}

.cal-nav-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
}
.cal-nav-btn:hover {
    background: var(--accent);
    color: #1a1d20;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 15px rgba(212, 175, 55, 0.4);
    border-color: var(--accent);
}

/* Calendar Grid */
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.cal-dayname {
    text-align: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #4a5568;
    padding: 10px 0;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #edf2f7;
}

.cal-dayname.weekend {
    color: var(--primary);
    background: #fff5f5;
    border-color: #fed7d7;
}

/* Day Cells */
.cal-cell {
    min-height: 95px;
    border-radius: 14px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.cal-cell:not(.cal-empty):hover {
    background: #ffffff;
    border-color: var(--accent);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.22);
    transform: translateY(-4px);
    cursor: pointer;
    z-index: 5;
}

.cal-empty {
    background: transparent;
    border: none;
    box-shadow: none;
}

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

.cal-day-num {
    font-weight: 700;
    font-size: 1rem;
    color: #2d3748;
    line-height: 1;
}

/* Today Cell Highlight */
.cal-today {
    background: linear-gradient(135deg, #fff9f9 0%, #fff0f0 100%);
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(139, 0, 0, 0.12);
}
.cal-today .cal-day-num {
    color: var(--primary);
    font-weight: 800;
}
.today-tag {
    font-size: 0.65rem;
    font-weight: 700;
    background: var(--primary);
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 6px;
}

/* ============================================================
   BORDERED CALENDAR TABLE GRID (ตารางช่องปฏิทิน)
   ============================================================ */

.calendar-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

table.calendar-month-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    table-layout: fixed;
}

table.calendar-month-table th {
    background: #f8fafc;
    color: #334155;
    padding: 12px 6px;
    font-weight: 700;
    font-size: 0.88rem;
    text-align: center;
    border: 1px solid #cbd5e1;
    text-transform: uppercase;
}

table.calendar-month-table th.weekend {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fca5a5;
}

table.calendar-month-table td {
    width: 14.28%;
    height: 95px;
    border: 1px solid #cbd5e1;
    vertical-align: top;
    padding: 8px;
    transition: all 0.2s ease;
    position: relative;
}

table.calendar-month-table td.cal-day-td:hover {
    background: #fffdf5;
    cursor: pointer;
    box-shadow: inset 0 0 0 2px var(--accent);
}

table.calendar-month-table td.cal-empty-td {
    background: #f8fafc;
    background-image: repeating-linear-gradient(45deg, #f1f5f9 0, #f1f5f9 1px, transparent 0, transparent 50%);
    background-size: 10px 10px;
    border: 1px solid #e2e8f0;
}

table.calendar-month-table td.cal-today-td {
    background: #fff5f5;
    border: 2px solid #991b1b !important;
}

table.calendar-month-table td.cal-selected-td {
    background: #fffdf5 !important;
    border: 2.5px solid var(--accent) !important;
}


/* ============================================================
   DATE SCHEDULE TABLE STYLES (ตารางรายการวันที่)
   ============================================================ */

.view-mode-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.view-mode-toggle {
    display: inline-flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.btn-view-mode {
    padding: 8px 16px;
    border-radius: 9px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #64748b;
    border: none;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-view-mode:hover {
    color: #1e293b;
}

.btn-view-mode.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Date Table Container */
.date-schedule-container {
    width: 100%;
    overflow-x: auto;
    border-radius: 14px;
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.date-schedule-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: #ffffff;
}

.date-schedule-table thead tr {
    background: linear-gradient(135deg, #1c1e22 0%, #2b1418 100%);
    color: #ffffff;
    text-align: left;
}

.date-schedule-table th {
    padding: 14px 18px;
    font-weight: 700;
    font-size: 0.88rem;
    letter-spacing: 0.3px;
}

.date-schedule-table th:first-child {
    border-top-left-radius: 12px;
}
.date-schedule-table th:last-child {
    border-top-right-radius: 12px;
}

.date-schedule-table td {
    padding: 14px 18px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}

.date-schedule-table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

.date-schedule-table tbody tr:hover {
    background-color: #fffdf5;
}

.date-pill-cell {
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.time-pill-cell {
    font-size: 0.82rem;
    color: #64748b;
    font-weight: 500;
    white-space: nowrap;
}

.title-cell strong {
    color: #0f172a;
    font-size: 0.95rem;
    display: block;
}
.title-cell span {
    font-size: 0.8rem;
    color: #64748b;
}

    line-height: 1;
}

/* Selected Cell Ring */
.cal-selected {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.4), 0 8px 20px rgba(0,0,0,0.08) !important;
    background: #fffdf5 !important;
}

/* Event & Booking Chips inside Day Cell */
.cal-chips {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
}

.cal-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 6px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: transform 0.15s ease;
    background: #f1f5f9;
    color: #334155;
}

.cal-chip:hover {
    transform: scale(1.03);
}

.cal-chip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.chip-approved {
    background: #e0f2fe;
    color: #0369a1;
}
.chip-pending {
    background: #ffedd5;
    color: #c2410c;
}
.chip-event {
    background: #fdf4ff;
    color: #7e22ce;
}

.cal-more-count {
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748b;
    margin-top: 2px;
}

/* Calendar Legend Footer */
.cal-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 24px;
    padding: 14px 20px;
    background: #f8fafc;
    border-radius: 14px;
    border: 1px solid #edf2f7;
    font-size: 0.85rem;
    color: #475569;
}
.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}


.cal-dots {
    display: flex;
    gap: 4px;
    margin-top: auto;
}

.cal-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

.cal-legend {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #edf2f7;
    font-size: 0.85rem;
    color: var(--gray);
}
.legend-today {
    color: var(--primary);
    font-weight: 600;
}

/* Event List Sidebar */
.cal-list-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2d3748;
}

.cal-event-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 4px;
}

.cal-event-item {
    display: flex;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #edf2f7;
    transition: all 0.2s ease;
}

.cal-event-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    background: #fff;
}

.event-color-bar {
    width: 6px;
    flex-shrink: 0;
}

.event-info {
    display: flex;
    gap: 14px;
    padding: 14px;
    flex-grow: 1;
    align-items: center;
}

.event-date-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 6px 12px;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary);
    line-height: 1;
    min-width: 50px;
}
.event-date-badge span {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--gray);
    margin-top: 2px;
}

.event-details strong {
    display: block;
    font-size: 0.95rem;
    color: #1a202c;
    margin-bottom: 4px;
}

.event-location, .event-time {
    display: inline-block;
    font-size: 0.8rem;
    color: #718096;
    margin-right: 12px;
}

.event-desc {
    font-size: 0.82rem;
    color: #4a5568;
    margin-top: 6px;
    line-height: 1.4;
}

.cal-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #a0aec0;
}
.cal-empty-state i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* Booking Forms */
.booking-form-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #edf2f7;
}
.booking-form-header h2 {
    font-size: 1.25rem;
    margin: 0;
}
.rooms-header i { color: #2B6CB0; font-size: 1.4rem; }
.vans-header i  { color: #276749; font-size: 1.4rem; }

.booking-form .bf-group {
    margin-bottom: 18px;
}

.booking-form label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 6px;
}
.booking-form label i {
    color: var(--gray);
    font-size: 0.85rem;
}
.booking-form label .req {
    color: var(--primary);
}

.booking-form input[type="text"],
.booking-form input[type="number"],
.booking-form input[type="date"],
.booking-form input[type="time"],
.booking-form select,
.booking-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.92rem;
    outline: none;
    font-family: inherit;
    transition: all 0.2s ease;
    background: #fdfdfd;
}

.booking-form input:focus,
.booking-form select:focus,
.booking-form textarea:focus {
    border-color: #2B6CB0;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.12);
}

.bf-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.btn-booking {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
    font-family: inherit;
    margin-top: 10px;
}

.rooms-btn {
    background: linear-gradient(135deg, #2B6CB0 0%, #1A365D 100%);
    box-shadow: 0 4px 15px rgba(43, 108, 176, 0.3);
}
.rooms-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(43, 108, 176, 0.4);
}

.vans-btn {
    background: linear-gradient(135deg, #276749 0%, #1C453B 100%);
    box-shadow: 0 4px 15px rgba(39, 103, 73, 0.3);
}
.vans-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 103, 73, 0.4);
}

/* Alert Boxes */
.cal-alert {
    padding: 14px 20px;
    border-radius: 10px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}
.cal-alert-success { background: #C6F6D5; color: #22543D; border: 1px solid #9AE6B4; }
.cal-alert-error   { background: #FED7D7; color: #742A2A; border: 1px solid #FEB2B2; }

/* Timelines */
.booking-timeline {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.timeline-item {
    display: flex;
    gap: 16px;
    padding: 14px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #cbd5e0;
}
.rooms-timeline { border-left-color: #2B6CB0; }
.vans-timeline  { border-left-color: #276749; }

.timeline-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 8px;
    padding: 6px 12px;
    min-width: 50px;
    border: 1px solid #e2e8f0;
}
.timeline-date strong { font-size: 1.1rem; color: #2d3748; }
.timeline-date span   { font-size: 0.7rem; color: #718096; }

.timeline-content .timeline-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #1a202c;
    margin-bottom: 4px;
}
.timeline-meta {
    font-size: 0.8rem;
    color: #718096;
    margin: 2px 0;
}

.booking-pending-item {
    padding: 12px 14px;
    background: #fffaf0;
    border: 1px solid #feebc8;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.status-badge {
    align-self: flex-start;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
}
.status-badge.pending { background: #FEEBC8; color: #C05621; }

/* Van Status Grid */
.van-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}
.van-status-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    text-align: center;
}
.van-status-card.available { background: #f0fff4; border-color: #9ae6b4; }
.van-status-card.booked    { background: #fff5f5; border-color: #feb2b2; }

.van-icon { font-size: 1.6rem; margin-bottom: 8px; }
.available .van-icon { color: #276749; }
.booked .van-icon    { color: #c53030; }

.van-name { font-weight: 600; font-size: 0.85rem; color: #2d3748; }
.van-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 6px;
}
.available .van-badge { background: #c6f6d5; color: #22543d; }
.booked .van-badge    { background: #fed7d7; color: #742a2a; }

/* Read All Section Buttons */
.btn-read-all-section {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--primary), #991b1b);
    color: #fff !important;
    font-weight: 700;
    font-size: 0.92rem;
    text-decoration: none;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(139,0,0,0.22);
    transition: all 0.3s ease;
}
.btn-read-all-section:hover {
    background: linear-gradient(135deg, #7f1d1d, #831843);
    color: #fde047 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139,0,0,0.35);
}
.btn-read-all-procure {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    box-shadow: 0 4px 15px rgba(2,132,199,0.22);
}
.btn-read-all-procure:hover {
    background: linear-gradient(135deg, #0369a1, #075985);
    color: #bae6fd !important;
    box-shadow: 0 6px 20px rgba(2,132,199,0.35);
}

