/* 
 * Mobile Web Version - Optimized for Smartphones and Tablets
 * SLiMS Modern Template - Islahiyah Theme
 * Author: Erwan Setyo Budi
 */

/* ===== BASE MOBILE STYLES ===== */
@media (max-width: 768px) {
    
    /* Reset & Typography */
    body {
        font-size: 14px;
        line-height: 1.5;
        overflow-x: hidden;
    }
    
    h1, .h1 { font-size: 1.8rem; }
    h2, .h2 { font-size: 1.5rem; }
    h3, .h3 { font-size: 1.3rem; }
    h4, .h4 { font-size: 1.1rem; }
    
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    /* ===== TOP ANNOUNCEMENT ===== */
    .top-announcement .d-flex {
        flex-wrap: wrap;
    }
    
    .top-announcement .promo-link {
        order: 3;
        width: 100%;
        text-align: center;
        margin: 5px 0;
        font-size: 12px;
    }
    
    .language-dropdown .dropdown-menu {
        position: fixed !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 90% !important;
        max-width: 300px;
        max-height: 80vh;
        overflow-y: auto;
    }
    
    /* ===== MIDBAR / STICKY HEADER ===== */
    .midbar .d-flex {
        flex-wrap: wrap;
    }
    
    .midbar .d-flex.align-items-center.gap-3 {
        gap: 0.5rem !important;
    }
    
    .midbar .btn-outline-secondary.icon-btn,
    .midbar .btn-primary.icon-btn {
        width: 40px;
        height: 40px;
        padding: 0;
        font-size: 1.2rem;
    }
    
    .midbar .btn-primary.d-none.d-md-inline-flex {
        display: none !important;
    }
    
    .midbar .btn-primary.icon-btn.d-md-none {
        display: flex !important;
    }
    
    .account-link {
        display: none !important;
    }
    
    .badge.bg-danger.rounded-pill {
        font-size: 8px !important;
        padding: 2px 4px !important;
    }
    
    /* ===== SEARCH FORM ===== */
    .search-wrap .search-input {
        height: 48px;
        font-size: 14px;
        padding-left: 40px;
        padding-right: 12px;
    }
    
    .search-wrap .search-ico {
        left: 12px;
        font-size: 1.2rem;
    }
    
    .kbd-hint {
        display: none !important;
    }
    
    /* ===== NAVIGATION ===== */
    .navbar {
        padding: 0.5rem 0;
    }
    
    .navbar .container {
        flex-wrap: wrap;
    }
    
    .departments-btn {
        width: 100%;
        text-align: left;
        margin-bottom: 0.5rem;
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .navbar-toggler {
        position: absolute;
        right: 12px;
        top: -45px;
    }
    
    #mainNav {
        width: 100%;
        background: var(--bs-body-bg);
        border-radius: 12px;
        padding: 0.5rem;
        margin-top: 0.5rem;
    }
    
    .navbar-nav {
        width: 100%;
    }
    
    .nav-item {
        width: 100%;
        margin: 2px 0;
    }
    
    .nav-link {
        padding: 10px 12px !important;
        border-radius: 8px;
    }
    
    /* Mega menu mobile */
    .mega-menu {
        position: static !important;
        transform: none !important;
        min-width: 100% !important;
        margin-top: 0.5rem !important;
        border-radius: 8px !important;
    }
    
    .mega-inner {
        max-height: none;
        padding: 1rem !important;
    }
    
    .mega-inner .row {
        display: block;
    }
    
    .mega-inner .col-12.col-lg-4 {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .mega-title {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .mega-item {
        padding: 0.4rem 0.5rem;
        font-size: 0.9rem;
    }
    
    /* ===== HERO SECTION ===== */
    .hero-grid .row.g-3 {
        display: flex;
        flex-direction: column;
    }
    
    .hero-big {
        min-height: 200px !important;
        padding: 1rem !important;
    }
    
    .hero-title {
        font-size: 1.3rem !important;
    }
    
    .hero-sub {
        font-size: 0.9rem !important;
    }
    
    .hero-content .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .hero-small {
        height: auto !important;
        min-height: 100px;
    }
    
    .hero-small .d-flex {
        padding: 0.75rem !important;
    }
    
    .hero-small h5 {
        font-size: 0.9rem !important;
    }
    
    .badge-hot {
        top: 8px;
        right: 8px;
        padding: 4px 10px;
        font-size: 0.7rem;
    }
    
    /* ===== SECTION HEADERS ===== */
    .section-head {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    .swiper-nav {
        order: 3;
        width: 100%;
        display: flex;
        justify-content: center;
        gap: 1rem;
    }
    
    .swiper-btn {
        width: 36px;
        height: 36px;
    }
    
    /* ===== POPULAR CATEGORIES ===== */
    #categorySlider .swiper-slide {
        width: 200px !important;
    }
    
    .category-card-inner {
        height: 80px !important;
        padding: 0.75rem !important;
    }
    
    .category-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 1.2rem !important;
    }
    
    .category-title {
        font-size: 0.8rem !important;
    }
    
    .category-count {
        font-size: 0.65rem !important;
    }
    
    .category-initial {
        font-size: 2.5rem !important;
    }
    
    /* ===== COLLECTIONS SECTIONS ===== */
    .block-split .row.g-0 {
        display: flex;
        flex-direction: column;
    }
    
    .left-banner {
        min-height: 150px;
        border-radius: 16px 16px 0 0 !important;
    }
    
    .left-banner .inner {
        padding: 1rem !important;
    }
    
    .left-banner .tag {
        margin-bottom: 0.5rem;
    }
    
    .left-banner h4 {
        font-size: 1.2rem;
        margin-bottom: 0.25rem !important;
    }
    
    .left-banner p {
        font-size: 0.8rem;
        margin-bottom: 0.5rem !important;
    }
    
    .left-banner .btn {
        padding: 0.4rem;
        font-size: 0.8rem;
    }
    
    .col-12.col-lg-9.p-3 {
        padding: 1rem !important;
    }
    
    .p-card .p-thumb {
        aspect-ratio: 3/4;
    }
    
    .p-meta {
        padding: 0.75rem;
    }
    
    .p-title {
        font-size: 0.8rem;
    }
    
    .p-sub {
        font-size: 0.7rem;
    }
    
    .btn-outline-secondary.btn-sm.btn-icon {
        width: 28px;
        height: 28px;
        padding: 0;
    }
    
    /* ===== TOP READER SECTION ===== */
    .reader-card {
        max-width: 200px;
        margin: 0 auto;
    }
    
    .reader-avatar-wrapper {
        padding: 1rem 0.5rem !important;
    }
    
    .reader-avatar {
        width: 70px !important;
        height: 70px !important;
    }
    
    .reader-rank {
        font-size: 0.8rem !important;
        padding: 0.2rem 0.6rem !important;
    }
    
    .reader-name {
        font-size: 0.9rem !important;
    }
    
    .reader-meta {
        font-size: 0.7rem !important;
    }
    
    .reader-stats .stat-item {
        font-size: 0.7rem !important;
    }
    
    .reader-badge {
        font-size: 0.7rem !important;
        padding: 0.3rem !important;
    }
    
    /* ===== BENEFITS SLIDER ===== */
    .benefits-slider .d-flex {
        flex-direction: column;
        text-align: center;
        align-items: center !important;
    }
    
    .benefits-slider .rounded-circle {
        margin-bottom: 0.5rem;
    }
    
    .benefits-slider .fs-5 {
        font-size: 1rem !important;
    }
    
    .benefits-slider .text-secondary.small {
        font-size: 0.8rem !important;
    }
    
    /* ===== APP DOWNLOAD SECTION ===== */
    .fs-2 {
        font-size: 1.3rem !important;
    }
    
    .fs-5.fw-medium {
        font-size: 0.9rem !important;
    }
    
    .download-btn {
        height: 40px !important;
    }
    
    .download-btn img {
        height: 100%;
        width: auto;
    }
    
    /* ===== E-RESOURCES ===== */
    .eresource-header {
        padding: 1rem 0.5rem !important;
    }
    
    .eresource-logo {
        height: 30px !important;
    }
    
    .eresource-category {
        font-size: 0.6rem !important;
        padding: 0.15rem 0.5rem !important;
    }
    
    .eresource-body {
        padding: 0.75rem !important;
    }
    
    .eresource-title {
        font-size: 0.9rem !important;
    }
    
    .eresource-description {
        font-size: 0.75rem !important;
    }
    
    .eresource-body .btn {
        padding: 0.3rem !important;
        font-size: 0.7rem !important;
    }
    
    /* ===== BLOG SECTION ===== */
    .blog-header {
        min-height: 100px !important;
        padding: 1rem 0.5rem !important;
    }
    
    .first-letter {
        font-size: 3rem !important;
    }
    
    .second-letter {
        font-size: 1.5rem !important;
    }
    
    .blog-category {
        font-size: 0.6rem !important;
        padding: 0.2rem 0.6rem !important;
    }
    
    .blog-body {
        padding: 0.75rem !important;
    }
    
    .blog-title {
        font-size: 0.9rem !important;
    }
    
    .blog-excerpt {
        font-size: 0.75rem !important;
    }
    
    .blog-footer .btn {
        padding: 0.2rem 0.5rem !important;
        font-size: 0.7rem !important;
    }
    
    /* ===== BOTTOM BANNER ===== */
    .p-4.rounded-4.border {
        padding: 1rem !important;
    }
    
    .p-4.rounded-4.border h4 {
        font-size: 1.1rem;
    }
    
    .p-4.rounded-4.border p {
        font-size: 0.8rem;
    }
    
    .p-4.rounded-4.border .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    /* ===== FOOTER ===== */
    footer .d-flex.justify-content-between {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }
    
    footer .text-end {
        text-align: left !important;
        width: 100%;
    }
    
    footer .fw-semibold.text-secondary {
        font-size: 0.9rem !important;
    }
    
    footer .row {
        display: block;
    }
    
    footer .col-lg-8,
    footer .col-lg-4 {
        width: 100%;
    }
    
    footer .col-6.col-md-3 {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    footer .text-lg-end {
        text-align: left !important;
    }
    
    footer .d-flex.justify-content-lg-end {
        justify-content: flex-start !important;
    }
    
    /* ===== MODAL ===== */
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    /* ===== SEARCH RESULTS ===== */
    .result-search .row {
        display: flex;
        flex-direction: column;
    }
    
    .col-md-3 {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .col-md-9 {
        width: 100%;
    }
    
    .d-flex.justify-content-between.align-items-center {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem;
    }
    
    .form-inline.pl-3 {
        padding-left: 0 !important;
        width: 100%;
    }
    
    .form-inline.pl-3 .custom-select-sm {
        width: 100%;
    }
    
    .form-inline.pl-3 form {
        margin-left: 0 !important;
        margin-top: 0.5rem;
        width: 100%;
    }
    
    .form-inline.pl-3 form .btn {
        width: 100%;
    }
    
    /* ===== MEMBER AREA ===== */
    .member-area .d-flex {
        flex-direction: column;
    }
    
    .member-area #member_sidebar {
        width: 100%;
        position: static;
        margin-bottom: 1rem;
    }
    
    .member-area .nav-tabs {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        padding: 0.25rem;
    }
    
    .member-area .nav-tabs .nav-link {
        white-space: nowrap;
    }
    
    .memberLoanList,
    .memberBookmarkList,
    .memberBasketList {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .memberLoanList td,
    .memberBookmarkList td,
    .memberBasketList td {
        min-width: 120px;
    }
    
    .memberBasketAction {
        flex-direction: column;
    }
    
    .memberBasketAction .btn {
        width: 100%;
    }
    
    /* ===== DETAIL PAGE ===== */
    .row.g-5 {
        --bs-gutter-y: 1.5rem;
        flex-direction: column;
    }
    
    .col-md-5,
    .col-md-7 {
        width: 100%;
    }
    
    .book-cover img,
    .book-cover-placeholder {
        min-height: 250px !important;
    }
    
    .spec-item {
        flex-wrap: wrap;
        padding: 0.5rem 0;
    }
    
    .spec-label {
        width: 100%;
        margin-bottom: 0.25rem;
    }
    
    .spec-value {
        width: 100%;
        padding-left: 2rem;
    }
    
    .availability-table {
        overflow-x: auto;
    }
    
    .slider-container {
        padding: 0 30px;
    }
    
    .swiper-button-next,
    .swiper-button-prev {
        width: 32px;
        height: 32px;
    }
    
    .swiper-button-next:after,
    .swiper-button-prev:after {
        font-size: 14px;
    }
    
    /* ===== CITATION MODAL ===== */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.25rem;
    }
    
    .nav-tabs .nav-link {
        white-space: nowrap;
    }
    
    .d-flex.justify-content-end.gap-2 {
        flex-direction: column;
    }
    
    .d-flex.justify-content-end.gap-2 .btn {
        width: 100%;
    }
    
    /* ===== TOUCH OPTIMIZATIONS ===== */
    .btn,
    .nav-link,
    .dropdown-item,
    .mega-item,
    .category-card,
    .p-card,
    .reader-card,
    .eresource-card,
    .blog-card {
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    
    .btn:active,
    .nav-link:active,
    .dropdown-item:active,
    .mega-item:active {
        opacity: 0.7;
        transform: scale(0.98);
    }
    
    /* ===== LOADING STATES ===== */
    .spinner-border {
        width: 1.5rem;
        height: 1.5rem;
    }
}