/**
 * Gestures Page - Mobile Styles
 * App-style design for lovesite.co.il
 * Works with site header and footer
 */

@media (max-width: 768px) {
    /* ========================================
       Page Body - Mobile
       ======================================== */
    body.gestures-page-body {
        background: linear-gradient(135deg, #fce4ec 0%, #f3e5f5 50%, #e8eaf6 100%) !important;
        overflow-x: hidden !important;
        min-height: 100vh !important;
    }

    /* Accessibility widget positioning */
    .a11y-widget-panel {
        z-index: 9999 !important;
        position: fixed !important;
    }

    /* ========================================
       MOBILE RESTRUCTURE SUPPORT
       JS moves gestures-wrapper to be direct child of body
       ======================================== */

    /* When JS has restructured, hide old content (header.php tables) */
    body.mobile-restructured > *:not(.gestures-wrapper):not(.mobile-header):not(.mobile-bottom-nav):not(.a11y-widget-panel):not(.notifications-badge):not(script):not(style):not(link) {
        display: none !important;
    }

    /* The gestures-wrapper after JS moves it */
    body.mobile-restructured > .gestures-wrapper {
        display: block !important;
    }

    /* ========================================
       Gestures Wrapper - Mobile
       ======================================== */
    .gestures-wrapper {
        display: block !important;
        padding-top: 60px !important;
        padding-bottom: 80px !important;
        min-height: 100vh !important;
        width: 100% !important;
        position: relative !important;
        z-index: 10 !important;
        background: linear-gradient(135deg, #fff5f7 0%, #fff 50%, #f5f0ff 100%) !important;
    }

    /* ========================================
       Page Header - Mobile
       ======================================== */
    .page-header {
        border-radius: 0 0 30px 30px !important;
        padding: 20px 16px !important;
        margin-bottom: 20px !important;
    }

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

    .page-header p {
        font-size: 0.9rem !important;
    }

    /* ========================================
       Container - Mobile
       ======================================== */
    .container {
        padding: 0 16px !important;
        max-width: 100% !important;
    }

    /* ========================================
       Tabs - Mobile
       ======================================== */
    .tabs {
        gap: 6px !important;
        margin-bottom: 20px !important;
        padding: 0 !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
    }

    .tab-btn {
        padding: 10px 14px !important;
        font-size: 0.85rem !important;
        border-radius: 20px !important;
        gap: 5px !important;
    }

    .tab-btn .icon {
        font-size: 1rem !important;
    }

    /* ========================================
       Filters Section - Mobile
       ======================================== */
    .filters-section {
        border-radius: 14px !important;
        padding: 16px !important;
        margin-bottom: 20px !important;
    }

    .filters-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
    }

    .filter-group label {
        font-size: 0.8rem !important;
        margin-bottom: 4px !important;
    }

    .filter-group select {
        padding: 10px 12px !important;
        font-size: 0.9rem !important;
        border-radius: 10px !important;
    }

    /* ========================================
       Action Button - Mobile
       ======================================== */
    .action-section {
        margin-bottom: 20px !important;
    }

    .main-action-btn {
        padding: 16px 30px !important;
        font-size: 1.1rem !important;
        border-radius: 30px !important;
        width: 100% !important;
        max-width: 300px !important;
    }

    .main-action-btn:hover {
        transform: none !important;
    }

    .main-action-btn:active {
        transform: scale(0.98) !important;
    }

    /* ========================================
       Gesture Card - Mobile
       ======================================== */
    .gesture-card {
        border-radius: 16px !important;
        padding: 20px !important;
        margin: 0 0 20px !important;
        max-width: 100% !important;
    }

    .gesture-emoji {
        font-size: 3rem !important;
        margin-bottom: 15px !important;
    }

    .gesture-title {
        font-size: 1.2rem !important;
        margin-bottom: 12px !important;
    }

    .gesture-description {
        font-size: 1rem !important;
        margin-bottom: 16px !important;
        line-height: 1.7 !important;
    }

    .gesture-meta {
        gap: 10px !important;
        margin-bottom: 16px !important;
    }

    .gesture-tag {
        padding: 6px 12px !important;
        font-size: 0.8rem !important;
        border-radius: 16px !important;
    }

    .gesture-actions {
        gap: 10px !important;
        flex-direction: column !important;
    }

    .gesture-btn {
        padding: 12px 20px !important;
        border-radius: 12px !important;
        font-size: 0.95rem !important;
        width: 100% !important;
        justify-content: center !important;
    }

    /* ========================================
       Message Card - Mobile
       ======================================== */
    .message-card {
        border-radius: 16px !important;
        padding: 20px !important;
        max-width: 100% !important;
    }

    .message-text {
        font-size: 1.1rem !important;
        padding: 16px !important;
        border-radius: 12px !important;
        line-height: 1.7 !important;
    }

    .message-category {
        font-size: 0.8rem !important;
        padding: 4px 12px !important;
    }

    .message-actions {
        gap: 10px !important;
        flex-direction: column !important;
    }

    .copy-btn {
        padding: 12px 20px !important;
        border-radius: 12px !important;
        width: 100% !important;
    }

    /* ========================================
       Partner Input - Mobile
       ======================================== */
    .partner-input-section {
        border-radius: 14px !important;
        padding: 16px !important;
        margin-bottom: 20px !important;
        max-width: 100% !important;
    }

    .partner-input-section label {
        font-size: 0.95rem !important;
    }

    .partner-input-section input {
        padding: 12px !important;
        font-size: 1rem !important;
        border-radius: 10px !important;
    }

    /* ========================================
       Reminders - Mobile
       ======================================== */
    .reminders-list {
        gap: 12px !important;
        max-width: 100% !important;
    }

    .reminder-card {
        border-radius: 14px !important;
        padding: 16px !important;
    }

    .reminder-info h4 {
        font-size: 0.95rem !important;
    }

    .reminder-info p {
        font-size: 0.85rem !important;
    }

    .create-reminder-form {
        border-radius: 14px !important;
        padding: 20px !important;
        max-width: 100% !important;
        margin: 20px 0 0 !important;
    }

    .create-reminder-form h3 {
        font-size: 1.1rem !important;
        margin-bottom: 16px !important;
    }

    .form-row {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .form-group.full-width {
        grid-column: span 1 !important;
    }

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

    .form-group input,
    .form-group select {
        padding: 12px !important;
        font-size: 1rem !important;
        border-radius: 10px !important;
    }

    .submit-btn {
        padding: 14px !important;
        font-size: 1rem !important;
        border-radius: 12px !important;
    }

    /* ========================================
       Notifications Badge - Mobile
       Hide on mobile - not needed with bottom nav
       ======================================== */
    .notifications-badge {
        display: none !important;
    }

    /* ========================================
       Info Section - Mobile
       ======================================== */
    .info-section {
        border-radius: 16px !important;
        padding: 20px !important;
        margin-top: 30px !important;
    }

    .info-section h2 {
        font-size: 1.2rem !important;
        margin-bottom: 16px !important;
    }

    .info-section p {
        font-size: 0.95rem !important;
        margin-bottom: 12px !important;
    }

    .info-features {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
        margin-top: 20px !important;
    }

    .info-feature {
        padding: 16px 12px !important;
        border-radius: 12px !important;
    }

    .info-feature .icon {
        font-size: 2rem !important;
        margin-bottom: 8px !important;
    }

    .info-feature h3 {
        font-size: 0.9rem !important;
        margin-bottom: 6px !important;
    }

    .info-feature p {
        font-size: 0.8rem !important;
    }

    /* ========================================
       Login Prompt - Mobile
       ======================================== */
    .login-prompt {
        border-radius: 14px !important;
        padding: 16px !important;
        font-size: 0.95rem !important;
    }

    /* ========================================
       Empty State - Mobile
       ======================================== */
    .empty-state {
        padding: 30px !important;
    }

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

    /* ========================================
       Touch Feedback
       ======================================== */
    .tab-btn,
    .main-action-btn,
    .gesture-btn,
    .copy-btn,
    .submit-btn,
    .reminder-toggle {
        -webkit-tap-highlight-color: transparent !important;
        touch-action: manipulation !important;
    }

    /* ========================================
       Safe Area Support (iPhone notch)
       ======================================== */
    @supports (padding-bottom: env(safe-area-inset-bottom)) {
        .gestures-wrapper {
            padding-bottom: calc(80px + env(safe-area-inset-bottom)) !important;
        }
    }
}

/* Small phones */
@media (max-width: 375px) {
    .container {
        padding: 0 12px !important;
    }

    .tabs {
        gap: 4px !important;
    }

    .tab-btn {
        padding: 8px 10px !important;
        font-size: 0.8rem !important;
    }

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

    .info-features {
        grid-template-columns: 1fr !important;
    }

    .gesture-emoji {
        font-size: 2.5rem !important;
    }

    .gesture-title {
        font-size: 1.1rem !important;
    }
}
