/**
 * EnrichlyAI Mobile Responsive Styles
 * Global responsive utilities for all pages
 * Include this after other CSS files
 */

/* ==========================================
   MOBILE NAVIGATION TOGGLE
   ========================================== */

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #1a1a2e;
    margin: 5px 0;
    border-radius: 2px;
    transition: all 0.3s ease;
}

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

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

.mobile-menu-toggle.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(26, 26, 46, 0.5);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* ==========================================
   PUBLIC PAGE HEADER RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    /* Header responsive adjustments */
    .header,
    nav.header-nav,
    .nav-container {
        padding: 12px 16px !important;
    }

    .header {
        flex-wrap: wrap;
    }

    .logo-section {
        gap: 8px !important;
    }

    .logo-section img,
    .logo-img,
    .logo {
        width: 32px !important;
        height: 32px !important;
    }

    .brand-name {
        font-size: 1.1rem !important;
    }

    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: block;
    }

    /* Hide nav links on mobile (show in dropdown) */
    .nav-links,
    header nav,
    .header nav {
        display: none !important;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        gap: 0 !important;
    }

    .nav-links.mobile-open,
    header nav.mobile-open,
    .header nav.mobile-open {
        display: flex !important;
    }

    .nav-links a,
    header nav a,
    .header nav a {
        padding: 12px 16px !important;
        border-bottom: 1px solid #f0f0f0;
        width: 100%;
    }

    /* Nav CTA buttons on mobile */
    .nav-cta {
        flex-direction: column;
        width: 100%;
        gap: 8px !important;
    }

    .nav-cta a,
    .nav-cta button {
        width: 100%;
        text-align: center;
    }
}

/* ==========================================
   SIDEBAR RESPONSIVE (DASHBOARD PAGES)
   ========================================== */

@media (max-width: 1024px) {
    /* Dashboard sidebar behavior */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
    }

    /* Sidebar mobile header */
    .sidebar-mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px;
        border-bottom: 1px solid #f0f2f5;
    }

    .sidebar-close-btn {
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
        color: #64748b;
        padding: 4px;
    }

    /* Mobile menu overlay for sidebar */
    .mobile-menu-overlay {
        display: block;
        pointer-events: none;
    }

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

@media (min-width: 1025px) {
    .sidebar-mobile-header {
        display: none !important;
    }
}

/* ==========================================
   TYPOGRAPHY RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    h1 {
        font-size: 1.75rem !important;
        line-height: 1.2 !important;
    }

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

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

    h4 {
        font-size: 1.1rem !important;
    }

    p {
        font-size: 0.95rem !important;
    }

    /* Hero sections */
    .hero h1 {
        font-size: 2rem !important;
    }

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

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

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem !important;
    }

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

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

/* ==========================================
   CONTAINER RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .container {
        padding: 24px 16px !important;
    }

    .hero {
        padding: 40px 20px !important;
    }

    .section {
        padding: 40px 0 !important;
    }

    .guide-section,
    .toc,
    .category {
        padding: 20px !important;
    }
}

/* ==========================================
   GRIDS RESPONSIVE
   ========================================== */

@media (max-width: 1024px) {
    .stats-grid,
    .features-grid,
    .steps,
    .help-categories {
        grid-template-columns: repeat(2, 1fr) !important;
    }

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

@media (max-width: 768px) {
    .stats-grid,
    .features-grid,
    .steps,
    .stats-container,
    .dashboard-grid,
    .help-categories {
        grid-template-columns: 1fr !important;
    }

    .footer-container {
        grid-template-columns: 1fr !important;
        text-align: center;
    }

    .footer-column {
        margin-bottom: 32px;
    }

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

    .hero-visual {
        order: -1;
    }

    .hero-cta {
        justify-content: center;
    }
}

/* ==========================================
   TABLES RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        font-size: 0.85rem;
    }

    th, td {
        padding: 8px 12px !important;
    }

    /* Results table specific */
    .results-table-container,
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ==========================================
   FORMS RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .form-group {
        margin-bottom: 16px !important;
    }

    .form-input,
    .form-select,
    .form-textarea,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    select,
    textarea {
        font-size: 16px !important; /* Prevent iOS zoom */
        padding: 12px !important;
    }

    .btn,
    button {
        padding: 12px 20px !important;
        font-size: 0.9rem !important;
        width: 100%;
    }

    .btn-large {
        padding: 14px 24px !important;
    }

    /* Form rows */
    .form-row,
    .input-row {
        flex-direction: column !important;
        gap: 12px !important;
    }
}

/* ==========================================
   CARDS RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .card,
    .stat-card,
    .feature-card,
    .category {
        padding: 16px !important;
    }

    .stat-card .value {
        font-size: 1.75rem !important;
    }

    /* Active searches cards */
    .active-searches-grid {
        flex-direction: column !important;
    }

    .active-search-card {
        min-width: 100% !important;
    }
}

/* ==========================================
   MODAL / DROPDOWN RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .notification-dropdown,
    .profile-dropdown {
        width: calc(100vw - 32px) !important;
        right: -16px !important;
        max-height: 70vh !important;
    }

    .modal-content,
    .dialog-content {
        width: calc(100% - 32px) !important;
        max-width: none !important;
        margin: 16px !important;
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* ==========================================
   CTA SECTIONS RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .cta,
    .cta-section {
        padding: 40px 20px !important;
    }

    .cta h2,
    .cta-section h2 {
        font-size: 1.5rem !important;
    }

    .cta-buttons {
        flex-direction: column !important;
        gap: 12px !important;
    }

    .cta-buttons a,
    .cta-buttons button {
        width: 100%;
    }
}

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

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

    .show-mobile {
        display: block !important;
    }

    .text-center-mobile {
        text-align: center !important;
    }

    .full-width-mobile {
        width: 100% !important;
    }
}

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

    .show-desktop {
        display: block !important;
    }
}

/* ==========================================
   TOP BAR RESPONSIVE (DASHBOARD)
   ========================================== */

@media (max-width: 768px) {
    .top-bar {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 16px !important;
    }

    .top-bar-actions {
        width: 100%;
        justify-content: space-between !important;
    }

    .welcome-section h1 {
        font-size: 1.25rem !important;
    }

    .welcome-section p {
        font-size: 0.85rem !important;
    }
}

/* ==========================================
   PRICING PAGE RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .pricing-grid,
    .plans-grid {
        grid-template-columns: 1fr !important;
    }

    .pricing-card,
    .plan-card {
        margin-bottom: 24px;
    }
}

/* ==========================================
   SEARCH RESULTS RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    /* Search card strip horizontal scroll */
    .search-cards-strip {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
    }

    .search-card {
        min-width: 200px !important;
        flex-shrink: 0;
    }

    /* Tab navigation */
    .search-tabs {
        width: 100% !important;
    }

    .tab-btn {
        flex: 1;
        justify-content: center;
    }
}

/* ==========================================
   PROGRESS PAGE RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .progress-container {
        padding: 20px !important;
    }

    .progress-stats {
        flex-direction: column !important;
        gap: 12px !important;
    }

    .stat-box {
        width: 100% !important;
    }
}

/* ==========================================
   AUTH PAGES RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .auth-container,
    .login-container,
    .register-container {
        padding: 24px 16px !important;
    }

    .auth-card,
    .login-card {
        padding: 24px !important;
        margin: 16px !important;
    }

    .auth-header h1 {
        font-size: 1.5rem !important;
    }

    .social-login-btns {
        flex-direction: column !important;
    }

    .social-login-btns button {
        width: 100% !important;
    }
}

/* ==========================================
   INTEGRATIONS PAGE RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .integrations-grid,
    .crm-grid {
        grid-template-columns: 1fr !important;
    }

    .integration-card {
        padding: 20px !important;
    }
}

/* ==========================================
   SETTINGS PAGE RESPONSIVE
   ========================================== */

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

    .settings-sidebar {
        width: 100% !important;
        border-right: none !important;
        border-bottom: 1px solid #e8ebed;
        padding-bottom: 16px;
        margin-bottom: 16px;
    }

    .settings-content {
        padding: 0 !important;
    }
}

/* ==========================================
   ADMIN DASHBOARD RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .admin-stats-grid {
        grid-template-columns: 1fr !important;
    }

    .admin-actions {
        flex-direction: column !important;
    }

    .user-table {
        font-size: 0.8rem !important;
    }

    .user-table th,
    .user-table td {
        padding: 8px !important;
    }

    /* Hide less important columns on mobile */
    .hide-mobile-col {
        display: none !important;
    }
}

/* ==========================================
   BILLING PAGE RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .billing-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 16px !important;
    }

    .billing-cards {
        grid-template-columns: 1fr !important;
    }

    .invoice-table {
        font-size: 0.85rem !important;
    }
}

/* ==========================================
   CONTACT PAGE RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr !important;
    }

    .contact-form {
        order: 1;
    }

    .contact-info {
        order: 2;
    }
}

/* ==========================================
   LEGAL PAGES RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .section h2 {
        font-size: 1.5rem !important;
        padding-left: 16px !important;
    }

    .section h3 {
        font-size: 1.1rem !important;
    }

    .highlight-box,
    .warning-box,
    .info-box,
    .tip-box {
        padding: 16px !important;
        margin: 16px 0 !important;
    }

    .contact-box {
        padding: 24px 16px !important;
    }
}

/* ==========================================
   HEXAGON VISUAL RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .hexagon-grid {
        max-width: 280px !important;
    }

    .main-hexagon {
        width: 180px !important;
        height: 180px !important;
    }

    .main-hexagon-inner {
        width: 160px !important;
        height: 160px !important;
        font-size: 2.5rem !important;
    }

    .orbit-hex {
        width: 40px !important;
        height: 40px !important;
        font-size: 1rem !important;
    }
}

/* ==========================================
   IMPERSONATION BANNER RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .impersonation-banner {
        padding: 8px 16px !important;
    }

    .banner-content {
        flex-direction: column !important;
        gap: 8px !important;
        text-align: center;
    }

    .banner-text {
        font-size: 12px !important;
    }

    .banner-exit-btn {
        padding: 4px 12px !important;
        font-size: 0.75rem !important;
    }
}

/* ==========================================
   TISH AI ASSISTANT RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .tish-chat-modal {
        width: calc(100% - 16px) !important;
        height: calc(100% - 100px) !important;
        right: 8px !important;
        bottom: 80px !important;
        border-radius: 16px !important;
    }

    .tish-minimized {
        width: calc(100% - 32px) !important;
        left: 16px !important;
        right: 16px !important;
    }
}

/* ==========================================
   SCROLLBAR STYLES FOR MOBILE
   ========================================== */

@media (max-width: 768px) {
    /* Thin scrollbars on mobile for tables */
    .results-table-container::-webkit-scrollbar,
    .table-container::-webkit-scrollbar,
    table::-webkit-scrollbar {
        height: 4px;
    }

    .results-table-container::-webkit-scrollbar-track,
    .table-container::-webkit-scrollbar-track,
    table::-webkit-scrollbar-track {
        background: #f1f1f1;
    }

    .results-table-container::-webkit-scrollbar-thumb,
    .table-container::-webkit-scrollbar-thumb,
    table::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 4px;
    }
}

/* ==========================================
   SAFE AREA INSETS (iPhone X+)
   ========================================== */

@supports (padding: max(0px)) {
    .sidebar {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }

    .tish-minimized {
        bottom: max(20px, env(safe-area-inset-bottom));
    }

    footer {
        padding-bottom: max(24px, env(safe-area-inset-bottom));
    }
}

/* ==========================================
   TOUCH OPTIMIZATION
   ========================================== */

@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .nav-item,
    .dropdown-item,
    .btn,
    button,
    a {
        min-height: 44px;
    }

    /* Disable hover effects on touch */
    .card:hover,
    .feature-card:hover,
    .stat-card:hover {
        transform: none;
        box-shadow: inherit;
    }
}

/* ==========================================
   CRITICAL: BODY OVERFLOW FIX FOR MOBILE
   ========================================== */

@media (max-width: 768px) {
    /* Fix scrolling issues - override inline styles */
    html, body {
        height: auto !important;
        overflow: visible !important;
        overflow-x: hidden !important;
    }

    body {
        min-height: 100vh;
        min-height: 100dvh; /* Dynamic viewport height for mobile */
    }

    /* Dashboard container fixes */
    .dashboard-container,
    .dashboard-layout {
        flex-direction: column !important;
        min-height: 100vh !important;
        min-height: 100dvh !important;
        height: auto !important;
        overflow: visible !important;
    }

    /* Main content should scroll */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 1rem !important;
        padding-top: 70px !important; /* Space for mobile header */
        min-height: calc(100vh - 70px) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }
}

/* ==========================================
   MOBILE SIDEBAR MENU (SLIDE-OUT)
   ========================================== */

@media (max-width: 768px) {
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 280px !important;
        max-width: 85vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s ease !important;
        z-index: 1000 !important;
        /* Dark theme background matching desktop sidebar */
        background: linear-gradient(180deg, #1e1e32 0%, #252542 100%) !important;
        box-shadow: none !important;
        overflow-y: auto !important;
        border-right: 1px solid rgba(108, 92, 231, 0.2) !important;
        padding: 1.25rem 0 !important;
    }

    .sidebar.mobile-open {
        transform: translateX(0) !important;
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.4) !important;
    }

    /* Sidebar header on mobile */
    .sidebar .sidebar-header,
    .sidebar .sidebar-logo {
        padding: 0 1.25rem 1rem !important;
        border-bottom: 1px solid rgba(108, 92, 231, 0.2) !important;
        margin-bottom: 1rem !important;
    }

    /* Nav items in mobile sidebar - dark theme */
    .sidebar .nav-item {
        display: flex !important;
        align-items: center !important;
        gap: 0.75rem !important;
        padding: 0.75rem 1.25rem !important;
        color: rgba(255, 255, 255, 0.7) !important;
        font-size: 0.9rem !important;
        font-weight: 500 !important;
        text-decoration: none !important;
        transition: all 0.2s ease !important;
        cursor: pointer !important;
    }

    .sidebar .nav-item:hover {
        background: rgba(108, 92, 231, 0.15) !important;
        color: rgba(255, 255, 255, 0.95) !important;
    }

    .sidebar .nav-item.active {
        background: rgba(108, 92, 231, 0.2) !important;
        color: #00BFA6 !important;
        border-left: 3px solid #6C5CE7 !important;
    }

    .sidebar .nav-item span:first-child {
        font-size: 1.1rem !important;
        width: 24px !important;
        text-align: center !important;
    }

    /* Section labels in sidebar */
    .sidebar .nav-section-label,
    .sidebar .nav-section-title {
        font-size: 0.65rem !important;
        font-weight: 600 !important;
        color: rgba(255, 255, 255, 0.4) !important;
        text-transform: uppercase !important;
        letter-spacing: 0.05em !important;
        padding: 1rem 1.25rem 0.4rem !important;
    }

    /* Dividers in sidebar */
    .sidebar .nav-divider {
        height: 1px !important;
        background: rgba(108, 92, 231, 0.2) !important;
        margin: 0.75rem 1.25rem !important;
    }

    /* User info in sidebar */
    .sidebar .user-info {
        padding: 1rem 1.25rem !important;
        border-bottom: 1px solid rgba(108, 92, 231, 0.2) !important;
    }

    .sidebar .user-name {
        font-size: 0.9rem !important;
        font-weight: 600 !important;
        color: #ffffff !important;
    }

    .sidebar .user-plan {
        font-size: 0.75rem !important;
        color: rgba(255, 255, 255, 0.5) !important;
    }

    .sidebar .user-role {
        font-size: 0.75rem !important;
        color: #00BFA6 !important;
        font-weight: 500 !important;
    }

    /* Version display */
    .sidebar .sidebar-version {
        padding: 1rem 1.25rem !important;
        border-top: 1px solid rgba(108, 92, 231, 0.2) !important;
        font-size: 0.7rem !important;
        color: rgba(255, 255, 255, 0.3) !important;
        margin-top: auto !important;
    }

    /* Mobile header bar */
    .mobile-header {
        display: flex !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        height: 60px !important;
        background: linear-gradient(180deg, #1e1e32 0%, #252542 100%) !important;
        border-bottom: 1px solid rgba(108, 92, 231, 0.2) !important;
        padding: 0 1rem !important;
        align-items: center !important;
        justify-content: space-between !important;
        z-index: 500 !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;
    }

    /* Mobile menu toggle button - dark theme */
    .mobile-menu-toggle {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        width: 44px !important;
        height: 44px !important;
        background: linear-gradient(135deg, #1e1e32 0%, #252542 100%) !important;
        border: 1px solid rgba(108, 92, 231, 0.3) !important;
        cursor: pointer !important;
        padding: 10px !important;
        border-radius: 10px !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
    }

    .mobile-menu-toggle:hover,
    .mobile-menu-toggle:active {
        background: linear-gradient(135deg, #252542 0%, #2d2d50 100%) !important;
        border-color: rgba(108, 92, 231, 0.5) !important;
    }

    .mobile-menu-toggle span {
        display: block !important;
        width: 22px !important;
        height: 2px !important;
        background: #ffffff !important;
        margin: 4px 0 !important;
        border-radius: 2px !important;
        transition: all 0.3s ease !important;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px) !important;
        background: #00BFA6 !important;
    }

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

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px) !important;
        background: #00BFA6 !important;
    }

    /* Mobile overlay - dark theme */
    .mobile-overlay,
    .mobile-menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(10, 10, 20, 0.7);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 999;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

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

@media (min-width: 769px) {
    .mobile-header {
        display: none !important;
    }
}

/* ==========================================
   SEARCH TYPE PAGE (search-type.html)
   ========================================== */

@media (max-width: 768px) {
    /* Fix page layout */
    .page-title {
        margin-bottom: 1rem !important;
        padding: 0 0.5rem !important;
    }

    .page-title h1 {
        font-size: 1.35rem !important;
        line-height: 1.3 !important;
    }

    .page-title p {
        font-size: 0.85rem !important;
    }

    /* Search type cards */
    .search-type-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
    }

    .search-type-card {
        padding: 1.25rem !important;
        margin: 0 !important;
    }

    .search-type-card .card-header {
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.75rem !important;
    }

    .card-icon {
        width: 48px !important;
        height: 48px !important;
        font-size: 1.25rem !important;
    }

    .card-title-section h2 {
        font-size: 1.05rem !important;
    }

    .card-title-section p {
        font-size: 0.8rem !important;
    }

    .card-features li {
        font-size: 0.8rem !important;
        padding: 0.25rem 0 !important;
    }

    .card-badge {
        font-size: 0.7rem !important;
        padding: 0.3rem 0.6rem !important;
    }

    /* Action buttons */
    .action-buttons {
        flex-direction: column !important;
        gap: 0.75rem !important;
        padding: 0 !important;
        margin-top: 1rem !important;
    }

    .action-buttons .btn {
        width: 100% !important;
        justify-content: center !important;
        padding: 0.85rem 1.5rem !important;
    }

    /* Tishé prompt section */
    .tishe-prompt-section {
        padding: 1rem 0.5rem 1.5rem !important;
        margin-top: 1rem !important;
    }

    .tishe-prompt-container {
        border-radius: 16px !important;
    }

    .tishe-prompt-header {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        padding: 0.6rem 0.75rem !important;
    }

    .tishe-hint {
        width: 100% !important;
        margin-left: 0 !important;
        font-size: 0.65rem !important;
        text-align: center !important;
    }

    .tishe-input-row {
        flex-direction: column !important;
        gap: 0.5rem !important;
        padding: 0.75rem !important;
    }

    .tishe-input {
        width: 100% !important;
        padding: 0.75rem !important;
        font-size: 16px !important; /* Prevents zoom on iOS */
    }

    .tishe-send-btn {
        width: 100% !important;
        justify-content: center !important;
        padding: 0.75rem 1rem !important;
    }

    /* Tishé modal */
    .tishe-modal {
        width: calc(100% - 1rem) !important;
        max-width: none !important;
        bottom: 70px !important;
        left: 0.5rem !important;
        right: 0.5rem !important;
        transform: none !important;
        max-height: calc(100vh - 140px) !important;
        max-height: calc(100dvh - 140px) !important;
        border-radius: 16px !important;
    }

    .tishe-messages {
        min-height: 150px !important;
        max-height: 200px !important;
    }

    .tishe-suggestion {
        font-size: 0.75rem !important;
        padding: 0.45rem 0.85rem !important;
    }

    .tishe-modal-input {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
}

/* ==========================================
   MY SEARCHES PAGE (my_searches.html)
   ========================================== */

@media (max-width: 768px) {
    /* Page header */
    .page-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem !important;
        margin-bottom: 1.25rem !important;
    }

    .page-header-left h1 {
        font-size: 1.5rem !important;
    }

    .page-header-left .subtitle {
        font-size: 0.85rem !important;
    }

    .page-header-actions {
        width: 100% !important;
    }

    .page-header-actions .btn {
        flex: 1 !important;
        justify-content: center !important;
    }

    /* Search tabs - stacked on mobile */
    .search-tabs {
        flex-direction: column !important;
        gap: 0.75rem !important;
        width: 100% !important;
    }

    .tab-btn {
        width: 100% !important;
        justify-content: center !important;
        padding: 0.85rem 1rem !important;
        font-size: 0.95rem !important;
    }

    .tab-btn .tab-count {
        font-size: 0.8rem !important;
        padding: 0.3rem 0.6rem !important;
    }

    /* Cards section */
    .cards-section {
        margin-bottom: 1rem !important;
    }

    .cards-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }

    /* Cards grid - vertical stack on mobile */
    .cards-grid {
        flex-direction: column !important;
        padding: 0 !important;
        gap: 0.75rem !important;
        overflow-x: visible !important;
    }

    .cards-grid-wrapper::before,
    .cards-grid-wrapper::after {
        display: none !important;
    }

    .scroll-nav {
        display: none !important;
    }

    .cards-pagination {
        display: none !important;
    }

    /* Search cards - full width on mobile */
    .search-card {
        min-width: 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
    }

    .card-header {
        margin-bottom: 0.75rem !important;
    }

    .card-title {
        font-size: 1rem !important;
    }

    .card-location {
        font-size: 0.8rem !important;
    }

    .card-stats {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        padding: 0.5rem 0.75rem !important;
    }

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

    /* Card action buttons - stack on very small screens */
    .card-actions {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }

    .card-actions .btn-action {
        flex: 1 1 calc(50% - 0.25rem) !important;
        min-width: calc(50% - 0.25rem) !important;
        padding: 0.5rem 0.5rem !important;
        font-size: 0.7rem !important;
    }

    /* Progress bar in running cards */
    .progress-bar-mini {
        margin-top: 0.5rem !important;
    }
}

@media (max-width: 400px) {
    /* Very small screens - stack all card buttons */
    .card-actions .btn-action {
        flex: 1 1 100% !important;
        min-width: 100% !important;
    }
}

/* ==========================================
   INTEGRATIONS PAGE (integrations.html)
   ========================================== */

@media (max-width: 768px) {
    /* Integration grid - single column */
    .integration-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .integration-card {
        padding: 1rem !important;
    }

    .integration-header {
        flex-direction: row !important;
        align-items: center !important;
    }

    .integration-logo {
        width: 44px !important;
        height: 44px !important;
        font-size: 20px !important;
    }

    .integration-info h3 {
        font-size: 0.95rem !important;
    }

    .integration-description {
        font-size: 0.8rem !important;
    }

    .integration-features li {
        font-size: 0.75rem !important;
    }

    .btn-connect {
        padding: 0.75rem 1rem !important;
        font-size: 0.85rem !important;
    }
}

/* ==========================================
   TABLES - FULL MOBILE RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    /* Table container must allow scroll */
    .results-table-container,
    .table-container,
    .table-wrapper,
    .data-table-wrapper {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        margin: 0 -1rem !important;
        padding: 0 1rem !important;
        display: block !important;
    }

    /* Tables should not be hidden */
    table,
    .results-table,
    .data-table,
    .merchants-table {
        display: table !important;
        width: max-content !important;
        min-width: 600px !important;
        font-size: 0.8rem !important;
        border-collapse: collapse !important;
    }

    table th,
    table td {
        padding: 0.6rem 0.75rem !important;
        white-space: nowrap !important;
    }

    /* Table header styles */
    table th {
        background: #f8f9fa !important;
        font-weight: 600 !important;
        font-size: 0.75rem !important;
        text-transform: uppercase !important;
        letter-spacing: 0.03em !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 10 !important;
    }

    /* Table scroll hint */
    .table-scroll-hint {
        display: block !important;
        text-align: center !important;
        font-size: 0.75rem !important;
        color: #64748b !important;
        padding: 0.5rem !important;
        background: linear-gradient(135deg, rgba(108, 92, 231, 0.05) 0%, rgba(0, 191, 166, 0.05) 100%) !important;
        border-radius: 8px !important;
        margin-bottom: 0.75rem !important;
    }

    .table-scroll-hint::before {
        content: '← ';
    }

    .table-scroll-hint::after {
        content: ' →';
    }
}

@media (min-width: 769px) {
    .table-scroll-hint {
        display: none !important;
    }
}

/* ==========================================
   RESULTS SECTION (my_searches.html)
   ========================================== */

@media (max-width: 768px) {
    .results-section {
        margin-top: 1rem !important;
    }

    .results-header {
        flex-direction: column !important;
        gap: 1rem !important;
        align-items: flex-start !important;
    }

    .results-header h2 {
        font-size: 1.1rem !important;
    }

    .results-toolbar {
        width: 100% !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }

    .results-toolbar .btn,
    .results-toolbar button,
    .results-toolbar select {
        flex: 1 1 calc(50% - 0.25rem) !important;
        min-width: calc(50% - 0.25rem) !important;
        font-size: 0.8rem !important;
    }

    /* Filter dropdown */
    .filter-dropdown,
    .search-filter {
        width: 100% !important;
    }

    /* Search input in results */
    .search-input-wrapper {
        width: 100% !important;
    }

    .search-input-wrapper input {
        width: 100% !important;
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
}

/* ==========================================
   CRM MODAL RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .crm-modal-overlay.active {
        align-items: flex-end !important;
        padding: 0 !important;
    }

    .crm-modal {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: 20px 20px 0 0 !important;
        max-height: 85vh !important;
        max-height: 85dvh !important;
        animation: slideUpModal 0.3s ease !important;
    }

    @keyframes slideUpModal {
        from {
            transform: translateY(100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    .crm-modal-header {
        padding: 1rem !important;
    }

    .crm-modal-header h3 {
        font-size: 1.1rem !important;
    }

    .crm-options {
        max-height: 50vh !important;
        overflow-y: auto !important;
    }

    .crm-option {
        padding: 0.85rem !important;
    }

    .crm-option-logo {
        width: 36px !important;
        height: 36px !important;
    }

    .crm-modal-footer {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }

    .crm-modal-footer .btn {
        width: 100% !important;
    }
}

/* ==========================================
   CONFIGURE PAGE (Business/People Search)
   ========================================== */

@media (max-width: 768px) {
    .configure-container,
    .config-container {
        padding: 1rem !important;
    }

    .config-card,
    .configure-card {
        padding: 1.25rem !important;
    }

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

    .form-group {
        width: 100% !important;
    }

    .form-group label {
        font-size: 0.85rem !important;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: 0.75rem !important;
    }

    .location-pills,
    .business-type-pills {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }

    .location-pill,
    .type-pill {
        font-size: 0.8rem !important;
        padding: 0.5rem 0.75rem !important;
    }
}

/* ==========================================
   RUNNING/PROGRESS PAGE
   ========================================== */

@media (max-width: 768px) {
    .progress-page-container {
        padding: 1rem !important;
    }

    .progress-card {
        padding: 1.25rem !important;
    }

    .progress-header {
        flex-direction: column !important;
        text-align: center !important;
        gap: 0.75rem !important;
    }

    .progress-title {
        font-size: 1.25rem !important;
    }

    .progress-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }

    .progress-stat-card {
        padding: 0.75rem !important;
    }

    .progress-stat-value {
        font-size: 1.25rem !important;
    }

    .progress-stat-label {
        font-size: 0.7rem !important;
    }

    .progress-actions {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }

    .progress-actions .btn {
        width: 100% !important;
    }
}

/* ==========================================
   DASHBOARD PAGE
   ========================================== */

@media (max-width: 768px) {
    .dashboard-stats-grid,
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }

    .stat-card {
        padding: 1rem !important;
    }

    .stat-card .value {
        font-size: 1.5rem !important;
    }

    .stat-card .label {
        font-size: 0.75rem !important;
    }

    .quick-actions {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    .action-card {
        padding: 1rem !important;
    }

    .recent-activity {
        margin-top: 1.5rem !important;
    }
}

@media (max-width: 400px) {
    .dashboard-stats-grid,
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================
   NOTIFICATIONS & DROPDOWNS
   ========================================== */

@media (max-width: 768px) {
    .notification-dropdown {
        position: fixed !important;
        top: 60px !important;
        left: 0.5rem !important;
        right: 0.5rem !important;
        width: auto !important;
        max-height: calc(100vh - 120px) !important;
        max-height: calc(100dvh - 120px) !important;
        border-radius: 16px !important;
    }

    .notification-item {
        padding: 0.85rem !important;
    }

    .notification-item .title {
        font-size: 0.85rem !important;
    }

    .notification-item .message {
        font-size: 0.8rem !important;
    }
}

/* ==========================================
   EMPTY STATES
   ========================================== */

@media (max-width: 768px) {
    .empty-state {
        padding: 2rem 1rem !important;
    }

    .empty-state-icon {
        font-size: 3rem !important;
    }

    .empty-state h3 {
        font-size: 1.1rem !important;
    }

    .empty-state p {
        font-size: 0.85rem !important;
    }
}

/* ==========================================
   LOADING STATES
   ========================================== */

@media (max-width: 768px) {
    .loading-overlay {
        padding: 1rem !important;
    }

    .loading-spinner {
        width: 40px !important;
        height: 40px !important;
    }

    .loading-text {
        font-size: 0.9rem !important;
    }
}

/* ==========================================
   IMPERSONATION BANNER ENHANCED
   ========================================== */

@media (max-width: 768px) {
    .impersonation-banner {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 2000 !important;
        padding: 0.5rem 1rem !important;
    }

    /* Adjust main content when impersonation is active */
    body.impersonating .main-content {
        padding-top: 110px !important;
    }

    body.impersonating .mobile-header {
        top: 40px !important;
    }
}

/* ==========================================
   PRINT STYLES
   ========================================== */

@media print {
    .sidebar,
    .mobile-header,
    .mobile-menu-toggle,
    .mobile-overlay {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
}
