/* ============================================
   MOBILE RESPONSIVE STYLES
   Masjid Nur Al-Iman - Homepage
   ============================================ */

/* === TABLET & BELOW (768px) === */
@media (max-width: 768px) {

    /* Top Bar - Center Everything */
    .top-bar .container {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .top-bar-left {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
        width: 100%;
    }

    .top-bar-item {
        font-size: 0.75rem;
        justify-content: center;
    }

    /* Hide Email on Mobile */
    .top-bar-item:has(i.fa-envelope) {
        display: none !important;
    }

    .top-bar-right {
        justify-content: center;
        margin-top: 0.5rem;
    }

    /* Header - Fix Logo Overlap */
    .header-content {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 0.5rem !important;
        padding: 0.75rem 0 !important;
        position: relative;
    }

    /* Logo - HORIZONTAL (Side by Side) */
    .logo {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        margin: 0 !important;
        gap: 0.75rem !important;
    }

    .logo a {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        text-align: left !important;
        gap: 0.75rem !important;
    }

    .logo img {
        height: 50px !important;
        width: auto !important;
        margin: 0 !important;
        flex-shrink: 0;
    }

    /* Hide logo text on mobile */
    .logo span {
        display: none !important;
    }

    /* Menu Toggle - Position Properly */
    .menu-toggle {
        position: absolute !important;
        top: 1rem !important;
        right: 1rem !important;
        z-index: 100 !important;
    }

    /* Navigation - Full Width Below Logo */
    .main-nav {
        width: 100% !important;
        margin-top: 0.5rem !important;
    }

    .main-nav ul {
        flex-direction: column !important;
        width: 100% !important;
    }

    .main-nav a {
        text-align: center !important;
        width: 100% !important;
    }

    /* Hero Slider */
    .hero-slider {
        height: 350px !important;
    }

    .hero-title {
        font-size: 1.5rem !important;
    }

    .hero-caption {
        font-size: 0.875rem !important;
    }

    .hero-arrow {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.25rem !important;
    }

    /* Prayer Times */
    .prayer-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.75rem !important;
    }

    .prayer-item {
        padding: 1rem !important;
    }

    .prayer-time {
        font-size: 1.25rem !important;
    }

    /* Section Titles */
    .section-title {
        font-size: 1.5rem !important;
    }

    .section-subtitle {
        font-size: 0.875rem !important;
    }

    /* Sliders (Pengurus, Agenda, Program, Layanan) */
    .slider-container {
        padding: 0 2.5rem !important;
    }

    .slider-item {
        padding: 1rem !important;
    }

    .slider-item img {
        width: 80px !important;
        height: 80px !important;
    }

    .slider-item h4 {
        font-size: 0.875rem !important;
    }

    .slider-item p {
        font-size: 0.75rem !important;
    }

    .slider-arrow {
        width: 35px !important;
        height: 35px !important;
        font-size: 1rem !important;
    }

    /* Photo Gallery Slider */
    .photo-slider-container {
        padding: 0 2.5rem !important;
    }

    .photo-slider {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }

    .photo-arrow {
        width: 35px !important;
        height: 35px !important;
        font-size: 1rem !important;
    }

    /* Financial Widget */
    .finance-card {
        margin-bottom: 1rem;
    }

    /* Sambutan Ketua */
    .chairman-section {
        flex-direction: column !important;
        text-align: center !important;
    }

    .chairman-photo {
        width: 150px !important;
        height: 150px !important;
        margin: 0 auto 1rem !important;
    }

    /* Statistics */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }

    .stat-card {
        padding: 1.5rem 1rem !important;
    }

    .stat-number {
        font-size: 2rem !important;
    }

    /* Quick Donation */
    .donation-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }

    /* News, Video, Articles */
    .news-grid,
    .video-grid,
    .article-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    /* Pengumuman */
    .pengumuman-text {
        font-size: 0.875rem !important;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
}

/* === MOBILE PHONES (480px) === */
@media (max-width: 480px) {

    /* Container */
    .container {
        padding: 0 0.75rem !important;
    }

    /* Section Padding */
    .section {
        padding: 2rem 0 !important;
    }

    /* Top Bar - Smaller & Centered */
    .top-bar {
        padding: 0.5rem 0 !important;
        font-size: 0.7rem !important;
    }

    .top-bar .container {
        gap: 0.5rem !important;
    }

    .top-bar-item {
        font-size: 0.7rem !important;
        flex-direction: column !important;
        gap: 0.25rem !important;
    }

    .top-bar-item i {
        font-size: 0.875rem !important;
    }

    .social-icon {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.875rem !important;
    }

    /* Header - More Compact */
    .header-content {
        padding: 0.5rem 0 !important;
    }

    /* Logo - Smaller */
    .logo img {
        height: 40px !important;
    }

    .logo span {
        font-size: 0.7rem !important;
        line-height: 1.2 !important;
    }

    /* Menu Toggle - Better Position */
    .menu-toggle {
        top: 0.75rem !important;
        right: 0.75rem !important;
    }

    .menu-toggle span {
        width: 22px !important;
        height: 2.5px !important;
    }

    /* Hero Slider */
    .hero-slider {
        height: 250px !important;
    }

    .hero-title {
        font-size: 1.25rem !important;
    }

    .hero-caption {
        font-size: 0.75rem !important;
        display: none;
        /* Hide caption on very small screens */
    }

    .btn-lg {
        padding: 0.5rem 1rem !important;
        font-size: 0.875rem !important;
    }

    /* Prayer Times */
    .prayer-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }

    .prayer-item {
        padding: 0.75rem !important;
    }

    .prayer-name {
        font-size: 0.75rem !important;
    }

    .prayer-time {
        font-size: 1rem !important;
    }

    /* Section Headers */
    .section-header {
        margin-bottom: 1.5rem !important;
    }

    .section-title {
        font-size: 1.25rem !important;
    }

    .section-subtitle {
        font-size: 0.75rem !important;
    }

    /* Sliders */
    .slider-container {
        padding: 0 2rem !important;
    }

    .slider-item {
        padding: 0.75rem !important;
    }

    .slider-item img {
        width: 60px !important;
        height: 60px !important;
    }

    .slider-item h4 {
        font-size: 0.75rem !important;
    }

    .slider-item p {
        font-size: 0.7rem !important;
    }

    .slider-arrow {
        width: 30px !important;
        height: 30px !important;
        font-size: 0.875rem !important;
    }

    /* Photo Gallery */
    .photo-slider-container {
        padding: 0 2rem !important;
    }

    .photo-slider {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    .photo-arrow {
        width: 30px !important;
        height: 30px !important;
        font-size: 0.875rem !important;
    }

    /* Financial Widget - Stack Vertically */
    div[style*="grid-template-columns: 1fr 2fr 1fr"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
    }

    .finance-card {
        width: 100% !important;
    }

    /* QRIS Card */
    .finance-card img {
        max-width: 150px !important;
    }

    /* Saldo */
    .finance-card div[style*="font-size: 1.75rem"] {
        font-size: 1.5rem !important;
    }

    /* Statistics */
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .stat-card {
        padding: 1rem !important;
    }

    .stat-icon {
        font-size: 2rem !important;
    }

    .stat-number {
        font-size: 1.75rem !important;
    }

    /* Quick Donation */
    .donation-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    .donation-btn {
        padding: 1rem !important;
        font-size: 0.875rem !important;
    }

    /* Cards */
    .card {
        margin-bottom: 1rem;
    }

    .card-body {
        padding: 1rem !important;
    }

    .card-title {
        font-size: 1rem !important;
    }

    .card-text {
        font-size: 0.875rem !important;
    }

    /* Pengumuman */
    .pengumuman-text {
        font-size: 0.75rem !important;
        padding: 0.5rem !important;
    }

    /* WhatsApp Float */
    .whatsapp-float {
        width: 50px !important;
        height: 50px !important;
        bottom: 1rem !important;
        right: 1rem !important;
        font-size: 1.5rem !important;
    }

    /* Buttons */
    .btn {
        padding: 0.5rem 1rem !important;
        font-size: 0.875rem !important;
    }
}

/* === VERY SMALL PHONES (360px) === */
@media (max-width: 360px) {
    .hero-slider {
        height: 200px !important;
    }

    .hero-title {
        font-size: 1rem !important;
    }

    .prayer-grid {
        grid-template-columns: 1fr !important;
    }

    .section-title {
        font-size: 1.125rem !important;
    }

    .slider-container {
        padding: 0 1.5rem !important;
    }

    .photo-slider-container {
        padding: 0 1.5rem !important;
    }
}