/* ═══════════════════════════════════════════════════════
   BoxCricket — Dashboard-only Mobile Responsive
   DOES NOT touch home page or general layout
   ═══════════════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 1024px) {
    .dashboard-layout .dashboard-main {
        padding: 16px !important;
    }
    .form-grid-2 {
        grid-template-columns: 1fr !important;
    }
}

/* Mobile - only dashboard & forms */
@media (max-width: 768px) {
    /* Dashboard sidebar becomes horizontal scroll */
    .dashboard-layout {
        flex-direction: column !important;
    }
    .dashboard-layout .sidebar {
        width: 100% !important;
        height: auto !important;
        position: static !important;
        padding: 10px !important;
    }
    .dashboard-layout .sidebar-menu {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        gap: 6px;
        padding-bottom: 4px;
    }
    .dashboard-layout .sidebar-menu a {
        padding: 8px 14px !important;
        font-size: 13px !important;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .dashboard-layout .dashboard-main {
        padding: 14px !important;
    }

    /* Cards inside dashboards */
    .dashboard-layout .card,
    .dashboard-layout .form-card {
        padding: 14px !important;
        margin-bottom: 12px !important;
    }

    /* Dashboard grid layouts */
    .dashboard-layout [style*="grid-template-columns: 1fr 340px"],
    .dashboard-layout [style*="grid-template-columns: 2fr 1fr"],
    .dashboard-layout [style*="grid-template-columns: 1fr 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    /* Tables scroll horizontally */
    .dashboard-layout table {
        min-width: 600px;
    }
    .dashboard-layout .table-wrapper,
    .dashboard-layout .table-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Forms */
    .form-grid-2 {
        grid-template-columns: 1fr !important;
    }
}

/* Small phone */
@media (max-width: 480px) {
    .dashboard-layout .sidebar-menu a {
        padding: 6px 10px !important;
        font-size: 12px !important;
    }
    
    /* QR + amenities */
    .dashboard-layout [style*="max-width:200px"][style*="max-height:200px"] {
        max-width: 150px !important;
        max-height: 150px !important;
    }
}

/* Anti-horizontal-scroll on small screens (mobile only) */
@media (max-width: 768px) {
    html, body {
        max-width: 100vw;
        overflow-x: hidden;
    }
    main {
        max-width: 100vw;
        overflow-x: hidden;
    }
}

html { width: 100%; }
body { width: 100%; position: relative; margin: 0; }
main { width: 100%; }

/* Global safety: prevent any element from pushing page wider than viewport */
@media (max-width: 820px) {
    img, video, iframe, table, pre, code {
        max-width: 100%;
    }
    .container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}

/* Footer links visibility fix - make text & icons readable */
.footer p, 
.footer a,
.footer .footer-links a,
.footer .footer-contact p {
    color: rgba(255, 255, 255, 0.85) !important;
}

.footer .footer-links a:hover {
    color: var(--lime, #c6f24e) !important;
    text-decoration: underline !important;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.7) !important;
}

.footer .social-links a {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 20px !important;
    margin-right: 12px !important;
}
.footer .social-links a:hover {
    color: var(--lime, #c6f24e) !important;
    transform: translateY(-2px);
}

.footer h4 {
    color: #fff !important;
}

/* ═══════════════════════════════════════════════════════════
   Footer layout — classes used in layouts/app.blade.php
   (footer-brand, footer-links, footer-contact, social-links)
   ═══════════════════════════════════════════════════════════ */
.footer .footer-links,
.footer .footer-contact,
.footer .footer-brand {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer .footer-links h4,
.footer .footer-contact h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #fff !important;
}

.footer .footer-links a {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85) !important;
    text-decoration: none;
    transition: color .2s;
    padding: 2px 0;
}

.footer .footer-contact p {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85) !important;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.footer .footer-contact p i {
    color: var(--lime, #c6f24e);
    font-size: 15px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.footer .footer-brand p {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.75) !important;
    margin: 4px 0 12px;
}

.footer .social-links {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}
.footer .social-links a {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    margin: 0 !important;
    transition: all .2s;
}
.footer .social-links a:hover {
    background: var(--lime, #c6f24e);
    color: var(--navy, #0B2545) !important;
    transform: translateY(-2px);
}

.footer .footer-brand .navbar-brand {
    color: #fff !important;
    font-size: 22px;
    font-weight: 800;
}
.footer .footer-brand .navbar-brand:hover {
    color: #fff !important;
}

/* Mobile footer stacking */
@media (max-width: 768px) {
    .footer {
        padding: 40px 20px 16px !important;
        text-align: left;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 28px !important;
    }
    .footer-brand {
        grid-column: 1 / -1;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }
}

/* ═══════════════════════════════════════════════════════════
   GROUND DETAIL PAGE — mobile fixes
   Prevents horizontal overflow on small screens
   ═══════════════════════════════════════════════════════════ */

/* amenity-tag class is used in ground show page but has no base style */
.amenity-tag {
    display: inline-block;
    padding: 3px 10px;
    background: var(--gray-100, #f1f5f9);
    border: 1px solid var(--gray-200, #e2e8f0);
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted, #4A5B75);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

@media (max-width: 768px) {
    /* Hero gallery */
    .ground-hero-gallery {
        padding: 0 16px !important;
        height: auto !important;
        flex-direction: column !important;
    }
    .gallery-main {
        height: 240px;
    }
    .gallery-thumbs {
        display: none !important;
    }

    /* Ground detail headings — scale down */
    .ground-info-col h1 {
        font-size: 1.4rem !important;
        line-height: 1.3 !important;
        word-wrap: break-word;
    }

    /* Booking widget - reduce padding */
    .booking-widget {
        padding: 16px !important;
    }

    /* Map iframe full-width */
    .ground-info-col iframe {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Container gets lighter padding */
    .ground-detail-grid {
        gap: 20px !important;
    }

    /* Amenities - smaller pills */
    .amenity-pill {
        font-size: 12px !important;
        padding: 6px 11px !important;
        max-width: 100%;
        white-space: normal;
    }

    /* Ensure amenity container wraps and doesn't overflow */
    .ground-section > div[style*="flex-wrap"] {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .ground-info-col h1 {
        font-size: 1.25rem !important;
    }
    .gallery-main { height: 200px; }
    .booking-widget { padding: 14px !important; }

    /* Tiny screen — make tags smaller */
    .amenity-tag, .status-badge {
        font-size: 10px !important;
        padding: 3px 8px !important;
    }
}

/* Additional safety — ensure containers never exceed viewport */
.ground-hero,
.ground-hero-gallery,
.ground-detail-grid,
.booking-widget,
.footer,
.footer-grid {
    max-width: 100%;
    box-sizing: border-box;
}

/* CRITICAL: Grid children default to min-width: auto which can overflow.
   Force min-width: 0 so long text inside grid columns doesn't push parent wider. */
.ground-detail-grid,
.ground-info-col,
.booking-widget-col,
.booking-widget,
.footer-grid,
.footer-brand,
.footer-links,
.footer-contact {
    min-width: 0;
}

/* Prevent any long word/url from pushing page wider */
.ground-info-col,
.ground-info-col * {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Hero section safety */
.ground-hero {
    width: 100%;
    overflow: hidden;
}

/* Ground detail container itself - ensure it respects viewport */
main > .container {
    max-width: 100%;
    box-sizing: border-box;
}
