/* ===== GLOBAL RESPONSIVE FRAMEWORK ===== */

/* Ultra Large screens (1600px and up) */
@media (min-width: 1600px) {
    .container {
        max-width: 1500px;
    }

    .header-top .col-md-3 img {
        max-height: 70px;
    }

    .navbar-nav>li>a {
        font-size: 16px;
        padding: 0.8em 1.2em;
    }

    .dropdown-menu-3col {
        padding: 3.5rem 6rem;
        top: 70px;
    }
}

/* Extra Large screens (1400px to 1599px) */
@media (min-width: 1400px) and (max-width: 1599px) {
    .container {
        max-width: 1320px;
    }

    .header-top .col-md-3 img {
        max-height: 65px;
    }

    .navbar-nav>li>a {
        font-size: 15px;
        padding: 0.75em 1.1em;
    }

    .dropdown-menu-3col {
        padding: 3rem 5rem;
        top: 65px;
    }

    .dropdown-menu-3col .row {
        max-width: 1400px;
        gap: 4rem;
    }

    .dropdown-menu-3col .col-4 {
        max-width: 400px;
        min-width: 220px;
    }

    .dropdown-menu-3col .dropdown-header {
        font-size: 1rem;
        padding: 0.6rem 0;
    }

    .dropdown-menu-3col .dropdown-item {
        font-size: 0.95rem;
        padding: 0.6rem 0.8rem;
    }
}

/* Large screens (1200px to 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    .container {
        max-width: 1140px;
    }

    .header-top .col-md-3 img {
        max-height: 60px;
    }

    .navbar-nav>li>a {
        font-size: 14px;
        padding: 0.7em 1em;
    }

    .dropdown-menu-3col {
        padding: 2.5rem 4rem;
        top: 62px;
    }

    .dropdown-menu-3col .row {
        max-width: 1200px;
        gap: 3.5rem;
    }

    .dropdown-menu-3col .col-4 {
        max-width: 380px;
        min-width: 210px;
    }
}

/* Medium to Large screens (992px to 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .container {
        max-width: 960px;
    }

    .header-top .col-md-3 img {
        max-height: 58px;
    }

    .navbar-nav>li>a {
        font-size: 13px;
        padding: 0.6em 0.9em;
    }

    .dropdown-menu-3col {
        padding: 2rem 3rem;
        top: 60px;
    }

    .dropdown-menu-3col .row {
        max-width: 1000px;
        gap: 2.5rem;
    }

    .dropdown-menu-3col .col-4 {
        min-width: 180px;
        max-width: 300px;
    }

    .dropdown-menu-3col .dropdown-header {
        font-size: 0.9rem;
    }

    .dropdown-menu-3col .dropdown-item {
        font-size: 0.85rem;
        padding: 0.45rem 0.7rem;
    }

    /* Events responsive */
    .event-img img {
        height: 180px;
    }

    .event-items {
        min-height: 400px;
    }
}

/* Medium screens (768px to 991px) - Tablet */
@media (min-width: 768px) and (max-width: 991px) {
    .container {
        max-width: 720px;
    }

    /* Header adjustments */
    .header-style-1 .bg-header-top {
        padding: 0.8em 0;
    }

    .header-top {
        flex-direction: row;
        align-items: center;
        gap: 1em;
    }

    .header-top .col-md-3 img {
        max-height: 56px;
    }

    .header-contact {
        gap: 0.8em;
        flex-wrap: wrap;
    }

    .header-contact li {
        min-width: 120px;
        padding: 0.5em 0.6em;
        font-size: 11px;
    }

    /* Navbar adjustments */
    .navbar-nav>li>a {
        font-size: 12px;
        padding: 0.5em 0.8em;
    }

    /* Dropdown adjustments */
    .dropdown-menu-3col {
        padding: 1.5rem 2rem;
        border-radius: 0 0 12px 12px;
        top: 58px;
    }

    .dropdown-menu-3col .row {
        max-width: 800px;
        gap: 2rem;
    }

    .dropdown-menu-3col .col-4 {
        min-width: 160px;
        max-width: 250px;
    }

    .dropdown-menu-3col .dropdown-header {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
        padding: 0.4rem 0;
    }

    .dropdown-menu-3col .dropdown-item {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
        margin: 0 0 0.2rem 0;
    }

    .dropdown-menu-3col .dropdown-item:hover {
        transform: translateX(4px);
        padding-left: 0.8rem;
    }

    /* Events responsive */
    .event-img img {
        height: 170px;
    }

    .event-items {
        min-height: 380px;
    }

    /* Latest News responsive */
    .latest_news {
        padding: 2.5rem 0;
    }

    .latest_news h2 {
        font-size: 2rem;
    }

    .post-images img {
        height: 180px;
    }

    .latest_news h3 {
        font-size: 0.95rem;
        min-height: 2.6rem;
    }

    /* Partners responsive */
    .partners-section {
        padding: 3rem 0;
    }

    .partners-option {
        padding: 1.8rem;
        margin-bottom: 2rem;
    }

    .partners-section .section-header h4 {
        font-size: 1.35rem;
    }

    .swiper-slide {
        min-width: 130px;
    }

    .sopnsors-items {
        padding: 0.8rem;
        min-height: 90px;
    }

    .sopnsors-items img {
        max-width: 110px;
        max-height: 70px;
    }
}

/* Small screens (576px to 767px) - Large Mobile/Small Tablet */
@media (min-width: 576px) and (max-width: 767px) {
    .container {
        max-width: 540px;
    }

    /* Header mobile adjustments */
    .header-style-1 .bg-header-top {
        padding: 0.7em 0;
    }

    .header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8em;
    }

    .header-top .col-md-3,
    .header-top .col-md-9 {
        flex: 1 1 100%;
        justify-content: flex-start;
    }

    .header-top .col-md-3 img {
        max-height: 50px;
    }

    .header-contact {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5em;
    }

    .header-contact li {
        min-width: 0;
        flex: 1 1 calc(50% - 0.25em);
        font-size: 11px;
        padding: 0.5em;
    }

    /* Navbar mobile */
    .main-menu .navbar {
        flex-direction: column;
        padding: 0.5em 0;
    }

    .navbar-nav {
        flex-direction: column;
        gap: 0;
        align-items: flex-start !important;
        width: 100%;
        text-align: left !important;
    }

    .navbar-nav>li {
        width: 100%;
    }

    .navbar-nav>li>a {
        font-size: 13px;
        padding: 0.6em 1em;
        text-align: left;
        justify-content: flex-start;
        width: 100%;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }

    .dropdown-menu,
    .sub-menu,
    .sub-sub-menu {
        position: static;
        min-width: 100%;
        box-shadow: none;
        border-radius: 0;
        padding: 0;
        border: none;
    }

    /* Dropdown mobile */
    .dropdown-menu-3col {
        padding: 1.5rem;
        border-radius: 0 0 16px 16px;
        max-height: 70vh;
        overflow-y: auto;
        top: 56px;
    }

    .dropdown-menu-3col .row {
        flex-direction: column;
        gap: 1.5rem;
        max-width: none;
    }

    .dropdown-menu-3col .col-4 {
        flex: 1 1 auto;
        min-width: auto;
        max-width: none;
        padding: 0;
    }

    .dropdown-menu-3col .dropdown-header {
        font-size: 0.9rem;
        padding: 0.6rem 0 0.4rem 0;
        margin-bottom: 0.5rem;
        border-bottom: 1px solid var(--primary);
    }

    .dropdown-menu-3col .dropdown-item {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
        margin: 0 0 0.15rem 0;
    }

    .dropdown-menu-3col .dropdown-item:hover {
        transform: translateX(4px);
        padding-left: 0.9rem;
    }

    /* Events mobile */
    .event-items {
        min-height: 340px;
    }

    .event-img img {
        height: 140px;
    }

    .section-header h2 {
        font-size: 1.2em;
    }

    .events-content {
        padding: 1em 0.8em 1.2em 0.8em;
    }

    /* Latest News mobile */
    .latest_news {
        padding: 2rem 0;
    }

    .latest_news h2 {
        font-size: 1.8rem;
    }

    .post-images img {
        height: 160px;
    }

    .latest_news h3 {
        font-size: 0.9rem;
        min-height: 2.4rem;
    }

    .btn-more {
        justify-content: center !important;
        text-align: center;
    }

    /* Partners mobile */
    .partners-section {
        padding: 2.5rem 0;
    }

    .partners-option {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }

    .partners-section .section-header h4 {
        font-size: 1.25rem;
    }

    .swiper-slide {
        min-width: 120px;
    }

    .sopnsors-items {
        padding: 0.75rem;
        min-height: 80px;
    }

    .sopnsors-items img {
        max-width: 100px;
        max-height: 60px;
    }

    .carousel-nav {
        width: 35px;
        height: 35px;
    }
}

/* Extra Small screens (575px and below) - Mobile Portrait */
@media (max-width: 575px) {
    .container {
        max-width: 100%;
        padding: 0 15px;
    }

    /* Header mobile portrait */
    .header-style-1 .bg-header-top {
        padding: 0.6em 0;
    }

    .header-top {
        flex-direction: column;
        align-items: center;
        gap: 0.7em;
        text-align: center;
    }

    .header-top .col-md-3 img {
        max-height: 45px;
    }

    .header-contact {
        flex-direction: column;
        gap: 0.4em;
        width: 100%;
    }

    .header-contact li {
        min-width: 0;
        width: 100%;
        font-size: 10px;
        padding: 0.4em;
    }

    .header-contact li i {
        font-size: 1.1em;
        min-width: 1.6em;
        min-height: 1.6em;
    }

    .h-adress-content h6,
    .h-adress-content p {
        font-size: 10px;
    }

    /* Navbar mobile portrait */
    .navbar-nav>li>a {
        font-size: 12px;
        padding: 0.5em 0.8em;
    }

    .search-box-text input[type="text"] {
        width: 100px;
        font-size: 10px;
    }

    /* Dropdown mobile portrait */
    .dropdown-menu-3col {
        padding: 1rem;
        border-radius: 0;
        max-height: 80vh;
        overflow-y: auto;
        top: 54px;
    }

    .dropdown-menu-3col .row {
        flex-direction: column;
        gap: 1rem;
        max-width: none;
    }

    .dropdown-menu-3col .col-4 {
        flex: 1 1 auto;
        min-width: auto;
        max-width: none;
        padding: 0;
    }

    .dropdown-menu-3col .dropdown-header {
        font-size: 0.85rem;
        font-weight: 600;
        padding: 0.5rem 0 0.25rem 0;
        margin-bottom: 0.5rem;
        border-bottom: 1px solid var(--primary);
        text-transform: none;
        letter-spacing: normal;
    }

    .dropdown-menu-3col .dropdown-item {
        font-size: 0.8rem;
        padding: 0.4rem 0.5rem;
        margin: 0 0 0.1rem 0;
        border-radius: 6px;
    }

    .dropdown-menu-3col .dropdown-item:hover {
        transform: translateX(2px);
        padding-left: 0.7rem;
    }

    /* Events mobile portrait */
    .event-items {
        min-height: 300px;
    }

    .event-img img {
        height: 120px;
    }

    .section-header h2 {
        font-size: 1em;
    }

    .events-content {
        padding: 0.8em 0.6em 1em 0.6em;
    }

    /* Latest News mobile portrait */
    .post-images img {
        height: 140px;
    }

    .latest_news h3 {
        font-size: 0.85rem;
        min-height: 2rem;
    }

    /* Partners mobile portrait */
    .partners-option {
        padding: 1rem;
    }

    .swiper-slide {
        min-width: 100px;
    }

    .sopnsors-items img {
        max-width: 80px;
        max-height: 50px;
    }
}

/* Ultra Small screens (400px and below) - Very Small Mobile */
@media (max-width: 400px) {
    .container {
        padding: 0 10px;
    }

    /* Header ultra small */
    .header-style-1 .bg-header-top {
        padding: 0.5em 0;
    }

    .header-top .col-md-3 img {
        max-height: 35px;
    }

    .header-contact li {
        font-size: 9px;
        padding: 0.3em;
    }

    .header-contact li i {
        font-size: 1em;
        min-width: 1.4em;
        min-height: 1.4em;
    }

    .h-adress-content h6,
    .h-adress-content p {
        font-size: 9px;
    }

    /* Navbar ultra small */
    .navbar-nav>li>a {
        font-size: 11px;
        padding: 0.4em 0.6em;
    }

    .search-box-text input[type="text"] {
        width: 80px;
        font-size: 9px;
    }

    /* Dropdown ultra small */
    .dropdown-menu-3col {
        padding: 0.75rem;
        top: 52px;
    }

    .dropdown-menu-3col .row {
        gap: 0.75rem;
    }

    .dropdown-menu-3col .dropdown-header {
        font-size: 0.8rem;
        padding: 0.4rem 0 0.2rem 0;
        margin-bottom: 0.4rem;
    }

    .dropdown-menu-3col .dropdown-item {
        font-size: 0.75rem;
        padding: 0.35rem 0.4rem;
        line-height: 1.3;
    }

    /* Events ultra small */
    .event-items {
        min-height: 280px;
    }

    .event-img img {
        height: 100px;
    }

    .events-content {
        padding: 0.6em 0.4em 0.8em 0.4em;
    }
}

/* Landscape orientation pada mobile */
@media (max-width: 767px) and (orientation: landscape) {
    .dropdown-menu-3col {
        max-height: 60vh;
        overflow-y: auto;
        padding: 1rem 1.5rem;
        top: 50px;
    }

    .dropdown-menu-3col .row {
        flex-direction: row;
        gap: 1rem;
    }

    .dropdown-menu-3col .col-4 {
        flex: 1 1 33.333%;
        min-width: 150px;
    }

    .header-top {
        flex-direction: row;
        justify-content: space-between;
    }

    .header-contact {
        flex-direction: row;
        gap: 0.5em;
    }

    .header-contact li {
        min-width: 120px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .dropdown-menu-3col {
        transition: all 0.3s ease-out;
    }

    .dropdown-menu-3col .dropdown-item:hover {
        background: rgba(0, 185, 173, 0.15);
        transform: none;
        padding-left: 0.75rem;
    }

    /* Larger touch targets */
    .dropdown-menu-3col .dropdown-item {
        padding: 0.6rem 0.75rem;
        margin: 0 0 0.2rem 0;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .navbar-nav>li>a {
        min-height: 44px;
        display: flex;
        align-items: center;
        text-align: left !important;
    }

    .header-contact li {
        min-height: 40px;
        display: flex;
        align-items: center;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    .dropdown-menu-3col {
        box-shadow: 0 8px 32px rgba(0, 185, 173, 0.12);
    }

    .post-images {
        box-shadow: 0 6px 24px rgba(0, 185, 173, 0.1);
    }
}

/* Print styles */
@media print {

    .dropdown-menu-3col,
    .header-contact,
    .menu-right-option {
        display: none !important;
    }

    .header-top .col-md-3 img {
        max-height: 40px;
    }

    body {
        font-size: 12pt;
        line-height: 1.4;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {

    .dropdown-menu-3col,
    .dropdown-menu-3col .dropdown-item,
    .dropdown-toggle::after,
    .post-images,
    .event-items,
    .partners-option {
        transition: none;
    }

    .dropdown-menu-3col .dropdown-item:hover,
    .post-images:hover,
    .event-items:hover {
        transform: none;
    }

    @keyframes scroll-partners {

        0%,
        100% {
            transform: translateX(0);
        }
    }
}

/* Container overflow fixes */
@media (max-width: 767px) {
    .navbar-collapse {
        max-height: none;
        overflow: visible;
    }

    .navbar .container {
        position: relative;
        overflow: visible;
    }

    body {
        overflow-x: hidden;
    }

    .header-top {
        overflow: hidden;
    }
}

/* Smooth scrollbar untuk dropdown content */
.dropdown-menu-3col::-webkit-scrollbar {
    width: 6px;
}

.dropdown-menu-3col::-webkit-scrollbar-track {
    background: rgba(0, 185, 173, 0.1);
    border-radius: 3px;
}

.dropdown-menu-3col::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.dropdown-menu-3col::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Footer responsive accordion */
@media (max-width: 767.98px) {
    .footer-custom .accordion-button {
        background: var(--primary-dark, #00B9AD);
        color: #fff;
        font-weight: 600;
        border-radius: 12px;
        margin-bottom: 4px;
        min-height: 48px;
        display: flex;
        align-items: center;
    }

    .footer-custom .accordion-body {
        background: #fff;
        color: #333;
        border-radius: 0 0 12px 12px;
        padding: 1rem;
    }
}

/* Additional utility classes */
@media (max-width: 991px) {
    .d-lg-none {
        display: none !important;
    }

    .d-lg-block {
        display: block !important;
    }
}

@media (max-width: 767px) {
    .d-md-none {
        display: none !important;
    }

    .d-md-block {
        display: block !important;
    }

    .text-center-mobile {
        text-align: center !important;
    }

    .w-100-mobile {
        width: 100% !important;
    }
}

@media (max-width: 575px) {
    .d-sm-none {
        display: none !important;
    }

    .d-sm-block {
        display: block !important;
    }
}

/* Performance optimizations */
* {
    box-sizing: border-box;
}

@media (max-width: 767px) {
    * {
        -webkit-tap-highlight-color: transparent;
    }

    img {
        max-width: 100%;
        height: auto;
    }

    .container,
    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
}