:root {
    /* ARIT Logo Branding Colors - Custom Hexes */
    --arit-blue: #0091BE;
    /* สีนำ: Cyan/Blue (used for active/primary) */
    --arit-gold: #0091BE;
    --arit-gold-hover: #007ba1;
    /* Hover state for Cyan */
}

html {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
    background-color: #0091BE;
}

html,
body {
    margin: 0 !important;
    padding: 0 !important;
}

body {
    font-family: 'Prompt', sans-serif;
    background-color: #f4f6f9;
    overflow-x: hidden;
}

footer {
    margin: 0 !important;
    padding-bottom: 0 !important;
    display: block;
}

/* Zero out wrapper padding around footer */
.container-fluid:has(> footer),
.container-fluid:has(> footer) {
    padding: 0 !important;
    margin: 0 !important;
}

footer~.container-fluid,
div>footer {
    margin: 0 !important;
}

/* Layer 1: Announcement Bar */
.announcement-bar-wrapper {
    background-color: var(--arit-blue);
}

.announcement-bar {
    display: flex;
    height: 45px;
    width: 100%;
}

.announcement-badge {
    display: none;
}

.announcement-content {
    background-color: var(--arit-blue);
    color: #fff;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 15px;
    font-size: 13px;
    font-weight: 500;
}

.navbar-brand {
    margin-right: 15px;
    padding: 0;
}

header.fixed-top {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1050 !important;
    background: #fff;
    transition: all 0.3s ease;
    width: 100%;
}

header.fixed-top.scrolled {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.navbar-custom {
    background: #fff;
    padding: 15px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

header.fixed-top.scrolled .navbar-custom {
    padding: 10px 0;
    border-bottom: none;
}

.navbar-custom .nav-link {
    color: var(--arit-blue);
    font-weight: 600;
    margin: 0 4px;
    font-size: 16px;
    padding: 8px 16px !important;
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.navbar-custom .nav-link:hover {
    color: var(--arit-blue) !important;
    background-color: rgba(0, 145, 190, 0.08);
    transform: translateY(-2px);
}


.navbar-brand img {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.05));
    transition: transform 0.3s ease;
}

.navbar-custom:hover .navbar-brand img {
    transform: scale(1.05);
}

/* Layer 3: Hero Section */
.hero-section {
    background-size: cover;
    background-position: center;
    color: white;
    min-height: 65vh;
    padding: 120px 20px 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

@media (max-width: 768px) {
    .hero-section {
        padding-top: 100px;
    }
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
    font-family: 'Kanit', sans-serif;
    letter-spacing: -0.5px;
}

.hero-subtitle {
    font-size: 1rem;
    font-weight: 400;
    margin-bottom: 20px;
    max-width: 750px;
    text-align: center;
    line-height: 1.4;
    opacity: 0.95;
}

/* Search Area */
.search-container {
    max-width: 850px;
    width: 100%;
    margin-bottom: 40px;
}

.search-options {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
}

.form-check-input {
    width: 1.2em;
    height: 1.2em;
    cursor: pointer;
}

.form-check-label {
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--arit-gold);
    border-color: var(--arit-gold);
}

.search-input-group {
    display: flex;
    background: #fff;
    border-radius: 50px;
    overflow: hidden;
    padding: 6px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
    transition: all 0.3s ease;
}

.search-input-group:focus-within {
    transform: scale(1.01);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.search-dropdown {
    border: none;
    background: #fff;
    padding: 12px 25px;
    font-weight: 600;
    color: var(--arit-blue);
    border-right: 1px solid #f0f0f0;
    outline: none;
    font-size: 16px;
}

.search-input {
    border: none;
    padding: 12px 25px;
    flex-grow: 1;
    outline: none;
    font-size: 16px;
    color: var(--arit-blue);
    font-weight: 500;
}

.search-btn {
    background: var(--arit-gold);
    color: white;
    border: none;
    padding: 0 45px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.3s;
}

.search-btn:hover {
    background: var(--arit-gold-hover);
    transform: scale(1.05);
}

/* Layer 4: Glass Panel with Cards */
.glass-panel {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 20px 25px;
    max-width: 800px;
    width: 100%;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.panel-header h6 {
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
}

.info-card {
    border-radius: 8px;
    padding: 15px;
    color: var(--arit-blue);
    text-align: center;
    height: 100%;
}

.card-light {
    background: #f8f9fa;
    text-align: left;
}

.card-yellow {
    background: #fff3cd;
}

.card-green {
    background: #d1e7dd;
}

.stat-num {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    margin: 10px 0;
    font-family: 'Kanit', sans-serif;
}

.portals-section {
    padding: 20px 0;
}

/* Premium Card Styling */
.portal-item-card {
    background: #fff;
    border-radius: 18px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    position: relative;
}

.portal-item-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.8) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-20deg) translateX(-150%);
    transition: all 0.6s ease;
    z-index: 2;
    pointer-events: none;
}

.portal-img-wrapper {
    background: linear-gradient(to bottom, #f8f9fc 0%, #fff 100%);
    padding: 25px 15px 15px;
    text-align: center;
    position: relative;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.05);
}

.portal-img-wrapper img {
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.08));
}

.card-icon-arrow {
    position: absolute;
    right: 20px;
    bottom: 20px;
    width: 36px;
    height: 36px;
    background-color: #f8f9fa;
    color: var(--arit-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateX(-15px);
}

.portal-item-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 20px 45px rgba(0, 145, 190, 0.12);
    border-color: rgba(0, 145, 190, 0.1);
}

.portal-item-card:hover::before {
    transform: skewX(-20deg) translateX(150%);
}

.portal-item-card:hover .portal-img-wrapper img {
    transform: scale(1.12) translateY(-5px);
    filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.15));
}

.portal-item-card:hover .card-icon-arrow {
    opacity: 1;
    transform: translateX(0);
    background-color: var(--arit-gold);
    color: #fff;
}

/* Badges */
.portal-badge {
    background-color: rgba(0, 145, 190, 0.08);
    color: var(--arit-gold);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

/* Shortcut Cards */
.shortcut-card {
    background: #fff;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.02);
    padding: 35px 20px;
    text-align: left;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.shortcut-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.05);
}

.shortcut-icon-wrapper {
    color: var(--arit-blue);
    font-size: 42px;
    margin-bottom: 20px;
    line-height: 1;
    transition: transform 0.3s ease;
}

.shortcut-card:hover .shortcut-icon-wrapper {
    transform: scale(1.05);
}

.shortcut-title {
    font-weight: 700;
    font-size: 18px;
    color: #1a1a1a;
    margin-bottom: 15px;
    line-height: 1.3;
}

.shortcut-desc {
    font-size: 13px;
    color: #6c757d;
    line-height: 1.7;
    margin-bottom: 0;
}

/* Buttons based on theme */
.btn-theme-primary {
    background-color: var(--arit-blue);
    color: white;
    border: none;
}

.btn-theme-primary:hover {
    background-color: #002244;
    color: white;
}

.btn-theme-outline:hover {
    background-color: var(--arit-blue);
    color: white;
}

/* Layer 4: News & Research */
.section-header {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

.section-header::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 40px;
    background-color: var(--arit-blue);
    border-radius: 3px;
}

.news-carousel-inner {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.carousel-item img {
    height: 400px;
    object-fit: cover;
}

.carousel-caption-custom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 40px 20px 20px;
    text-align: left;
}

.research-link-card {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 12px;
    padding: 15px 20px;
    transition: all 0.3s ease;
    text-decoration: none;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    margin-bottom: 15px;
    height: 85px;
}

.research-link-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.08);
}

.research-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-right: 15px;
    color: #fff;
    flex-shrink: 0;
}

.research-text {
    flex-grow: 1;
    overflow: hidden;
}

.research-text h6 {
    margin: 0;
    font-weight: 700;
    color: #1a1a1a;
    font-size: 18px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.research-text small {
    color: #6c757d;
    font-size: 12px;
    display: block;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* Layer 5: Spaces and Services Gallery */
.spaces-gallery {
    display: flex;
    height: 400px;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    gap: 2px;
}

.space-item {
    position: relative;
    flex: 1;
    min-width: 0;
    cursor: pointer;
    transition: all 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.space-item:hover {
    flex: 4;
}

.space-overlay {
    position: absolute;
    inset: 0;
    mix-blend-mode: multiply;
    transition: opacity 0.4s ease;
}

.space-item:hover .space-overlay {
    opacity: 0.7;
}

.space-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    color: #fff;
    transform: translateY(40px);
    opacity: 0;
    transition: all 0.5s ease;
    white-space: nowrap;
}

.space-item:hover .space-content {
    transform: translateY(0);
    opacity: 1;
}

.space-content h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.space-content p {
    font-size: 14px;
    margin-bottom: 0;
    opacity: 0.9;
}

/* Mobile specific styling for gallery to stack instead of horizontal flex */
@media (max-width: 768px) {
    .spaces-gallery {
        flex-direction: column;
        height: 800px;
    }

    .space-item {
        flex: 1;
        transition: flex 0.4s ease;
        min-height: 100px;
    }

    .space-item:hover {
        flex: 3;
    }
}

/* Horizontal Scroll Slider styling */
.custom-slider-container {
    display: flex;
    padding-bottom: 20px;
    margin-bottom: -20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    gap: 1.5rem;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.custom-slider-container::-webkit-scrollbar {
    display: none;
}

.slide-item {
    flex: 0 0 calc(20% - 1.2rem);
    scroll-snap-align: start;
}

@media (max-width: 991px) {
    .slide-item {
        flex: 0 0 calc(25% - 1.125rem);
    }
}

@media (max-width: 767px) {
    .slide-item {
        flex: 0 0 calc(50% - 0.75rem);
    }
}

/* Layer 6: Book Carousel styling */
.book-card {
    border: none;
    background: transparent;
    text-align: center;
    padding: 8px;
    transition: transform 0.3s ease;
}

.book-card:hover {
    transform: translateY(-8px);
    filter: brightness(1.05);
}

.book-card:active {
    transform: scale(0.95) translateY(-4px);
    opacity: 0.85;
}

.book-cover {
    height: 240px;
    width: 100%;
    object-fit: contain;
    background-color: transparent;
    border-radius: 4px;
    margin-bottom: 12px;
    display: block;
}

.book-cover::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 10px;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.3) 0%, rgba(255, 255, 255, 0.4) 30%, transparent 100%);
    border-radius: 4px 0 0 4px;
}

.book-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    line-height: 1.4;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.custom-carousel-btn {
    width: 50px;
    height: 50px;
    background: transparent;
    border: none;
    outline: none;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 35%;
    transform: translateY(-50%);
    z-index: 10;
    transition: color 0.3s ease;
    opacity: 0.8;
}

.custom-carousel-btn i {
    font-size: 3.5rem;
}

.custom-carousel-btn:hover {
    color: #000;
    opacity: 1;
}

.custom-carousel-prev {
    left: -50px;
}

.custom-carousel-next {
    right: -50px;
}