/* ========================================
   RESPONSIVE CSS FOR YAYASAN NURUL HUDA
   Mobile-First Responsive Design
   ======================================== */

/* ===================================
   BASE RESPONSIVE SETTINGS
   =================================== */
* {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    width: 100%;
}

img, video {
    max-width: 100%;
    height: auto;
}

/* ===================================
   TABLET DEVICES (768px - 991px)
   =================================== */
@media (max-width: 991px) {
    /* Typography */
    h1 { font-size: 2em !important; }
    h2 { font-size: 1.75em !important; }
    h3 { font-size: 1.5em !important; }
    h4 { font-size: 1.25em !important; }
    p { font-size: 1em; }
    
    /* Container */
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    /* Sections Padding */
    section, div[id] {
        padding: 50px 0 !important;
    }
    
    /* Cards */
    .card {
        margin-bottom: 20px;
    }
    
    /* Buttons */
    .btn, button, a.btn {
        padding: 12px 24px;
        font-size: 1em;
    }
}

/* ===================================
   MOBILE DEVICES (max-width: 768px)
   =================================== */
@media (max-width: 768px) {
    /* Typography Mobile */
    h1 { font-size: 1.75em !important; }
    h2 { font-size: 1.5em !important; }
    h3 { font-size: 1.3em !important; }
    h4 { font-size: 1.1em !important; }
    p { font-size: 0.95em; line-height: 1.6; }
    
    /* Container */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Sections */
    section, div[id] {
        padding: 40px 0 !important;
    }
    
    /* Top Bar */
    .top-bar {
        font-size: 0.75em !important;
        padding: 6px 0 !important;
    }
    
    .top-bar .d-flex {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .top-bar .d-flex > div {
        justify-content: center !important;
    }
    
    /* Navbar Brand */
    .navbar-brand {
        font-size: 0.85em !important;
    }
    
    .navbar-brand img {
        height: 45px !important;
        margin-right: 10px !important;
    }
    
    .navbar-brand div strong {
        font-size: 0.95em !important;
    }
    
    .navbar-brand div small {
        font-size: 0.8em !important;
    }
    
    /* Hero Section */
    .hero-section {
        height: auto !important;
        min-height: 500px !important;
        padding: 60px 0 40px !important;
    }
    
    .hero-section .row {
        flex-direction: column;
    }
    
    .hero-section .col-md-6 {
        width: 100%;
        padding: 20px !important;
        text-align: center !important;
    }
    
    .hero-section h2 {
        font-size: 1.5em !important;
        text-align: center !important;
        line-height: 1.4 !important;
        padding: 0 10px;
    }
    
    .hero-section .col-md-6:last-child {
        height: 350px !important;
        display: flex;
        justify-content: center;
        align-items: flex-end;
    }
    
    .hero-section img {
        position: relative !important;
        right: 0 !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: 350px !important;
        object-fit: contain;
    }
    
    /* Video Section */
    #video-profil {
        padding: 40px 0 !important;
    }
    
    #video-profil h3 {
        font-size: 1.5em !important;
        margin-bottom: 15px !important;
    }
    
    #video-profil p {
        font-size: 0.95em !important;
        margin-bottom: 30px !important;
    }
    
    #videoControls {
        padding: 12px !important;
        gap: 10px !important;
    }
    
    #playPauseBtn {
        width: 40px !important;
        height: 40px !important;
        font-size: 1em !important;
    }
    
    #currentTime, #duration {
        font-size: 0.8em !important;
        min-width: 38px !important;
    }
    
    .toggle-password {
        font-size: 11px !important;
    }
    
    /* Cards & Content Boxes */
    .card {
        margin-bottom: 20px;
    }
    
    .card-body {
        padding: 15px !important;
    }
    
    .card-title {
        font-size: 1.1em !important;
    }
    
    .card-text {
        font-size: 0.9em !important;
    }
    
    /* Tables */
    table {
        font-size: 0.85em;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Forms */
    .form-control, input, textarea, select {
        font-size: 16px !important; /* Prevent zoom on iOS */
    }
    
    /* Buttons */
    .btn, button, a.btn {
        padding: 10px 20px;
        font-size: 0.95em;
        width: auto;
    }
    
    /* Grid System */
    .row {
        margin-left: 0;
        margin-right: 0;
    }
    
    .col-md-1, .col-md-2, .col-md-3, .col-md-4, 
    .col-md-5, .col-md-6, .col-md-7, .col-md-8, 
    .col-md-9, .col-md-10, .col-md-11, .col-md-12 {
        flex: 0 0 100%;
        max-width: 100%;
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Spacing Utilities */
    .mb-5, .my-5 {
        margin-bottom: 2rem !important;
    }
    
    .mt-5, .my-5 {
        margin-top: 2rem !important;
    }
    
    .pb-5, .py-5 {
        padding-bottom: 2rem !important;
    }
    
    .pt-5, .py-5 {
        padding-top: 2rem !important;
    }
}

/* ===================================
   SMALL MOBILE (max-width: 576px)
   =================================== */
@media (max-width: 576px) {
    /* Typography Extra Small */
    h1 { font-size: 1.5em !important; }
    h2 { font-size: 1.3em !important; }
    h3 { font-size: 1.2em !important; }
    h4 { font-size: 1em !important; }
    p { font-size: 0.9em; }
    
    /* Container */
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Hero Section */
    .hero-section {
        min-height: 450px !important;
        padding: 50px 0 30px !important;
    }
    
    .hero-section h2 {
        font-size: 1.3em !important;
        padding: 0 5px;
    }
    
    .hero-section .col-md-6:last-child {
        height: 300px !important;
    }
    
    .hero-section img {
        max-height: 300px !important;
    }
    
    /* Video Section */
    #video-profil h3 {
        font-size: 1.3em !important;
    }
    
    /* Navbar Brand */
    .navbar-brand div strong {
        font-size: 0.85em !important;
    }
    
    .navbar-brand div small {
        font-size: 0.7em !important;
    }
    
    /* Sections */
    section, div[id] {
        padding: 30px 0 !important;
    }
    
    /* Buttons */
    .btn, button, a.btn {
        padding: 8px 16px;
        font-size: 0.9em;
    }
    
    /* Cards */
    .card-body {
        padding: 12px !important;
    }
    
    /* Modal */
    .modal-content {
        margin: 5px;
    }
}

/* ===================================
   LANDSCAPE ORIENTATION (Mobile)
   =================================== */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        min-height: 400px !important;
        padding: 40px 0 20px !important;
    }
    
    .hero-section h2 {
        font-size: 1.2em !important;
    }
    
    .hero-section .col-md-6:last-child {
        height: 280px !important;
    }
    
    .hero-section img {
        max-height: 280px !important;
    }
    
    .navbar-collapse {
        max-height: 60vh !important;
    }
    
    section, div[id] {
        padding: 30px 0 !important;
    }
}

/* ===================================
   TOUCH DEVICE OPTIMIZATION
   =================================== */
@media (hover: none) and (pointer: coarse) {
    /* Better touch targets (minimum 44x44px) */
    .nav-link, .dropdown-item, button, a, input, select, textarea {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Remove hover effects on touch */
    .navbar-nav .nav-link:hover,
    .dropdown-item:hover,
    .btn:hover,
    a:hover {
        transform: none !important;
    }
    
    /* Improve tap highlight */
    * {
        -webkit-tap-highlight-color: rgba(0, 168, 89, 0.2);
    }
}

/* ===================================
   UTILITIES
   =================================== */

/* Hide on Mobile */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Show only on Mobile */
.show-mobile {
    display: none !important;
}

@media (max-width: 768px) {
    .show-mobile {
        display: block !important;
    }
}

/* Text Alignment Mobile */
@media (max-width: 768px) {
    .text-center-mobile {
        text-align: center !important;
    }
    
    .text-left-mobile {
        text-align: left !important;
    }
    
    .text-right-mobile {
        text-align: right !important;
    }
}

/* Full Width on Mobile */
@media (max-width: 768px) {
    .w-100-mobile {
        width: 100% !important;
    }
}

/* ===================================
   PRINT STYLES
   =================================== */
@media print {
    .navbar, .floating-info-chatbot, button, .btn {
        display: none !important;
    }
    
    body {
        background: white !important;
    }
    
    .container {
        max-width: 100% !important;
    }
}
