﻿/**
 * Mobile Responsive CSS for Tinh Yeu Chua
 */

/* ========== MOBILE HEADER ========== */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    border: none;
    background: #f1f5f9;
    cursor: pointer;
    padding: 10px;
    border-radius: 10px;
    transition: background 0.2s ease;
    gap: 5px
}

.mobile-menu-toggle:hover {
    background: #e2e8f0
}

.mobile-menu-toggle span {
    display: block;
    width: 22px;
    height: 3px;
    background: #1e293b;
    transition: all 0.3s ease;
    border-radius: 2px
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px)
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px)
}

.mobile-search-toggle {
    display: none;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    border: none;
    background: #f1f5f9;
    cursor: pointer;
    font-size: 18px;
    color: #64748b;
    border-radius: 10px;
    transition: all 0.2s ease
}

.mobile-search-toggle:hover {
    background: #e2e8f0;
    color: #0084ff
}

/* Header Actions - Hidden on Desktop */
.header-actions {
    display: none
}

/* ========== MOBILE SIDEBAR ========== */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: #fff;
    z-index: 99999;
    overflow-y: auto;
    transition: left 0.3s ease;
    box-shadow: 5px 0 30px rgba(0, 0, 0, 0.15)
}

.mobile-sidebar.open {
    left: 0
}

.mobile-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #0084ff 0%, #0066cc 100%)
}

.mobile-sidebar-logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff
}

.mobile-sidebar-close {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    border: none !important;
    background: rgba(255, 255, 255, 0.25) !important;
    color: #fff !important;
    font-size: 18px !important;
    line-height: 1 !important;
    text-align: center !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    aspect-ratio: 1 / 1 !important
}

.mobile-sidebar-close i {
    font-size: 18px !important;
    line-height: 1 !important
}

.mobile-sidebar-close:hover {
    background: rgba(255, 255, 255, 0.4) !important
}

/* Mobile Menu */
.mobile-menu {
    padding: 10px 0
}

.mobile-menu ul {
    list-style: none;
    margin: 0;
    padding: 0
}

.mobile-menu>ul>li {
    border-bottom: 1px solid #f1f5f9
}

.mobile-menu>ul>li>a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    text-decoration: none;
    transition: all 0.2s ease
}

.mobile-menu>ul>li>a:hover,
.mobile-menu>ul>li.current-menu-item>a {
    background: #f8fafc;
    color: #0084ff
}

.mobile-menu .menu-item-has-children>a::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 12px;
    transition: transform 0.3s ease
}

.mobile-menu .menu-item-has-children.open>a::after {
    transform: rotate(180deg)
}

/* Mobile Submenu */
.mobile-menu .sub-menu {
    display: none;
    background: #f8fafc;
    padding: 5px 0
}

.mobile-menu .menu-item-has-children.open>.sub-menu {
    display: block
}

.mobile-menu .sub-menu li a {
    display: block;
    padding: 12px 20px 12px 35px;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    text-decoration: none;
    transition: all 0.2s ease
}

.mobile-menu .sub-menu li a:hover {
    color: #0084ff;
    padding-left: 40px
}

/* Mobile Search */
.mobile-search {
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #fff
}

.mobile-search-form {
    display: flex !important;
    align-items: center !important;
    background: #f1f5f9 !important;
    border-radius: 999px !important;
    padding: 4px !important;
    border: none !important;
    box-shadow: none !important;
    height: 50px !important
}

.mobile-search-input,
.mobile-search input[type="text"] {
    flex: 1 !important;
    height: 42px !important;
    border: none !important;
    background: transparent !important;
    padding: 0 12px 0 14px !important;
    margin: 0 !important;
    font-size: 15px !important;
    color: #1e293b !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-appearance: none !important
}

.mobile-search-input::placeholder {
    color: #94a3b8 !important
}

.mobile-search-btn {
    flex-shrink: 0 !important;
    width: 42px !important;
    height: 42px !important;
    border: none !important;
    background: #0084ff !important;
    color: #fff !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 16px !important;
    padding: 0 !important;
    margin: 0 !important
}

.mobile-search-btn:hover {
    background: #0066cc !important
}

/* Overlay */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease
}

.mobile-overlay.show {
    opacity: 1;
    visibility: visible
}

/* ========== RESPONSIVE BREAKPOINTS ========== */

/* Tablet */
@media (max-width: 1024px) {
    .main-nav ul {
        gap: 2px
    }

    .main-nav>ul>li>a {
        padding: 8px 10px;
        font-size: 13px
    }

    .header-search-form {
        width: 220px
    }
}

/* Mobile */
@media (max-width: 768px) {

    /* Header */
    .header-top {
        padding: 8px 0;
        font-size: 12px
    }

    .header-top .container {
        flex-direction: column;
        gap: 4px;
        text-align: center
    }

    .header-main-custom {
        padding: 10px 0
    }

    .header-main-custom .container {
        gap: 10px
    }

    .logo {
        font-size: 1.25rem;
        margin-right: 0;
        flex: 1
    }

    .main-nav {
        display: none !important
    }

    .header-search-form {
        display: none !important
    }

    .mobile-menu-toggle,
    .mobile-search-toggle {
        display: flex
    }

    /* Header Buttons - All buttons in one container */
    .header-buttons {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px !important;
    }

    .header-buttons button {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        max-width: 40px !important;
        max-height: 40px !important;
        padding: 0 !important;
        margin: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 10px !important;
        background: #f1f5f9 !important;
        border: none !important;
        font-size: 16px !important;
        line-height: 1 !important;
        box-sizing: border-box !important;
        cursor: pointer !important;
    }

    .header-buttons button:hover {
        background: #e2e8f0 !important;
    }

    .header-buttons .lang-toggle .lang-code {
        font-size: 12px !important;
        font-weight: 600 !important;
    }

    .header-buttons .mobile-menu-toggle {
        flex-direction: column !important;
        gap: 5px !important;
    }

    .header-buttons .mobile-menu-toggle span {
        display: block !important;
        width: 22px !important;
        height: 3px !important;
        background: #1e293b !important;
        border-radius: 2px !important;
    }

    /* Hide old utilities and actions classes on mobile */
    .header-utilities,
    .header-actions {
        display: none !important;
    }

    /* Container */
    .container {
        padding: 0 16px
    }

    /* Hero / Loi Chua Section */
    .hero,
    .loi-chua-section,
    .gospel-section {
        min-height: auto !important;
        padding: 40px 16px !important
    }

    .hero h1,
    .loi-chua-section h2,
    .gospel-section h2 {
        font-size: 1.25rem !important;
        line-height: 1.3 !important
    }

    /* Sections */
    .section-title {
        font-size: 1.25rem !important
    }

    /* Cards Grid */
    .news-grid,
    .card-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 30px
    }

    .footer-bottom {
        flex-direction: column;
        gap: 10px;
        text-align: center
    }

    /* Search Autocomplete */
    .search-autocomplete-dropdown {
        left: -100px;
        width: 300px
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .logo {
        font-size: 1.1rem
    }

    .mobile-sidebar {
        width: 280px
    }

    .search-autocomplete-dropdown {
        left: -120px;
        width: 280px
    }
}

/* Submenu toggle button */
.mobile-menu>ul>li {
    position: relative
}

.mobile-menu>ul>li>a {
    padding-right: 60px !important
}

.mobile-menu .menu-item-has-children>a::after {
    display: none !important
}

.submenu-toggle {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    width: 50px !important;
    height: 100% !important;
    border: none !important;
    background: transparent !important;
    color: #64748b !important;
    font-size: 14px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease;
    border-left: 1px solid #f1f5f9 !important
}

.submenu-toggle:hover {
    background: #f1f5f9 !important;
    color: #0084ff !important
}

.submenu-toggle i {
    transition: transform 0.3s ease
}

.menu-item-has-children.open .submenu-toggle i {
    transform: rotate(180deg)
}