/* =====================================================
   RESPONSIVE UTILITY CSS - Pesantren Darul Iman
   File ini berisi utility classes untuk responsive design
   ===================================================== */

/* Base responsive utilities */
.hide-mobile {
    display: block;
}

.show-mobile {
    display: none;
}

.text-center-mobile {
    text-align: left;
}

/* Container responsive */
.container-fluid {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

/* Responsive images */
.img-responsive {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Touch-friendly targets for mobile */
@media (max-width: 768px) {

    /* Increase touch targets */
    a,
    button,
    input[type="button"],
    input[type="submit"] {
        min-height: 44px;
    }

    .hide-mobile {
        display: none !important;
    }

    .show-mobile {
        display: block !important;
    }

    .text-center-mobile {
        text-align: center !important;
    }

    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
    }

    /* Better spacing on mobile */
    .p-mobile-sm {
        padding: 10px !important;
    }

    .m-mobile-sm {
        margin: 10px !important;
    }
}

/* Mobile Small - 480px */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.3rem;
    }

    h4 {
        font-size: 1.1rem;
    }

    .container-fluid {
        padding-right: 10px;
        padding-left: 10px;
    }
}

/* Extra Small Mobile - 360px */
@media (max-width: 360px) {
    html {
        font-size: 13px;
    }

    h1 {
        font-size: 1.6rem;
    }

    h2 {
        font-size: 1.4rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    .container-fluid {
        padding-right: 8px;
        padding-left: 8px;
    }
}

/* Tablet Portrait - 768px to 1024px */
@media (min-width: 769px) and (max-width: 1024px) {
    .hide-tablet {
        display: none !important;
    }

    .show-tablet {
        display: block !important;
    }
}

/* Landscape orientation */
@media (orientation: landscape) and (max-height: 500px) {
    .navbar {
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .navbar img {
        height: 2rem;
    }
}

/* High DPI / Retina displays */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

    /* Crisp images on retina */
    img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Print styles */
@media print {

    .navbar,
    .hamburger-menu,
    .sidebar,
    .btn,
    button {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    a {
        text-decoration: underline;
    }
}

/* Safe area insets for notched phones */
@supports (padding: max(0px)) {
    .navbar {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }

    body {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Smooth scrolling */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Reduce animations for users who prefer */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Uncomment below to enable dark mode */
    /*
    body {
        background-color: #1a1a1a;
        color: #f5f5f5;
    }
    */
}