/**
 * HubSpot Mobile Complete Styles
 * Includes pull-to-refresh, FAB, and all mobile patterns
 */

/* Pull to Refresh */
.hs-pull-refresh {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    z-index: 10003;
}

.hs-pull-indicator {
    width: 100%;
    height: 100%;
    border: 3px solid #E5E7EB;
    border-top-color: #FF7A59;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hs-pull-refresh.active .hs-pull-indicator {
    animation: spin 1s linear infinite;
    opacity: 1;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Floating Action Button - DEPRECATED: Replaced by MTI Refresh FAB */
.hs-fab {
    display: none !important; /* Hidden - non-functional, replaced by mti-refresh-fab */
}

/* Mobile Container */
.hs-mobile-container {
    position: relative;
    min-height: 100vh;
    padding-bottom: 80px; /* Space for bottom nav */
    transition: transform 0.3s ease;
}

/* Mobile Grid */
.hs-mobile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
    padding-bottom: 72px;
}

@media (min-width: 480px) {
    .hs-mobile-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .hs-mobile-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
        padding: 24px;
    }
    
    .hs-bottom-nav {
        display: none;
    }
    
    .hs-fab {
        bottom: 24px;
    }
    
    .hs-mobile-container {
        padding-bottom: 24px;
    }
}

/* HubSpot Mobile Design Tokens */
:root {
    /* Spacing - HubSpot uses 4px base */
    --hs-space-xs: 4px;
    --hs-space-sm: 8px;
    --hs-space-md: 16px;
    --hs-space-lg: 24px;
    --hs-space-xl: 32px;
    
    /* Typography */
    --hs-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    /* Colors - HubSpot palette */
    --hs-orange: #FF7A59;
    --hs-blue: #00A4BD;
    --hs-navy: #2D3E50;
    --hs-gray-100: #F5F8FA;
    --hs-gray-200: #CBD6E2;
    --hs-green: #10B981;
    --hs-red: #EF4444;
    
    /* Safe Area Insets */
    --safe-area-inset-top: env(safe-area-inset-top, 0);
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 0);
}

/* Mobile Body Class Optimizations */
.is-mobile {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* Skeleton Loader */
.hs-skeleton {
    background: linear-gradient(90deg, #F0F0F0 25%, #E0E0E0 50%, #F0F0F0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Prevent iOS Zoom on Input Focus */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    input[type="tel"],
    input[type="url"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* Swipe Indicator (optional visual feedback) */
.swipe-indicator {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.swipe-indicator.left {
    left: 20px;
}

.swipe-indicator.right {
    right: 20px;
}

.swipe-indicator.active {
    opacity: 1;
}

/* Long Press Feedback */
@keyframes longpress-scale {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.longpress-active {
    animation: longpress-scale 0.3s ease;
}

/* Dark Mode Support */
[data-theme="dark"] {
    --hs-gray-100: #1F2937;
    --hs-gray-200: #4B5563;
    --hs-navy: #F9FAFB;
}

[data-theme="dark"] .hs-fab {
    background: #FF6842;
    box-shadow: 0 4px 12px rgba(255, 104, 66, 0.4);
}

[data-theme="dark"] .hs-skeleton {
    background: linear-gradient(90deg, #374151 25%, #4B5563 50%, #374151 75%);
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .hs-fab,
    .hs-pull-indicator,
    .hs-mobile-container,
    .swipe-indicator {
        transition: none !important;
        animation: none !important;
    }
}

/* Print Styles */
@media print {
    .hs-bottom-nav,
    .hs-fab,
    .hs-pull-refresh {
        display: none !important;
    }
}
