:root {
    --color-primary: #002147;
    /* Deep Navy Blue */
    --color-accent: #FBBF24;
    /* Golden Yellow */
    --color-accent-hover: #F59E0B;
    --color-bg: #FFFFFF;
    --color-text: #4A4A4A;
    /* Dark Gray */
    --color-text-light: #6B7280;
    --color-surface: #F0F4F8;
    /* Soft ice blue to contrast with pure white */

    --font-main: 'Anuphan', sans-serif;

    --transition-fast: 0.2s ease;
    --transition-medium: 0.4s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.75;
    overflow-x: hidden;
    letter-spacing: 0.2px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--color-primary);
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

ul {
    list-style: none;
}

@keyframes float-bg-icon {
    0% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(5deg);
    }

    100% {
        transform: translateY(0) rotate(0deg);
    }
}

.floating-bg-icon {
    position: absolute;
    color: var(--color-primary);
    opacity: 0.04;
    z-index: 0;
    pointer-events: none;
    animation: float-bg-icon 8s ease-in-out infinite;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15vw;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    text-align: center;
}

.btn-accent {
    background-color: var(--color-accent);
    color: var(--color-primary);
}

.btn-accent:hover {
    background-color: var(--color-accent-hover);
    box-shadow: 0 4px 12px rgba(249, 185, 24, 0.4);
}

.btn-outline {
    background-color: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-outline:hover {
    background-color: var(--color-primary);
    color: white;
    transform: translateY(-2px);
}

.section {
    padding: 100px 0;
}

/* Scroll Animation Classes */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: transparent;
    z-index: 1000;
    transition: all var(--transition-fast);
    border-bottom: 1px solid transparent;
}

header.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.top-bar {
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
    max-height: 60px;
    overflow: hidden;
}

header.scrolled .top-bar {
    max-height: 0;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    opacity: 0;
    border-bottom: none !important;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    transition: height var(--transition-fast);
}

header.scrolled .nav-wrapper {
    height: 70px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -0.5px;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-menu li a {
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-primary);
}

.nav-menu li a:hover {
    color: var(--color-accent-hover);
}

/* Dropdown Menu Styles */
.nav-menu li {
    position: relative;
}

.has-dropdown>a {
    display: flex;
    align-items: center;
    gap: 4px;
}

.arrow {
    font-size: 0.6rem;
    transition: transform 0.3s ease;
}

.has-dropdown:hover .arrow {
    transform: rotate(180deg);
}

.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #FFFFFF;
    min-width: 220px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    padding: 10px 0;
    z-index: 1000;
}

.has-dropdown:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown li {
    width: 100%;
}

.dropdown li a {
    padding: 10px 20px;
    display: block;
    font-weight: 400;
    color: var(--color-text);
}

.dropdown li a:hover {
    background-color: var(--color-surface);
    color: var(--color-primary);
}

.nav-actions {
    display: flex;
    align-items: center;
}

.hamburger {
    display: none;
    background-color: var(--color-primary);
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 8px 10px;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0, 33, 71, 0.15);
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: white;
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 180px;
    /* Offset for fixed header */
    background: #000;
    overflow: hidden;
}

.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translateX(-50%) translateY(-50%);
    object-fit: cover;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.3) 100%);
    /* Dynamic gradient instead of flat white */
    z-index: 1;
}

.hero-content {
    position: relative;
    max-width: 750px;
    margin: 0 auto;
    text-align: center;
    z-index: 2;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 2rem;
    letter-spacing: -1px;
}

.hero-title {
    font-size: 5rem !important;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary) 0%, #1a4b8c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--color-primary);
    /* fallback */
    margin-bottom: 0.5rem;
    filter: drop-shadow(0px 4px 12px rgba(0, 0, 0, 0.4)) drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.4));
    /* Glow effect to stand out against background */
    letter-spacing: -1px;
    display: inline-block;
}

.hero-subtitle {
    font-size: 3rem;
    font-weight: 600;
    color: #4A4A4A;
    text-transform: uppercase;
    letter-spacing: 12px;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.05);
}

.hero p {
    font-size: 1.125rem;
    font-weight: 400;
    margin-bottom: 2rem;
    color: var(--color-text);
}

.hero .btn {
    margin-top: 2rem;
    padding: 16px 36px;
    font-size: 1.1rem;
}

/* Intro Card Section */
.intro-card {
    padding: 3rem 1rem 1rem;
    display: flex;
    align-items: center;
    gap: 4rem;
    max-width: 1100px;
    margin: 0 auto;
}

.intro-text {
    flex: 1.2;
}

.intro-text p {
    font-size: 1.1rem;
    color: var(--color-text);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.intro-text p:last-child {
    margin-bottom: 0;
}

.intro-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Why U-BIS */
.why-ubis {
    background-color: var(--color-bg);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}
@media (max-width: 1200px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 900px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
}

.feature-card {
    background-color: #F8FAFC;
    padding: 1.5rem;
    border-radius: 24px;
    transition: all var(--transition-medium);
    border: 1px solid rgba(0, 33, 71, 0.04);
    text-align: left;
    box-shadow: 0 10px 30px rgba(0, 33, 71, 0.03);
    display: flex;
    flex-direction: column;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 33, 71, 0.08);
    border-color: rgba(0, 33, 71, 0.08);
}

.feature-image {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    aspect-ratio: 4 / 3;
    position: relative;
}

.feature-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.feature-card:hover .feature-image img {
    transform: scale(1.05);
}

.feature-card h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    line-height: 1.3;
    font-weight: 700;
}

.feature-card p {
    font-weight: 400;
    font-size: 0.95rem;
    color: var(--color-text);
    line-height: 1.6;
    margin-bottom: 0;
}

/* Academic Pathways */
.pathways {
    background-color: var(--color-bg);
}

.pathways-grid {
    display: flex;
    flex-direction: column;
    gap: 8rem;
    margin-top: 4rem;
}

.pathway-item {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.pathway-image {
    width: 65%;
    aspect-ratio: 16 / 10;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    z-index: 1;
    box-shadow: 0 10px 30px rgba(0, 33, 71, 0.1);
}

.pathway-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--transition-medium);
}

.pathway-item:hover .pathway-image img {
    transform: scale(1.03);
}

.pathway-content {
    background-color: var(--color-bg);
    padding: 3.5rem 3rem;
    box-shadow: 0 25px 50px rgba(0, 33, 71, 0.08);
    position: absolute;
    right: 0;
    width: 45%;
    border-radius: 20px;
    z-index: 2;
    border: 1px solid rgba(0, 33, 71, 0.03);
}

/* Alternate layout for even items */
.pathway-item:nth-child(even) {
    justify-content: flex-end;
}

.pathway-item:nth-child(even) .pathway-image {
    order: 2;
}

.pathway-item:nth-child(even) .pathway-content {
    left: 0;
    right: auto;
}

.pathway-content h2 {
    font-size: 2.2rem;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    position: relative;
}

/* Separator Line */
.pathway-content h2::after {
    content: "";
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--color-accent);
    margin-top: 1.2rem;
    border-radius: 2px;
}

.pathway-content .subtitle {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--color-primary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.pathway-content p {
    font-size: 1rem;
    color: var(--color-text);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.btn-navy {
    display: inline-block;
    background-color: var(--color-primary);
    color: white;
    padding: 12px 32px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.btn-navy:hover {
    background-color: #00122a;
}

/* Admission Section */
.admission-banner {
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 33, 71, 0.15);
    width: calc(100% + 20vw);
    margin-left: -10vw;
    margin-right: -10vw;
    border-radius: 24px;
}
@media (max-width: 992px) {
    .admission-banner {
        width: calc(100% + 12vw);
        margin-left: -6vw;
        margin-right: -6vw;
    }
}
@media (max-width: 768px) {
    .admission-banner {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        border-radius: 16px;
    }
}

.admission-banner-text {
    position: absolute;
    bottom: 0;
    left: 0;
    background-color: var(--color-primary);
    color: white;
    padding: 2rem 4rem;
    width: 60%;
    text-align: left;
    box-sizing: border-box;
    border-top-right-radius: 40px;
    border-bottom-left-radius: 24px;
}

.polaroid {
    position: absolute;
    background: white;
    padding: 10px 10px 30px 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 5;
    border-radius: 2px;
}

.polaroid img {
    width: 100%;
    height: auto;
    display: block;
}

.polaroid-1 {
    width: 28%;
    right: 5%;
    bottom: 25%;
    transform: rotate(-4deg);
}

.polaroid-2 {
    width: 30%;
    right: 2%;
    bottom: -10%;
    transform: rotate(3deg);
    z-index: 6;
}

/* Footer */
footer {
    background-color: var(--color-primary);
    color: white;
    padding: 80px 0 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 6rem;
    margin-bottom: 4rem;
}

.footer-info h2 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.footer-info p {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
    font-size: 1.1rem;
    max-width: 500px;
}

.footer-links-container {
    display: flex;
    gap: 4rem;
}

.footer-col h4 {
    color: var(--color-accent);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.footer-col ul {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-col a {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
    font-size: 0.9rem;
}

.footer-col a:hover {
    color: var(--color-accent);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    font-weight: 400;
}

/* Responsive Design */
@media (max-width: 992px) {
    .hero h1 {
        font-size: 3rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }

    .hamburger {
        display: flex;
        z-index: 1001;
        align-self: center !important;
        margin-bottom: 5px;
        /* Match logo margin for perfect center */
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 400px;
        height: 100vh;
        background-color: var(--color-bg);
        flex-direction: column;
        justify-content: center;
        padding: 2rem;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
        transition: right 0.4s ease;
        z-index: 1000;
    }

    .nav-menu.active {
        right: 0;
        overflow-y: auto;
    }

    .dropdown {
        position: relative;
        box-shadow: none;
        background-color: transparent;
        padding-left: 1rem;
        top: 0;
        transform: none;
        display: none;
    }

    .has-dropdown.mobile-open .dropdown {
        display: block;
        opacity: 1;
        visibility: visible;
        transform: none;
        padding-top: 5px;
    }

    .has-dropdown.mobile-open>a .arrow {
        transform: rotate(180deg);
        display: inline-block;
    }

    .has-dropdown>a {
        justify-content: space-between;
        width: 100%;
    }

    .nav-actions {
        display: none;
    }

    .hamburger.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero-title {
        font-size: 3.5rem;
    }

    .hero-subtitle {
        font-size: 1.5rem;
        letter-spacing: 6px;
    }

    .hero p {
        font-size: 1rem;
    }

    .section {
        padding: 60px 0;
    }

    .footer-links-container {
        flex-direction: column;
        gap: 2rem;
    }

    .video-showcase {
        padding: 0.8rem !important;
        border-radius: 16px !important;
    }

    .shape-divider svg {
        height: 50px !important;
    }

    .intro-card {
        flex-direction: column;
        padding: 1.5rem;
        gap: 2rem;
    }

    .pathways-grid {
        gap: 4rem;
    }

    .pathway-item {
        flex-direction: column;
    }

    .pathway-item:nth-child(even) {
        flex-direction: column;
    }

    .pathway-image {
        width: 100%;
        order: 1 !important;
    }

    .pathway-content {
        position: relative;
        width: 90%;
        margin: -3rem auto 0;
        right: auto;
        left: auto !important;
        padding: 2rem 1.5rem;
        order: 2;
    }

    .admission-banner-text {
        position: relative;
        width: 100%;
        padding: 2rem;
    }

    .polaroid {
        display: none;
        /* Hide polaroids on small screens to prevent overlap */
    }
}
@media (max-width: 768px) { .container { padding: 0 6vw; } }
