/********** Pemda Inspektorat Mentawai Modern Design System **********/
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&family=Outfit:wght@400;500;600;700&display=swap');

:root {
    --primary: #0A2540;
    --primary-light: #1E3A8A;
    --primary-dark: #07192C;
    --accent: #D4AF37;
    --accent-light: #F59E0B;
    --secondary: #475569;
    --light: #F8FAFC;
    --white: #FFFFFF;
    --dark: #0F172A;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    --card-shadow: 0 10px 30px -5px rgba(10, 37, 64, 0.08);
    --hover-shadow: 0 20px 35px -5px rgba(10, 37, 64, 0.15);
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Outfit', sans-serif;
}

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

h1, h2, h3, h4, h5, h6, .font-heading {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary);
}

.back-to-top {
    position: fixed;
    display: none;
    right: 30px;
    bottom: 30px;
    z-index: 99;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: var(--primary-dark) !important;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    transition: all 0.3s ease;
}

.back-to-top:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.6);
}

.fw-medium {
    font-weight: 500;
}

/*** Top Information Bar ***/
.top-bar {
    background: var(--primary-dark);
    color: #CBD5E1;
    font-size: 13.5px;
    padding: 8px 0;
    border-bottom: 2px solid var(--accent);
}

.top-bar a {
    color: #E2E8F0;
    transition: color 0.3s ease;
    text-decoration: none;
}

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

/*** Spinner ***/
#spinner {
    opacity: 0;
    visibility: hidden;
    transition: opacity .5s ease-out, visibility 0s linear .5s;
    z-index: 99999;
    background: rgba(15, 23, 42, 0.9) !important;
}

#spinner.show {
    transition: opacity .5s ease-out, visibility 0s linear 0s;
    visibility: visible;
    opacity: 1;
}

.spinner-border {
    border-color: var(--accent) transparent var(--accent) transparent;
}

/*** Buttons ***/
.btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    border-radius: 8px;
    padding: 10px 24px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: none;
    color: var(--white);
    box-shadow: 0 4px 14px rgba(10, 37, 64, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(10, 37, 64, 0.35);
    color: var(--white);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: var(--primary-dark);
    border: none;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.3);
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.45);
    color: var(--primary-dark);
}

.btn-outline-primary {
    border: 2px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
}

.btn-square {
    width: 42px;
    height: 42px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.btn-lg-square {
    width: 52px;
    height: 52px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/*** Modern Navbar Header ***/
.sticky-top {
    top: 0;
    transition: all 0.4s ease;
    z-index: 1030;
}

.navbar-container {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.navbar-brand img {
    max-height: 75px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.navbar-brand:hover img {
    transform: scale(1.03);
}

.navbar-brand-text {
    display: flex;
    flex-direction: column;
}

.navbar-brand-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.navbar-brand-subtitle {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.navbar .navbar-nav .nav-link {
    margin-right: 20px;
    padding: 24px 0;
    color: var(--primary-dark);
    font-size: 15px;
    font-weight: 600;
    position: relative;
    transition: color 0.3s ease;
}

.navbar .navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 15px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
    transition: width 0.3s ease;
}

.navbar .navbar-nav .nav-link:hover,
.navbar .navbar-nav .nav-link.active {
    color: var(--primary);
}

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

.navbar .dropdown-toggle::before {
    display: none;
}

.navbar .dropdown-menu {
    border: none;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(10, 37, 64, 0.12);
    padding: 10px;
    background: #FFFFFF;
    border-top: 4px solid var(--accent);
}

.navbar .dropdown-item {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--dark);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.navbar .dropdown-item:hover {
    background: #F1F5F9;
    color: var(--primary);
    transform: translateX(4px);
}

@media (max-width: 991.98px) {
    .navbar .navbar-nav {
        padding: 15px 0;
    }
    
    .navbar .navbar-nav .nav-link {
        margin-right: 0;
        padding: 12px 15px;
        border-radius: 8px;
    }

    .navbar .navbar-nav .nav-link::after {
        display: none;
    }
    
    .navbar .navbar-nav .nav-link:hover,
    .navbar .navbar-nav .nav-link.active {
        background: #F1F5F9;
    }
}

@media (min-width: 992px) {
    .navbar .nav-item .dropdown-menu {
        display: block;
        margin-top: 0;
        top: 130%;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .navbar .nav-item:hover .dropdown-menu {
        top: 100%;
        visibility: visible;
        opacity: 1;
    }
}

/*** Hero Carousel ***/
#header-carousel .carousel-item {
    min-height: 520px;
    max-height: 650px;
    position: relative;
}

#header-carousel .carousel-item img {
    height: 100%;
    object-fit: cover;
    filter: brightness(0.65) contrast(1.05);
}

.carousel-caption {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    background: linear-gradient(90deg, rgba(10, 37, 64, 0.85) 0%, rgba(10, 37, 64, 0.4) 60%, rgba(0, 0, 0, 0.1) 100%);
    z-index: 1;
    text-shadow: none;
}

.hero-badge {
    display: inline-block;
    background: rgba(212, 175, 55, 0.2);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 6px 18px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
    backdrop-filter: blur(4px);
}

.carousel-caption h1 {
    font-size: 2.8rem;
    line-height: 1.25;
    font-weight: 800;
}

@media (max-width: 768px) {
    #header-carousel .carousel-item {
        min-height: 420px;
    }
    .carousel-caption h1 {
        font-size: 1.8rem;
    }
    .carousel-caption {
        background: rgba(10, 37, 64, 0.8);
    }
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background-color: var(--primary);
    border: 2px solid var(--accent);
    background-size: 40%;
    transition: all 0.3s ease;
}

.carousel-control-prev:hover .carousel-control-prev-icon,
.carousel-control-next:hover .carousel-control-next-icon {
    background-color: var(--accent);
    border-color: var(--primary);
    transform: scale(1.1);
}

/*** Quick Access Service Widgets ***/
.service-widget-card {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 24px 20px;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(226, 232, 240, 0.9);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.service-widget-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-widget-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--hover-shadow);
    border-color: rgba(212, 175, 55, 0.4);
}

.service-widget-card:hover::before {
    opacity: 1;
}

.service-widget-icon {
    width: 75px;
    height: 75px;
    object-fit: contain;
    margin-bottom: 16px;
    transition: transform 0.3s ease;
}

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

/*** Core Values BerAKHLAK ***/
.core-val-card {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 30px 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    transition: all 0.35s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.core-val-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--hover-shadow);
    border-color: var(--primary-light);
}

.core-val-icon-box {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    background: linear-gradient(135deg, #F1F5F9, #E2E8F0);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.core-val-card:hover .core-val-icon-box {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

.core-val-card:hover .core-val-icon-box img {
    filter: brightness(0) invert(1);
}

/*** News Card Styling ***/
.news-card-modern {
    background: #FFFFFF;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    transition: all 0.35s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

.news-thumb-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
    background: #0F172A;
}

.news-thumb-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card-modern:hover .news-thumb-wrapper img {
    transform: scale(1.08);
}

.news-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: rgba(10, 37, 64, 0.85);
    backdrop-filter: blur(4px);
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

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

.news-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--primary);
    margin-bottom: 12px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.news-title:hover {
    color: var(--primary-light);
}

.news-snippet {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 20px;
    flex-grow: 1;
}

.news-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 15px;
    border-top: 1px solid #F1F5F9;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/*** Staff Card ***/
.staff-card {
    background: #FFFFFF;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: all 0.35s ease;
    padding-bottom: 20px;
}

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

.staff-img-box {
    width: 100%;
    height: 320px;
    overflow: hidden;
    background: #E2E8F0;
    position: relative;
}

.staff-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.4s ease;
}

.staff-card:hover .staff-img-box img {
    transform: scale(1.05);
}

.staff-info {
    padding: 16px 14px 0 14px;
}

.staff-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.staff-pos {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--accent-light);
    background: #FEF3C7;
    padding: 3px 12px;
    border-radius: 20px;
    display: inline-block;
}

/*** Submenu Quick Nav Component ***/
.submenu-nav-container {
    background: #FFFFFF;
    border-radius: 50px;
    padding: 8px 12px;
    box-shadow: 0 4px 20px rgba(10, 37, 64, 0.06);
    border: 1px solid var(--border-color);
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 35px;
}

.submenu-nav-btn {
    padding: 10px 22px;
    border-radius: 40px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--secondary);
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.submenu-nav-btn:hover {
    color: var(--primary);
    background: #F1F5F9;
    transform: translateY(-2px);
}

.submenu-nav-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #FFFFFF !important;
    box-shadow: 0 4px 14px rgba(10, 37, 64, 0.2);
}

.submenu-nav-btn.active i {
    color: var(--accent) !important;
}

/*** Document & Regulations Table Styling ***/
.modern-table-card {
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.table-custom {
    margin-bottom: 0;
}

.table-custom thead {
    background: var(--primary);
    color: var(--white);
}

.table-custom thead th {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 16px 20px;
    border: none;
}

.table-custom tbody tr {
    transition: background-color 0.2s ease;
}

.table-custom tbody tr:hover {
    background-color: #F8FAFC;
}

.table-custom td {
    padding: 16px 20px;
    vertical-align: middle;
    border-bottom: 1px solid #F1F5F9;
    font-size: 0.95rem;
}

/*** Footer ***/
.footer {
    background: var(--primary-dark);
    color: #94A3B8;
    font-size: 0.95rem;
    padding-top: 70px;
    border-top: 4px solid var(--accent);
}

.footer h4 {
    color: var(--white);
    font-size: 1.25rem;
    margin-bottom: 24px;
    position: relative;
    padding-bottom: 10px;
}

.footer h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--accent);
    border-radius: 3px;
}

.footer a {
    color: #CBD5E1;
    text-decoration: none;
    transition: all 0.2s ease;
}

.footer a:hover {
    color: var(--accent);
    padding-left: 5px;
}

.footer-contact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 14px;
}

.footer-contact-icon {
    color: var(--accent);
    font-size: 1.1rem;
    margin-right: 14px;
    margin-top: 4px;
}

.copyright {
    background: #020914;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.88rem;
    color: #64748B;
}

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

/*** Section Headers ***/
.section-header {
    text-align: center;
    max-width: 650px;
    margin: 0 auto 50px auto;
}

.section-tag {
    display: inline-block;
    background: #EFF6FF;
    color: var(--primary);
    border: 1px solid #BFDBFE;
    font-size: 0.88rem;
    font-weight: 700;
    padding: 5px 16px;
    border-radius: 30px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.3;
}

@media (max-width: 768px) {
    .navbar-brand-title {
        font-size: 1.05rem;
    }
    .navbar-brand-subtitle {
        font-size: 0.62rem;
    }
    .navbar-brand img {
        max-height: 48px;
    }
    .navbar-toggler {
        padding: 6px 10px;
        background-color: var(--primary) !important;
        border-radius: 8px !important;
    }
    .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
    }

    #header-carousel .carousel-item {
        min-height: 440px;
    }
    .carousel-caption {
        padding: 25px 20px !important;
        background: rgba(10, 37, 64, 0.88);
    }
    .carousel-caption h1 {
        font-size: 1.4rem !important;
        line-height: 1.3 !important;
        margin-bottom: 1rem !important;
    }
    .carousel-caption h4 {
        font-size: 0.95rem !important;
    }
    .hero-badge {
        font-size: 11px;
        padding: 4px 12px;
        margin-bottom: 10px;
    }
    .carousel-caption .btn {
        padding: 10px 18px !important;
        font-size: 0.82rem !important;
    }
    
    /* Reposition carousel prev/next controls to bottom corners on mobile */
    .carousel-control-prev,
    .carousel-control-next {
        width: 38px;
        height: 38px;
        top: auto;
        bottom: 15px;
        z-index: 10;
        opacity: 0.9;
    }
    .carousel-control-prev {
        left: 15px;
    }
    .carousel-control-next {
        right: 15px;
    }
    .carousel-control-prev-icon,
    .carousel-control-next-icon {
        width: 38px;
        height: 38px;
        background-size: 45%;
    }

    .section-title {
        font-size: 1.55rem;
    }
    .submenu-nav-container {
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }
    .submenu-nav-btn {
        flex: 0 0 auto;
        font-size: 0.85rem;
        padding: 8px 14px;
    }
    .modern-table-card {
        padding: 16px !important;
    }
    .table-responsive {
        border-radius: 8px;
    }
}