/* --- GLOBAL / SHARED STYLES --- */

/* --- GLOBAL PAGE LOADER --- */
.loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #A01626;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loader-wrapper.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* Page Header (Used in page.php, contact.php, pastconference.php, sponsor.php) */
.page-header {
    background: linear-gradient(135deg, #A01626 0%, #7a1a00 100%);
    padding: 40px 0;
    margin-bottom: 60px;
}

.page-header h1 {
    color: white;
    font-weight: bold;
    margin: 0;
    font-size: 1.75rem;
    display: inline-block;
}

@media (max-width: 576px) {
    .page-header .container {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }
}

/* Breadcrumb (Used in page.php, contact.php, pastconference.php, sponsor.php) */
.header-breadcrumb {
    font-size: 1rem;
    color: rgb(255, 255, 255);
}

.header-breadcrumb a {
    color: #ffc107;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.header-breadcrumb a:hover {
    color: #fff;
}

.header-breadcrumb .separator {
    margin: 0 8px;
    color: rgba(255, 255, 255, 0.5);
}


/* --- MAIN.PHP & PASTCONFERENCE.PHP SHARED --- */

.event-card {
    transition: transform 0.3s;
}

.event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.carousel-item img {
    height: 650px;
    object-fit: cover;
    object-position: center;
}

/* Responsive carousel untuk layar kecil / split screen */
@media (max-width: 991px) {
    .carousel-item img {
        height: auto;
        max-height: 400px;
        width: 100%;
    }
}

@media (max-width: 576px) {
    .carousel-item img {
        max-height: 280px;
    }
}

/* --- AREA DESKRIPSI UTAMA --- */
.event-description,
.page-content,
.event-desc {
    line-height: 1.8;
    text-align: justify;
    overflow-wrap: break-word;
    /* Mencegah teks panjang merusak layout */
}

/* Force font consistency: strip inline fonts from pasted content */
.event-description *,
.page-content *,
.event-desc * {
    font-family: inherit !important;
}

.page-content>*:first-child {
    margin-top: 0 !important;
}

/* 1. Responsif Gambar (Wajib) */
.event-description img,
.page-content img,
.event-desc img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px;
    /* Mengembalikan sudut melengkung pada gambar konten */
}

/* 2. Wrapper Widget CKEditor (Wajib jika pakai Image2) */
.event-description .cke_widget_wrapper,
.page-content .cke_widget_wrapper,
.event-desc .cke_widget_wrapper {
    max-width: 100% !important;
}

/* --- 3. CLASS ALIGNMENT (SINKRONISASI DENGAN ADMIN) --- */

/* Rata Kiri: Gambar di kiri, teks tetap di bawah (tidak mengalir ke samping) */
.event-description .image-left,
.page-content .image-left,
.event-desc .image-left {
    display: block;
    margin-right: auto;
    margin-bottom: 10px;
    text-align: left;
    clear: both;
}

/* Rata Kanan: Gambar di kanan, teks tetap di bawah (tidak mengalir ke samping) */
.event-description .image-right,
.page-content .image-right,
.event-desc .image-right {
    display: block;
    margin-left: auto;
    margin-bottom: 10px;
    text-align: right;
    clear: both;
}

/* Rata Tengah: Gambar sendirian di tengah baris */
.event-description .image-center,
.page-content .image-center,
.event-desc .image-center {
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 10px;
    text-align: center;
    clear: both;
}

/* 1. Mengurangi jarak antar paragraf di dalam deskripsi */
.event-description p,
.page-content p,
.event-desc p {
    margin-bottom: 0.5rem !important;
    /* Default Bootstrap 1rem, kita kurangi jadi setengahnya */
}

/* 2. Mengurangi jarak judul (seperti "Plenary Speaker") agar tidak terlalu jauh dari isinya */
.event-description h1,
.event-description h2,
.event-description h3,
.event-description h4,
.page-content h1,
.page-content h2,
.page-content h3,
.page-content h4,
.page-content h5,
.page-content h6,
.event-desc h1,
.event-desc h2,
.event-desc h3,
.event-desc h4,
.event-desc h5,
.event-desc h6 {
    margin-top: 1.5rem !important;
    /* Jarak dari elemen atasnya */
    margin-bottom: 0.5rem !important;
    /* Jarak ke elemen bawahnya (isi) */
    line-height: 1.2;
    color: #ac0404;
    /* Added from page/sponsor/event styles */
}

/* 3. Memastikan list (titik dua) juga rapi */
.event-description ul,
.event-description ol,
.page-content ul,
.page-content ol,
.event-desc ul,
.event-desc ol {
    margin-bottom: 0.5rem !important;
}



/* Schedules */
.schedule-item:last-child {
    border-bottom: none !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

/* Downloadable Files */
.download-file-item {
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.download-file-item:last-child {
    border-bottom: none;
}

.download-file-item a {
    color: #495057;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s ease;
}

.download-file-item a:hover {
    color: #7a1a00;
    font-weight: 500;
}

/* Shared Event Content Styling (main.php & pastconference.php) */
.section-divider {
    border-top: 4px solid #FFC107;
    width: 80px;
}

.event-title-main {
    font-weight: 800;
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 0.3rem;
    color: #ac0404;
}

.event-topic-main {
    font-size: 1.7rem;
    margin-top: 0.3rem;
    margin-bottom: 15px;
}

.sidebar-title {
    color: #495057;
}

.poster-link {
    display: block;
    cursor: pointer;
}

.poster-img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

.btn-download-poster {
    background-color: #6c757d;
    border: none;
    border-radius: 5px;
    font-weight: 500;
}

.btn-download-poster:hover {
    background-color: #5a6268;
}

.schedule-date {
    font-style: italic;
}

.modal-poster-img {
    max-height: 300vh;
    width: auto;
    max-width: 100%;
}



/* --- PAGE.PHP SPECIFIC --- */

/* Page Meta (Tanggal) di Kanan */
.page-meta {
    color: #666;
    font-size: 0.9rem;
    margin-top: 30px;
    /* Jarak dari konten atas */
    margin-bottom: 20px;
    padding-top: 15px;
    /* Jarak tulisan ke garis */
    font-style: italic;
    display: block;
    text-align: right;
    /* <--- INI KUNCINYA (Rata Kanan) */
    border-top: 1px solid #eee;
    /* Opsional: Garis pemisah tipis */
}


/* --- CONTACT.PHP SPECIFIC --- */

.contact-info-box {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 25px;
}

.contact-item:last-child {
    margin-bottom: 0;
}

.contact-icon {
    width: 45px;
    height: 45px;
    background-color: #bf0319;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
}

.contact-icon i {
    color: white;
    font-size: 20px;
}

.contact-details h5 {
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
    font-size: 1rem;
}

.contact-details p {
    margin: 0;
    color: #666;
    line-height: 1.6;
    font-size: 0.95rem;
}

.contact-details a {
    color: #666;
    text-decoration: none;
    font-size: 0.95rem;
}

.contact-details a:hover {
    color: #A01626;
}

.map-container {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    height: 500px;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

@media (max-width: 991px) {
    .contact-info-box {
        margin-bottom: 30px;
    }

    .map-container {
        height: 400px;
    }
}


/* --- PASTCONFERENCE.PHP SPECIFIC --- */

.page-header .event-year-badge {
    display: inline-block;
    background: #ffc107;
    color: #333;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-left: 10px;
    vertical-align: middle;
}

@media (max-width: 576px) {
    .page-header .event-year-badge {
        display: block;
        margin: 10px auto 0;
        width: fit-content;
    }
}


/* --- SPONSOR.PHP SPECIFIC --- */

.event-section {
    margin-bottom: 60px;
}

.event-section:last-child {
    margin-bottom: 0;
}

.sponsored-by {
    text-align: center;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #888;
    margin-bottom: 30px;
    font-weight: 600;
}

.event-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #A01626;
    margin-bottom: 5px;
}

/* Sponsor Grid */
.sponsor-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

/* Jarak antara logo sponsor dan deskripsi (hanya jika ada logo) */
.sponsor-grid+.event-desc {
    margin-top: 2rem;
}

.sponsor-card {
    flex: 0 0 calc(25% - 22.5px);
    /* 4 columns: (100% / 4) - (gap * 3 / 4) */
    max-width: calc(25% - 22.5px);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: #333;
}

@media (max-width: 992px) {
    .sponsor-card {
        flex: 0 0 calc(33.333% - 20px);
        max-width: calc(33.333% - 20px);
    }
}

@media (max-width: 768px) {
    .sponsor-card {
        flex: 0 0 calc(50% - 15px);
        max-width: calc(50% - 15px);
    }
}

@media (max-width: 480px) {
    .sponsor-card {
        flex: 0 0 100%;
        max-width: 100%;
    }
}


.sponsor-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    color: #A01626;
}

.sponsor-card img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 15px;
}

.sponsor-card .sponsor-name {
    font-weight: 600;
    font-size: 0.95rem;
}

/* Animations and Custom Sponsor CTO Buttons */
.sponsor-cta-box {
    background: linear-gradient(135deg, #ffffff 0%, #fff9f9 100%);
    border: 2px solid #f2e6e6;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.sponsor-cta-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(160, 22, 38, 0.15) !important;
}

.sponsor-cta-box .bi-megaphone {
    color: #A01626;
    opacity: 0.85;
}

.sponsor-cta-box h3 {
    color: #A01626;
}

.sponsor-cta-box p {
    max-width: 650px;
    font-size: 1.1rem;
    line-height: 1.6;
}

.sponsor-cta-box .btn {
    border: 2px solid #A01626;
    color: #A01626;
}

@keyframes jump {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.jump-animation {
    display: inline-block;
    animation: jump 2s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(160, 22, 38, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(160, 22, 38, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(160, 22, 38, 0);
    }
}

.pulse-btn {
    animation: pulse 2s infinite;
    transition: all 0.3s ease;
}

.pulse-btn:hover {
    background-color: #7a1a00 !important;
    transform: translateY(-2px);
}

.hover-fill-btn {
    transition: all 0.3s ease;
}

.hover-fill-btn:hover {
    background-color: #A01626;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(160, 22, 38, 0.2) !important;
}

/* --- FRONTMENU.PHP SPECIFIC --- */

/* Pastikan body tidak terpotong (opsional, tergantung struktur main.php) */
body {
    overflow-x: hidden;
}

/* Mempercantik tampilan navbar saat sticky (opsional) */
.navbar.sticky-top {
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
}

/* === TAMBAHAN: Hilangkan highlight biru saat klik/fokus === */
.navbar-nav .nav-link:focus,
.navbar-nav .nav-link:active,
.navbar-nav .nav-link:focus-visible {
    color: #333 !important;
    background-color: transparent !important;
    outline: none !important;
    box-shadow: none !important;
}

/* === TAMBAHAN: Desain Nav-link Klasik dengan Transisi Halus === */
.navbar-nav .nav-link {
    transition: color 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-item.dropdown:hover>.nav-link,
.navbar-nav .nav-link:focus {
    color: #111 !important;
}

/* === TAMBAHAN: Animasi Meluncur (Slide Down) untuk Dropdown === */
@media (min-width: 992px) {

    /* Setup transisi - disembunyikan dan diangkat sedikit saat iddle */
    .dropdown-menu {
        border: none;
        border-radius: 16px;
        box-shadow: 0 12px 35px rgba(0, 0, 0, 0.08);
        /* Shadow modern tebal luar ringan */
        padding: 0.8rem 0;
        margin-top: 10px !important;
        /* Jarak agar tidak terlalu nempel */

        display: block !important;
        /* Override untuk CSS animation */
        visibility: hidden;
        opacity: 0;
        transform: translateY(15px);
        transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
        /* Sangat halus (Apple/Material-like) */
        pointer-events: none;
        /* Jangan tangkap klik saat hilang */
    }

    /* Muncul saat di hover / class show aktif */
    .nav-item.dropdown:hover .dropdown-menu,
    .dropdown-menu.show {
        visibility: visible;
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
}

/* Untuk mobile layout — Desain accordion-style yang lebih rapi */
@media (max-width: 991px) {

    /* Navbar collapse: padding dan spacing */
    .navbar-collapse {
        padding: 0.5rem 0;
    }

    /* Menu items: full-width, rata kiri */
    .navbar-nav {
        width: 100%;
        align-items: flex-start !important;
        padding: 0 0.5rem;
    }

    .navbar-nav .nav-item {
        width: 100%;
    }

    .navbar-nav .nav-link {
        padding: 0.75rem 1rem !important;
        font-size: 1rem;
        font-weight: 500;
        color: #333 !important;
        border-radius: 8px;
        transition: all 0.2s ease;
    }

    .navbar-nav .nav-link:hover {
        background-color: #f8f9fa;
    }

    /* Dropdown toggle: Active state saat submenu terbuka */
    .navbar-nav .nav-item.dropdown .nav-link.dropdown-toggle {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .navbar-nav .nav-item.dropdown.show>.nav-link,
    .navbar-nav .nav-item.dropdown>.nav-link[aria-expanded="true"] {
        color: #A01626 !important;
        font-weight: 600;
    }

    /* Hilangkan default Bootstrap caret, ganti dengan custom chevron */
    .navbar-nav .dropdown-toggle::after {
        display: none;
    }

    .navbar-nav .dropdown-toggle::before {
        content: '';
        display: inline-flex;
        width: 28px;
        height: 28px;
        background-color: rgba(160, 22, 38, 0.08);
        border-radius: 50%;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16'%3E%3Cpath fill='%23666' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: center;
        flex-shrink: 0;
        order: 2;
        margin-left: auto;
        transition: transform 0.3s ease, background-color 0.3s ease;
    }

    .navbar-nav .dropdown.show>.dropdown-toggle::before,
    .navbar-nav .dropdown-toggle[aria-expanded="true"]::before {
        transform: rotate(180deg);
        background-color: rgba(160, 22, 38, 0.15);
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16'%3E%3Cpath fill='%23A01626' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    }

    /* Submenu container: rounded, indented, smooth slide */
    .dropdown-menu {
        border: none;
        background-color: #f8f9fa;
        box-shadow: none;
        padding: 0.5rem 0;
        margin: 0 0 0.25rem 0 !important;
        border-radius: 10px !important;
        /* Smooth slide animation */
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    }

    /* Submenu items */
    .dropdown-menu .dropdown-item {
        padding: 0.6rem 1.25rem;
        font-size: 0.95rem;
        color: #444;
        border-radius: 0;
        margin: 0;
        width: 100%;
    }

    .dropdown-menu .dropdown-item:hover {
        background-color: #eef0f3 !important;
        color: #A01626 !important;
    }
}

/* === TAMBAHAN: Hover Dropdown-Item === */
.dropdown-item {
    border-radius: 8px;
    margin: 2px 8px;
    width: calc(100% - 16px);
    padding: 8px 16px;
    color: #444;
    transition: all 0.2s ease;
}

.dropdown-item:hover,
.dropdown-item:focus,
.dropdown-item:active {
    background-color: #f6f8fb !important;
    /* Warna background lebih biru muda/fresh */
    color: #111 !important;
    outline: none !important;
}

/* --- FRONTFOOTER.PHP SPECIFIC --- */

/* CSS Custom */
.footer-custom {
    background-color: #A01626;
    padding-top: 3rem;
    padding-bottom: 1.5rem;
    font-size: 0.95rem;
    /* Ukuran font standar */
}

/* Mengatur jarak antar baris agar tidak terlalu jauh (Compact) */
.footer-content {
    line-height: 1.4;
}

/* Social Media Buttons */
.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-btn:hover {
    background-color: white;
    color: #A01626;
    transform: translateY(-2px);
}

/* Highlight Links (Kuning Emas) */
.highlight-link {
    color: #ffc107;
    /* Warna Kuning Emas */
    text-decoration: none;
    font-weight: 600;
    /* Sedikit tebal agar kebaca */
    transition: all 0.3s ease;
}

.highlight-link:hover {
    color: #fff;
    /* Berubah putih saat hover */
    padding-left: 5px;
    /* Geser kanan sedikit */
    text-decoration: underline;
}

.highlight-link .arrow-icon {
    transition: transform 0.3s ease;
}

.highlight-link:hover .arrow-icon {
    transform: translateX(3px);
}

/* Scroll Top Button */
.btn-scroll-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    background-color: #dc3545;
    /* Merah sesuai request awal btn-danger */
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    text-decoration: none;
    transition: background-color 0.3s;
}

.btn-scroll-top:hover {
    background-color: #bb2d3b;
    color: white;
}

/* === 404 Error Page === */
.error-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
}

.error-code {
    font-size: 8rem;
    font-weight: 800;
    color: #A01626;
    line-height: 1;
    margin-bottom: 0.5rem;
    text-shadow: 2px 4px 10px rgba(160, 22, 38, 0.15);
}

.error-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1rem;
}

.error-message {
    font-size: 1.05rem;
    color: #777;
    max-width: 500px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}

.error-actions .btn {
    padding: 12px 32px;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-back-home {
    background: #A01626;
    color: #fff;
    border: none;
}

.btn-back-home:hover {
    background: #7d1120;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(160, 22, 38, 0.3);
}

.error-icon {
    font-size: 3rem;
    color: #A01626;
    margin-bottom: 1rem;
    opacity: 0.4;
}