/* Mobile Responsive Styles - v2024-12-20 */
/* Include this file in all HTML pages for consistent mobile experience */

/* ============================================
   MOBILE MENU COMPONENT
   ============================================ */

/* Hamburger Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--brand-dark, #1F2937);
    transition: all 0.3s ease;
    border-radius: 2px;
}

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

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

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

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Mobile Menu Panel */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100%;
    background: #fff;
    z-index: 1000;
    padding: 80px 24px 24px;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    transition: right 0.3s ease;
    overflow-y: auto;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu a {
    display: block;
    padding: 16px 0;
    color: var(--brand-dark, #1F2937);
    text-decoration: none;
    font-size: 1.125rem;
    font-weight: 500;
    border-bottom: 1px solid #E5E7EB;
    transition: color 0.2s;
}

.mobile-menu a:hover {
    color: var(--brand-primary, #0D9488);
}

.mobile-menu a.btn-nav {
    display: inline-block;
    background: var(--brand-primary, #0D9488);
    color: #fff !important;
    padding: 12px 24px;
    border-radius: 8px;
    margin-top: 16px;
    text-align: center;
    border: none;
}

.mobile-menu a.btn-nav:hover {
    background: var(--brand-primary-dark, #0F766E);
}

/* Mobile menu section headers */
.mobile-menu-section {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--brand-gray, #6B7280);
    margin-top: 24px;
    margin-bottom: 8px;
    padding-bottom: 0;
    border: none;
}

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

/* Tablet and below */
@media (max-width: 1024px) {
    /* Grid adjustments */
    .stats-grid,
    .events-grid,
    .audience-grid,
    .surge-grid,
    .hire-grid,
    .benefits-grid,
    .steps-grid,
    .pricing-cards {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .ai-grid,
    .two-col-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem;
    }

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

    /* Section padding */
    section {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
}

/* Mobile devices */
@media (max-width: 768px) {
    /* Show mobile menu elements */
    .mobile-menu-btn {
        display: flex;
    }

    .mobile-menu,
    .mobile-menu-overlay {
        display: block;
    }

    /* Hide desktop navigation */
    .nav-links {
        display: none !important;
    }

    /* Navigation adjustments */
    .nav-container {
        padding: 0 1rem;
    }

    .logo img {
        height: 40px;
    }

    /* Typography adjustments */
    h1 {
        font-size: 2rem !important;
        line-height: 1.2 !important;
    }

    h2 {
        font-size: 1.75rem !important;
    }

    h3 {
        font-size: 1.25rem !important;
    }

    /* Hero section */
    .hero {
        padding: 2.5rem 0 !important;
    }

    .hero h1 {
        font-size: 2rem !important;
    }

    .hero p {
        font-size: 1rem !important;
    }

    .hero-ctas {
        flex-direction: column !important;
        align-items: center;
    }

    .hero-ctas a,
    .hero-ctas button {
        width: 100%;
        text-align: center;
    }

    .hero-stats {
        flex-direction: column !important;
        gap: 1rem !important;
    }

    /* Grid adjustments - single column */
    .stats-grid,
    .events-grid,
    .audience-grid,
    .surge-grid,
    .hire-grid,
    .benefits-grid,
    .steps-grid,
    .pricing-cards,
    .chamber-benefits-grid {
        grid-template-columns: 1fr !important;
    }

    .missed-calls-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
        text-align: center;
    }

    .footer-links {
        text-align: center;
    }

    /* Container padding */
    .container {
        padding: 0 1rem !important;
    }

    /* Section padding */
    section {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }

    /* CTA buttons */
    .cta-buttons {
        flex-direction: column !important;
    }

    .cta-buttons a {
        width: 100%;
        text-align: center;
    }

    .cta-stats {
        flex-direction: column !important;
        gap: 1.5rem !important;
    }

    /* Cards */
    .stat-card,
    .benefit-card,
    .step-card,
    .pricing-card {
        padding: 1.5rem !important;
    }

    /* Tables */
    .comparison-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .comparison-table table {
        min-width: 600px;
    }

    /* Hide comparison table on very small screens, show mobile version */
    .comparison-section .comparison-table {
        display: block;
        overflow-x: auto;
    }

    /* Dropdown menus */
    .nav-dropdown-menu {
        display: none !important;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    h1 {
        font-size: 1.75rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }

    .missed-calls-grid {
        grid-template-columns: 1fr !important;
    }

    .stat-card .stat-number {
        font-size: 2rem !important;
    }

    /* Buttons */
    .btn-primary,
    .btn-secondary,
    .btn-white,
    .btn-outline-white {
        padding: 0.875rem 1.5rem !important;
        font-size: 1rem !important;
    }
}

/* ============================================
   DASHBOARD SPECIFIC MOBILE STYLES
   ============================================ */

@media (max-width: 768px) {
    /* Sidebar */
    .dashboard-layout {
        flex-direction: column !important;
    }

    .sidebar {
        width: 100% !important;
        height: auto !important;
        position: relative !important;
    }

    .sidebar-nav {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        padding: 8px;
        gap: 4px;
    }

    .sidebar-nav a {
        flex-shrink: 0;
        padding: 8px 16px;
        white-space: nowrap;
    }

    /* Main content */
    .main-content {
        padding: 1rem !important;
    }

    /* Dashboard cards */
    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }

    .metric-cards {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Communications list */
    .communications-list {
        padding: 0.5rem !important;
    }

    .communication-item {
        padding: 1rem !important;
    }
}

/* ============================================
   FORM STYLES FOR MOBILE
   ============================================ */

@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    textarea,
    select {
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: 12px !important;
    }

    .form-group {
        margin-bottom: 1rem !important;
    }

    .form-row {
        flex-direction: column !important;
        gap: 1rem !important;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Hide on mobile */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Hide on desktop */
@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
}

/* Prevent body scroll when mobile menu is open */
body.mobile-menu-open {
    overflow: hidden;
}
