:root {
    --primary-color: #800000;
    /* Maroon Fakultas Hukum */
    --primary-gradient: linear-gradient(135deg, #800000 0%, #4a0000 100%);
    --secondary-color: #d4af37;
    /* Gold Accent */
    --dark-color: #121212;
    --light-color: #f8f9fa;
    --text-color: #2b2b2b;
    --text-muted: #6c757d;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 15px 35px rgba(128, 0, 0, 0.15);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #fafafa;
    overflow-x: hidden;
}

main {
    flex: 1;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

/* ==========================================
   Top Bar
   ========================================== */
.top-bar {
    background-color: var(--dark-color);
    color: #e0e0e0;
    font-size: 0.82rem;
    padding: 8px 0;
    border-bottom: 2px solid var(--secondary-color);
}

.top-bar a {
    color: #e0e0e0;
    text-decoration: none;
    transition: var(--transition);
}

.top-bar a:hover {
    color: var(--secondary-color);
}

/* ==========================================
   Header & Navbar System
   ========================================== */
.main-navbar {
    background: var(--primary-gradient) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
}

.main-navbar .navbar-brand {
    padding: 0;
}

.main-navbar .logo img {
    transition: transform 0.3s ease;
}

.main-navbar .logo img:hover {
    transform: scale(1.05);
}

.main-navbar .logo-title {
    font-weight: 700;
    letter-spacing: 0.8px;
    font-size: 1.3rem;
    line-height: 1.2;
}

.main-navbar .sub-title {
    font-size: 0.75rem;
    letter-spacing: 0.8px;
    opacity: 0.9;
}

.main-navbar .nav-link {
    color: #ffffff !important;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 10px 13px !important;
    transition: var(--transition);
    position: relative;
    border-radius: 4px;
}

.main-navbar .nav-link::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background-color: var(--secondary-color);
    transition: var(--transition);
    border-radius: 2px;
}

.main-navbar .nav-link:hover::after,
.main-navbar .nav-link.active::after {
    width: 70%;
}

.main-navbar .nav-link:hover,
.main-navbar .nav-link.active {
    color: var(--secondary-color) !important;
    background-color: rgba(255, 255, 255, 0.08);
}

/* Dropdown Menu Styling */
.dropdown-menu {
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 8px 0;
    margin-top: 0;
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    padding: 10px 22px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #444;
    transition: var(--transition);
}

.dropdown-item:hover {
    background-color: #fff5f5;
    color: var(--primary-color);
    padding-left: 26px;
}

/* Navbar Mobile Toggle */
.navbar-toggler {
    border: none;
    padding: 8px 12px;
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* ==========================================
   Hero Section / Banners
   ========================================== */
.page-header {
    background: linear-gradient(135deg, rgba(128, 0, 0, 0.85) 0%, rgba(20, 20, 20, 0.9) 100%), url('https://images.unsplash.com/photo-1589829545856-d10d557cf95f?auto=format&fit=crop&w=1350&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: white;
    padding: 80px 0;
    margin-bottom: 40px;
    border-bottom: 5px solid var(--secondary-color);
    position: relative;
}

.page-header h1 {
    font-weight: 700;
    letter-spacing: -0.5px;
}

.max-w-700 {
    max-width: 700px;
}

/* ==========================================
   Cards & Content Layout
   ========================================== */
.section-title {
    position: relative;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 30px;
    padding-bottom: 12px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--secondary-color);
    border-radius: 2px;
}

.section-title.text-center::after {
    left: 50%;
    transform: translateX(-50%);
}

.custom-card {
    border: none;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    overflow: hidden;
}

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

/* ==========================================
   Footer Section
   ========================================== */
footer {
    background-color: var(--dark-color);
    color: #b0b0b0;
    padding-top: 60px;
    padding-bottom: 0;
    border-top: 4px solid var(--primary-color);
}

footer h5 {
    color: #ffffff;
    font-weight: 600;
    margin-bottom: 24px;
    position: relative;
    padding-bottom: 10px;
}

footer h5::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 35px;
    height: 3px;
    background-color: var(--secondary-color);
    border-radius: 2px;
}

footer a {
    color: #bbbbbb;
    text-decoration: none;
    transition: var(--transition);
}

footer a:hover {
    color: var(--secondary-color);
    padding-left: 4px;
}

.footer-bottom {
    background-color: #090909;
    padding: 18px 0;
    margin-top: 50px;
    font-size: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ==========================================
   Media Queries & Mobile Optimization
   ========================================== */

/* Tablet & Mobile (< 992px) */
@media (max-width: 991.98px) {
    .main-navbar {
        padding: 10px 0;
    }

    .main-navbar .logo-title {
        font-size: 1.1rem;
    }

    .main-navbar .sub-title {
        font-size: 0.68rem;
    }

    .main-navbar .logo img {
        height: 42px !important;
    }

    .main-navbar .navbar-collapse {
        margin-top: 10px;
        padding-top: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
    }

    .main-navbar .nav-link {
        padding: 10px 16px !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .main-navbar .nav-link::after {
        display: none;
    }

    .dropdown-menu {
        background-color: rgba(0, 0, 0, 0.2);
        box-shadow: none;
        border-radius: 0;
        margin: 0;
    }

    .dropdown-item {
        color: #e0e0e0;
        padding-left: 35px;
    }

    .dropdown-item:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: var(--secondary-color);
    }
}

/* Mobile Small (< 768px) */
@media (max-width: 767.98px) {
    .top-bar {
        font-size: 0.75rem;
    }

    .top-bar .top-info span {
        display: block;
        margin-bottom: 2px;
    }

    .top-bar .container {
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }

    .page-header {
        padding: 50px 15px;
        background-attachment: scroll;
        /* Smoother scrolling on mobile */
    }

    .page-header h1 {
        font-size: 1.8rem;
    }

    .page-header p {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.4rem;
    }
}

/* ==========================================
   Hero Slider & Custom Components (fh.uncen.ac.id)
   ========================================== */
.hero-section {
    position: relative;
    height: 400px;
    overflow: hidden;
}

.hero-section .carousel-item {
    height: 400px;
}

.hero-section .carousel-item img {
    object-fit: cover;
    height: 100%;
    filter: brightness(0.55);
}

.hero-section .carousel-caption {
    bottom: 12%;
    text-align: left;
    max-width: 580px;
    left: 8%;
    right: auto;
}

.hero-section .carousel-caption h1 {
    font-weight: 700;
    font-size: 1.7rem;
    margin-bottom: 8px;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    line-height: 1.25;
}

.hero-section .carousel-caption p {
    font-size: 0.9rem;
    margin-bottom: 14px;
    color: #f0f0f0;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

.btn-maroon {
    background-color: var(--primary-color);
    color: white !important;
    border-radius: 30px;
    padding: 8px 22px;
    font-size: 0.88rem;
    font-weight: 600;
    transition: var(--transition);
    border: 2px solid var(--primary-color);
}

.btn-maroon:hover {
    background-color: #600000;
    color: var(--secondary-color) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(128, 0, 0, 0.4);
}

.text-maroon {
    color: var(--primary-color) !important;
}

.bg-maroon {
    background-color: var(--primary-color) !important;
    color: white;
}

/* Dekan Section */
.welcome-section {
    padding: 40px 0;
}

.dekan-img-container {
    position: relative;
    padding: 15px;
}

.dekan-img-container:before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid var(--secondary-color);
    top: 0;
    left: 0;
    z-index: 0;
    border-radius: 8px;
}

.dekan-img {
    position: relative;
    z-index: 1;
    box-shadow: 15px 15px 0px var(--primary-color);
    max-height: 400px;
    width: 100%;
    object-fit: cover;
}

/* Stats Section */
.stats-section {
    background: linear-gradient(rgba(128, 0, 0, 0.88), rgba(60, 0, 0, 0.92)), url('https://images.unsplash.com/photo-1505664194779-8beaceb93744?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    padding: 60px 0;
    color: white;
}

.stat-card {
    text-align: center;
    padding: 20px;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--secondary-color);
    display: block;
    line-height: 1.2;
}

.stat-label {
    font-size: 1rem;
    font-weight: 500;
    margin-top: 5px;
    opacity: 0.95;
}

/* Social icons & hover */
.social-icons a,
.social-btn {
    transition: var(--transition);
    display: inline-block;
}

.social-icons a:hover,
.social-btn:hover {
    color: var(--secondary-color) !important;
    transform: translateY(-2px);
}

/* Service box hover */
.service-box {
    transition: var(--transition);
}

.service-box:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 25px rgba(128, 0, 0, 0.15) !important;
    border-color: var(--secondary-color) !important;
}

/* News Cards */
.news-card {
    transition: var(--transition);
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12) !important;
}

@media (max-width: 768px) {

    .hero-section,
    .hero-section .carousel-item {
        height: 320px;
    }

    .hero-section .carousel-caption {
        left: 5%;
        right: 5%;
        bottom: 8%;
        text-align: center;
        max-width: 100%;
    }

    .hero-section .carousel-caption h1 {
        font-size: 1.5rem;
    }

    .hero-section .carousel-caption p {
        font-size: 0.88rem;
    }
}

/* Timeline & Utility Classes */
.timeline-dot {
    position: absolute;
    left: -11px;
    top: 0;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border: 4px solid white;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(128, 0, 0, 0.2);
}

.bg-gold {
    background-color: var(--secondary-color) !important;
    color: #121212 !important;
}

.border-maroon {
    border-color: var(--primary-color) !important;
}

.bg-light-maroon {
    background-color: rgba(128, 0, 0, 0.07) !important;
}

.transition-hover {
    transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

.transition-hover:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 15px 35px rgba(128, 0, 0, 0.12) !important;
    border-color: var(--secondary-color) !important;
}

.tracking-widest {
    letter-spacing: 0.18em !important;
}

.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(128, 0, 0, 0.08);
}

/* ==========================================
   Comprehensive Mobile & Responsive Optimization
   ========================================== */

/* Image & Fluid Container Base */
img, video, canvas, svg {
    max-width: 100%;
    height: auto;
}

/* Touch Friendly Table Scrolling */
.table-responsive {
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
}

/* Screen <= 991.98px (Tablets & Below) */
@media (max-width: 991.98px) {
    .main-navbar {
        padding: 8px 0;
    }
    
    .brand-text {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .main-navbar .logo-title {
        font-size: 1.05rem;
    }

    .main-navbar .sub-title {
        font-size: 0.65rem;
    }

    .main-navbar .logo img {
        height: 40px !important;
    }

    .dekan-img-container {
        margin-bottom: 25px;
    }

    .dekan-img {
        box-shadow: 8px 8px 0px var(--primary-color);
        max-height: 320px;
    }
}

/* Screen <= 767.98px (Mobile Devices) */
@media (max-width: 767.98px) {
    /* Top Bar Mobile Layout */
    .top-bar {
        padding: 6px 0;
    }
    
    .top-bar .container {
        flex-direction: column !important;
        gap: 6px;
        text-align: center;
    }

    .top-bar .top-info {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .top-bar .top-info span {
        margin-right: 0 !important;
        font-size: 0.78rem;
    }

    .top-bar .top-links {
        justify-content: center;
        width: 100%;
    }

    .top-bar .social-icons {
        margin-right: 10px !important;
    }

    /* Hero Carousel Mobile */
    .hero-section,
    .hero-section .carousel-item {
        height: 280px !important;
    }

    .hero-section .carousel-caption {
        left: 5% !important;
        right: 5% !important;
        bottom: 8% !important;
        padding: 0 !important;
        text-align: center !important;
        width: 90% !important;
    }

    .hero-section .carousel-caption h1 {
        font-size: 1.25rem !important;
        margin-bottom: 6px !important;
    }

    .hero-section .carousel-caption p {
        font-size: 0.8rem !important;
        margin-bottom: 10px !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .hero-section .btn-maroon {
        padding: 5px 16px !important;
        font-size: 0.8rem !important;
    }

    /* Section & Headings */
    .section-title {
        font-size: 1.35rem;
        margin-bottom: 20px;
    }

    /* Stats Mobile Grid */
    .stat-number {
        font-size: 2.2rem;
    }

    .stat-label {
        font-size: 0.88rem;
    }

    /* Cards & Spacing */
    .welcome-section {
        padding: 25px 0;
    }

    .prose {
        font-size: 0.98rem !important;
    }

    .timeline-modern .list-group-item {
        padding-left: 20px !important;
    }

    /* Footer Mobile */
    footer {
        padding-top: 40px;
        text-align: center;
    }

    footer h5::after {
        left: 50%;
        transform: translateX(-50%);
    }

    footer .social-links {
        justify-content: center;
    }

    .footer-bottom {
        margin-top: 30px;
    }
}

/* Screen <= 575.98px (Small Mobile Screens) */
@media (max-width: 575.98px) {
    .main-navbar .logo-title {
        font-size: 0.95rem;
        letter-spacing: 0.2px;
    }

    .main-navbar .sub-title {
        font-size: 0.6rem;
    }

    .main-navbar .logo img {
        height: 35px !important;
    }

    .hero-section,
    .hero-section .carousel-item {
        height: 240px !important;
    }

    .hero-section .carousel-caption h1 {
        font-size: 1.1rem !important;
    }

    .btn-maroon {
        font-size: 0.75rem !important;
        padding: 4px 12px !important;
    }

    /* Buttons & Modal Responsiveness */
    .modal-dialog {
        margin: 10px;
    }

    .modal-body {
        padding: 15px;
    }

    .card-body {
        padding: 15px;
    }
}