:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-soft: rgba(79, 70, 229, 0.1);
    --secondary: #64748b;
    --accent: #f59e0b;
    --dark: #0f172a;
    --light: #f8fafc;
    --white: #ffffff;
    --success: #10b981;
    --danger: #ef4444;
    --border-radius: 1rem;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --primary-dark: #1e1b4b;

    /* Dynamic Theme Variables */
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-navbar: rgba(255, 255, 255, 0.8);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-navbar: rgba(15, 23, 42, 0.85);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
    --light: #1e293b;
    --white: #1e293b;
}

[data-theme="dark"] .theme-icon-light {
    display: none !important;
}

[data-theme="dark"] .theme-icon-dark {
    display: block !important;
}

[data-theme="dark"] .bg-white {
    background-color: var(--bg-card) !important;
}

[data-theme="dark"] .text-dark {
    color: var(--text-main) !important;
}

[data-theme="dark"] .text-muted {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .card {
    background-color: var(--bg-card);
    border-color: var(--border-color);
}

[data-theme="dark"] .navbar {
    background-color: var(--bg-card) !important;
}

[data-theme="dark"] .dropdown-menu {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .dropdown-item {
    color: var(--text-main);
}

[data-theme="dark"] .dropdown-item:hover {
    background-color: var(--primary-soft);
}

[data-theme="dark"] .modal-content {
    background-color: var(--bg-card);
    color: var(--text-main);
}

[data-theme="dark"] .bg-light {
    background-color: var(--bg-body) !important;
}

[data-theme="dark"] .mobile-bottom-nav {
    background-color: var(--bg-card) !important;
    border-top-color: var(--border-color) !important;
}

[data-theme="dark"] .feature-card {
    background-color: var(--bg-card);
}

[data-theme="dark"] .teacher-card {
    background-color: var(--bg-card);
}

[data-theme="dark"] .see-more-card {
    background-color: var(--bg-card);
    border-color: var(--border-color);
}

.bg-primary-dark {
    background-color: var(--primary-dark) !important;
}

.group:hover .gallery-overlay {
    opacity: 1 !important;
}

@media (max-width: 768px) {
    .video-tour-content {
        padding: 60px 20px;
    }

    .display-4 {
        font-size: 2rem !important;
    }
}

.shadow-inset {
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

/* --- Navbar --- */
.main-navbar {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.brand-logo {
    height: 45px;
    width: auto;
}

.small-text {
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

@media (max-width: 576px) {
    .brand-text span {
        font-size: 0.85rem !important;
    }

    .brand-logo {
        height: 35px;
    }
}

.nav-link {
    font-weight: 500;
    color: var(--secondary) !important;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary) !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 15px;
    right: 15px;
    height: 2px;
    background: var(--primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.nav-link:hover::after {
    transform: scaleX(1);
}

/* --- Hero Section --- */
.hero-section {
    position: relative;
    height: 80vh;
    min-height: 500px;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    margin-top: -85px;
    /* Offset for sticky nav */
    padding-top: 85px;
}

.bg-primary-soft {
    background-color: var(--primary-soft);
}

.hero-content {
    animation: fadeInUp 1s ease-out;
}

.hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 992px) {
    .hero-section {
        height: auto;
        min-height: 60vh;
        padding-top: 120px;
        padding-bottom: 60px;
        background-attachment: scroll;
        /* Seringkali lebih baik untuk mobile */
    }
}

/* --- Feature Cards --- */
.feature-card {
    background: var(--white);
    padding: 2.5rem 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-soft);
}

.feature-card img {
    height: 60px;
    width: 60px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

/* Glassmorphism Utility */
.glass-panel {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15) !important;
}

.glass-modal .modal-content {
    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    color: var(--primary-dark);
}

.modal-auth-split {
    display: flex;
    overflow: hidden;
}

.auth-modal-info {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Animations */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.glass-modal.show .modal-dialog {
    animation: modalFadeIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.input-group-glass {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.input-group-glass:focus-within {
    background: white;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    border-color: var(--primary);
}

/* Auth Buttons enhancement */
.auth-btn-group .btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-btn-group .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* --- Section Titles --- */
.section-title-wrapper {
    margin-bottom: 4rem;
}

.text-primary-dark {
    color: #1e1b4b;
}

/* --- Teacher Cards --- */
.teacher-card {
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--white);
    transition: all 0.4s ease;
}

.teacher-card .teacher-img-wrapper {
    overflow: hidden;
    height: 320px;
}

.teacher-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.teacher-card:hover img {
    transform: scale(1.1);
}

.teacher-card:hover {
    box-shadow: var(--shadow-xl);
}

/* --- Events --- */
.card-hover-effect {
    border-radius: var(--border-radius);
    overflow: hidden;
    border: none;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.card-hover-effect:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg) !important;
}

/* --- Video Section --- */
.video-tour-section {
    padding: 100px 0;
    position: relative;
    border-radius: 2rem;
    margin: 4rem 0;
    overflow: hidden;
}

.video-tour-content {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    padding: 120px 40px;
    border-radius: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.play-button {
    width: 80px;
    height: 80px;
    background: var(--white);
    color: var(--primary) !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 1.5rem;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.play-button:hover {
    transform: scale(1.1);
    background: var(--primary);
    color: var(--white) !important;
}

/* --- Gallery --- */
.gallery-item {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    aspect-ratio: 4/3;
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover .project-img {
    transform: scale(1.15);
}

/* --- Buttons --- */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

.rounded-pill {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* --- Footer --- */
.university-footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 80px 0 30px;
}

.footer-title {
    color: var(--white);
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.footer-link {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
    margin-bottom: 0.75rem;
}

.footer-link:hover {
    color: var(--white);
}

/* Animasi Entry */
.hero-animated {
    animation: fadeIn 0.8s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@media (max-width: 991.98px) {
    .navbar-collapse {
        background: white;
        margin-top: 1rem;
        padding: 1.5rem;
        border-radius: 1.5rem;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }

    .nav-item {
        width: 100%;
        text-align: center;
        margin: 0.5rem 0;
    }

    .auth-btn-group {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 1rem;
    }

    .auth-btn-group .btn {
        width: 100%;
        margin: 0 !important;
    }
}

@media (max-width: 768px) {
    .hero-section {
        height: auto;
        padding: 120px 0 80px;
    }

    .display-3 {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .section-title-wrapper {
        margin-bottom: 2.5rem;
    }

    .feature-card {
        padding: 2rem 1rem;
    }

    .university-footer {
        text-align: center;
        padding: 60px 0 30px;
    }

    .footer-brand {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .social-links {
        justify-content: center;
    }

    /* MODAL MOBILE FIX */
    .modal-dialog {
        margin: 1rem;
    }

    .auth-modal-info {
        padding: 2.5rem 1.5rem;
        border-radius: 1.5rem 1.5rem 0 0;
    }
}

@media (max-width: 576px) {
    .brand-text span {
        font-size: 0.85rem !important;
    }

    .brand-logo {
        height: 35px;
    }

    .hero-btns {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        padding: 0 1rem;
    }

    .hero-btns .btn {
        width: 100%;
        margin: 0 !important;
    }

    .auth-modal-info {
        padding: 2rem 1.5rem;
    }

    .btn-lg {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }

    .mt-n5 {
        margin-top: 0 !important;
    }
}

/* --- Horizontal Scroll Utility --- */
.horizontal-scroll-wrapper {
    position: relative;
    padding: 0 40px;
    /* Space for arrows */
}

.horizontal-scroll-container {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    gap: 1.5rem;
    padding: 1rem 0.5rem 2rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Hide scrollbar for Firefox */
}

.horizontal-scroll-container::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar for Chrome, Safari and Opera */
}

.scroll-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    background: var(--white);
    color: var(--primary);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    z-index: 10;
    transition: all 0.3s ease;
    cursor: pointer;
}

.scroll-nav-btn:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-50%) scale(1.1);
}

.scroll-nav-btn.prev {
    left: -10px;
}

.scroll-nav-btn.next {
    right: -10px;
}

@media (max-width: 768px) {
    .horizontal-scroll-wrapper {
        padding: 0;
    }

    .scroll-nav-btn {
        display: none;
        /* Hide arrows on mobile, use touch swipe */
    }
}

.horizontal-scroll-item {
    flex: 0 0 auto;
    scroll-snap-align: start;
    width: 320px;
}

.event-scroll-item {
    width: 350px;
}

.teacher-scroll-item {
    width: 280px;
}

.project-scroll-item {
    width: 380px;
}

@media (max-width: 576px) {
    .event-scroll-item {
        width: 280px;
    }

    .teacher-scroll-item {
        width: 220px;
    }

    .project-scroll-item {
        width: 300px;
    }
}

.see-more-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: var(--white);
    border: 2px dashed var(--primary-soft);
    border-radius: var(--border-radius);
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    min-height: 250px;
    color: var(--primary);
    text-decoration: none;
    box-shadow: var(--shadow);
}

.see-more-card:hover {
    background: var(--primary);
    color: white !important;
    border-style: solid;
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.see-more-card i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.see-more-card:hover i {
    transform: translateX(5px);
}

/* --- Mobile Bottom Navigation --- */
.mobile-bottom-nav {
    height: 65px;
    z-index: 1050;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.05);
    border-top-left-radius: 1.5rem;
    border-top-right-radius: 1.5rem;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
}

.nav-link-mobile {
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.nav-link-mobile.active {
    color: var(--primary);
}

.nav-link-mobile i {
    font-size: 1.5rem;
    margin-bottom: -2px;
}

.nav-link-mobile span {
    font-size: 0.65rem;
    font-weight: 600;
}

/* App-like adjustments for mobile */
@media (max-width: 768px) {
    body {
        padding-bottom: 75px;
        /* Space for bottom nav */
    }

    .main-navbar {
        height: 60px;
        display: flex;
        align-items: center;
    }

    .navbar-toggler {
        display: none !important;
        /* Use bottom nav instead */
    }

    .hero-section {
        border-bottom-left-radius: 2.5rem;
        border-bottom-right-radius: 2.5rem;
    }

    .container {
        padding-left: 20px;
        padding-right: 20px;
    }

    .section-title-wrapper h2 {
        font-size: 1.75rem;
    }
}

.theme-toggle-btn {
    font-size: 1.25rem;
    color: var(--text-main) !important;
    padding: 0.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.theme-toggle-btn:hover {
    background-color: var(--primary-soft);
}