/**
 * SPM Modal Mobile Force Styles - Aggressive mobile optimizations
 * Uses higher specificity to ensure mobile styles are applied
 */

/* Force mobile styles for screens smaller than 768px */
@media screen and (max-width: 767px) {
    
    /* Force mobile modal container */
    body .spm-modal-wrapper .mfp-container {
        padding: 0 10px !important;
        position: relative !important;
    }
    
    /* Force mobile content positioning */
    body .spm-modal-wrapper .mfp-content {
        max-width: 100vw !important;
        width: 100% !important;
        margin: 5px auto !important;
        vertical-align: top !important;
        position: relative !important;
    }
    
    /* Force mobile figure adjustments */
    body .spm-modal-wrapper .mfp-figure {
        border-radius: 8px !important;
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4) !important;
        margin: 0 !important;
        max-width: 100% !important;
    }
    
    /* Force mobile image optimizations */
    body .spm-modal-wrapper .mfp-img {
        max-height: 40vh !important;
        height: auto !important;
        border-radius: 8px 8px 0 0 !important;
        width: 100% !important;
        object-fit: contain !important;
    }
    
    /* Force mobile close button */
    body .spm-modal-wrapper .mfp-close {
        top: 10px !important;
        right: 10px !important;
        width: 35px !important;
        height: 35px !important;
        font-size: 16px !important;
        background: rgba(255, 255, 255, 0.95) !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Force mobile bottom bar */
    body .spm-modal-wrapper .mfp-bottom-bar {
        padding: 15px !important;
        border-radius: 0 0 8px 8px !important;
        max-height: 50vh !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* Force mobile title */
    body .spm-modal-wrapper .mfp-title h3 {
        font-size: 18px !important;
        line-height: 1.2 !important;
        margin-bottom: 10px !important;
        word-wrap: break-word !important;
    }
    
    /* Force mobile meta layout */
    body .spm-modal-wrapper .spm-modal-meta {
        flex-direction: column !important;
        gap: 8px !important;
        margin-bottom: 12px !important;
        font-size: 13px !important;
        display: flex !important;
    }
    
    body .spm-modal-wrapper .spm-modal-photographer,
    body .spm-modal-wrapper .spm-modal-price,
    body .spm-modal-wrapper .spm-modal-category,
    body .spm-modal-wrapper .spm-modal-size,
    body .spm-modal-wrapper .spm-modal-upload-date,
    body .spm-modal-wrapper .spm-modal-image-id {
        gap: 4px !important;
        font-size: 13px !important;
        display: flex !important;
        align-items: center !important;
    }
    
    /* Force mobile description */
    body .spm-modal-wrapper .spm-modal-description-text {
        padding: 12px !important;
        margin-bottom: 12px !important;
        font-size: 13px !important;
    }
    
    body .spm-modal-wrapper .spm-modal-description-text p {
        font-size: 13px !important;
        line-height: 1.5 !important;
        margin: 0 !important;
    }
    
    /* Force mobile tags */
    body .spm-modal-wrapper .spm-modal-tags {
        margin-bottom: 15px !important;
    }
    
    body .spm-modal-wrapper .spm-tag {
        padding: 3px 10px !important;
        font-size: 11px !important;
        margin-right: 6px !important;
        margin-bottom: 6px !important;
        display: inline-block !important;
    }
    
    /* Force mobile actions */
    body .spm-modal-wrapper .spm-modal-actions {
        flex-direction: column !important;
        gap: 8px !important;
        margin-top: 15px !important;
        display: flex !important;
    }
    
    body .spm-modal-wrapper .spm-modal-actions .nectar-button {
        padding: 14px 20px !important;
        font-size: 14px !important;
        border-radius: 8px !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
    }
    
    body .spm-modal-wrapper .spm-modal-actions .nectar-button span {
        gap: 6px !important;
        font-size: 14px !important;
        display: flex !important;
        align-items: center !important;
    }
    
    /* Force mobile meta row */
    body .spm-modal-wrapper .spm-modal-meta-row {
        gap: 12px !important;
        margin-bottom: 10px !important;
        font-size: 12px !important;
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        padding: 10px 12px !important;
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
        border-radius: 6px !important;
        border-left: 3px solid #6b7280 !important;
    }
    
    body .spm-modal-wrapper .spm-modal-meta-row span {
        gap: 3px !important;
        font-size: 12px !important;
        display: flex !important;
        align-items: center !important;
        font-weight: 500 !important;
    }
    
    body .spm-modal-wrapper .spm-modal-meta-row i {
        font-size: 12px !important;
        color: #6b7280 !important;
    }
    
    /* Tags Section for Mobile Force */
    body .spm-modal-wrapper .spm-modal-tags-section {
        margin-bottom: 12px !important;
        padding: 10px 12px !important;
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
        border-radius: 6px !important;
        border-left: 3px solid #10b981 !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
    }
    
    /* Inline Tags for Mobile Force */
body .spm-modal-wrapper .spm-modal-tags-inline {
    display: flex !important;
    align-items: center !important;
    gap: 3px !important;
    flex-wrap: wrap !important;
}

body .spm-modal-wrapper .spm-modal-tags-inline i {
    font-size: 11px !important;
    color: #6b7280 !important;
    margin-right: 2px !important;
}

body .spm-modal-wrapper .spm-tag-inline {
    padding: 0 !important;
    font-size: 12px !important;
    margin-right: 8px !important;
    margin-bottom: 0 !important;
    display: inline !important;
    background: none !important;
    color: #6b7280 !important;
    border-radius: 0 !important;
    font-weight: normal !important;
    box-shadow: none !important;
}
    
    /* Force mobile icons */
    body .spm-modal-wrapper .spm-modal-meta .fas,
    body .spm-modal-wrapper .spm-modal-meta .far,
    body .spm-modal-wrapper .spm-modal-meta .fab {
        font-size: 12px !important;
    }
    
    body .spm-modal-wrapper .spm-modal-actions .fas,
    body .spm-modal-wrapper .spm-modal-actions .far,
    body .spm-modal-wrapper .spm-modal-actions .fab {
        font-size: 14px !important;
    }
    
    /* Force mobile touch feedback */
    body .spm-modal-wrapper .mfp-close:active {
        transform: scale(0.95) !important;
    }
    
    body .spm-modal-wrapper .spm-modal-actions .nectar-button:active {
        transform: scale(0.98) !important;
    }
    
    /* Force mobile background */
    body .spm-modal-wrapper .mfp-bg {
        opacity: 0.9 !important;
    }
    
    /* Force mobile animation */
    body .spm-modal-wrapper .mfp-figure {
        animation: spmModalFadeInMobileForce 0.25s ease-out !important;
    }
    
    @keyframes spmModalFadeInMobileForce {
        from {
            opacity: 0;
            transform: scale(0.9) translateY(20px);
        }
        to {
            opacity: 1;
            transform: scale(1) translateY(0);
        }
    }
}

/* Force mobile landscape */
@media screen and (max-width: 767px) and (orientation: landscape) {
    body .spm-modal-wrapper .mfp-img {
        max-height: 35vh !important;
    }
    
    body .spm-modal-wrapper .mfp-bottom-bar {
        max-height: 40vh !important;
    }
    
    body .spm-modal-wrapper .mfp-title h3 {
        font-size: 16px !important;
    }
    
    body .spm-modal-wrapper .spm-modal-meta {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 12px !important;
    }
}

/* Force extra small mobile */
@media screen and (max-width: 480px) {
    body .spm-modal-wrapper .mfp-container {
        padding: 0 5px !important;
    }
    
    body .spm-modal-wrapper .mfp-content {
        margin: 2px auto !important;
    }
    
    body .spm-modal-wrapper .mfp-bottom-bar {
        padding: 12px !important;
    }
    
    body .spm-modal-wrapper .mfp-title h3 {
        font-size: 16px !important;
    }
    
    body .spm-modal-wrapper .spm-modal-actions .nectar-button {
        padding: 12px 16px !important;
        font-size: 13px !important;
    }
}

/* Ensure desktop styles don't override mobile */
@media screen and (min-width: 768px) {
    body .spm-modal-wrapper .mfp-content {
        max-width: 900px !important;
        margin: 0 auto !important;
        vertical-align: middle !important;
    }
    
    body .spm-modal-wrapper .mfp-img {
        max-height: 60vh !important;
    }
    
    body .spm-modal-wrapper .mfp-bottom-bar {
        padding: 25px !important;
        max-height: none !important;
        overflow-y: visible !important;
    }
    
    body .spm-modal-wrapper .mfp-title h3 {
        font-size: 24px !important;
    }
    
    body .spm-modal-wrapper .spm-modal-meta {
        flex-direction: row !important;
        gap: 20px !important;
        font-size: 14px !important;
    }
    
    body .spm-modal-wrapper .spm-modal-actions {
        flex-direction: row !important;
        gap: 15px !important;
    }
    
    body .spm-modal-wrapper .spm-modal-actions .nectar-button {
        padding: 12px 24px !important;
        font-size: 14px !important;
        min-height: auto !important;
        width: auto !important;
    }
} 