/**
 * Modal Structure Styles for Hunter Maps Plugin
 * Shared modal structure - for BOTH info and form modals
 * 
 * @package Hunter_Maps
 */

/* ========================================
   MODAL OVERLAY - Desktop
   ======================================== */

#hunter-maps-unified-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

/* ========================================
   MODAL CONTAINER - Desktop
   ======================================== */

#hunter-maps-unified-modal {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 28rem;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* ========================================
   CLOSE BUTTON - Desktop (on container)
   ======================================== */

#hunter-maps-unified-modal .hunter-maps-modal-close {
    position: absolute;
    top: 0px;
    right: 0px;
    border-radius: 0;
    z-index: 1000;
    background: #000000 !important;
    border: none;
    color: #ffffff !important;
    cursor: pointer !important;
    padding: 8px !important;
    width: 40px !important;
    height: 40px !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

#hunter-maps-unified-modal .hunter-maps-modal-close:hover {
    background: #000000 !important;
    color: #ffffff !important;
    cursor: pointer !important;
}

#hunter-maps-unified-modal .hunter-maps-modal-close svg,
#hunter-maps-unified-modal .hunter-maps-modal-close .hunter-icon {
    pointer-events: none !important;
    cursor: pointer !important;
    fill: #ffffff !important;
    color: #ffffff !important;
}

/* ========================================
   MODAL HEADER - Desktop
   ======================================== */

#hunter-maps-unified-modal .hunter-maps-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
    flex-shrink: 0;
}

#hunter-maps-unified-modal .hunter-maps-modal-back {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: #4b5563;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s ease;
}

#hunter-maps-unified-modal .hunter-maps-modal-back:hover {
    color: #1f2937;
}

#hunter-maps-unified-modal .hunter-maps-modal-title {
    flex: 1;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

/* ========================================
   MODAL CONTENT - Desktop
   ======================================== */

#hunter-maps-unified-modal .hunter-maps-modal-content {
    height: 100%;
    overflow-y: overlay;
    border-radius: 0;
}

/* Info modal content - has padding */
#hunter-maps-unified-modal .hunter-maps-modal-info-content {
    padding: 24px;
}

/* ========================================
   LOADING & ERROR STATES - Desktop
   ======================================== */

#hunter-maps-unified-modal .hunter-maps-modal-loading {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

#hunter-maps-unified-modal .hunter-maps-modal-error {
    padding: 24px;
}

/* ========================================
   MOBILE RESPONSIVE - max-width: 480px
   ======================================== */

@media (max-width: 480px) {
    /* Overlay - fixed position on mobile to center on viewport */
    #hunter-maps-unified-modal-overlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        padding: 0;
        display: block !important;
        z-index: 9999;
    }
    
    /* Container - positioned with fixed top and side margins */
    #hunter-maps-unified-modal {
        position: absolute !important;
        top: 20px !important;
        left: 16px !important;
        right: 16px !important;
        max-width: none !important;
        width: auto !important;
        max-height: calc(100vh - 40px);
        height: auto;
        border-radius: 8px;
        display: flex;
        flex-direction: column;
        margin: 0;
    }
    
    /* Close button - fixed position on mobile */
    #hunter-maps-unified-modal .hunter-maps-modal-close {
        position: absolute;
        top: 0px;
        right: 0px;
        border-radius: 0;
        z-index: 1000;
        background: #000000 !important;
        color: #ffffff !important;
        width: 44px !important;
        height: 44px !important;
        padding: 10px !important;
        cursor: pointer !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    #hunter-maps-unified-modal .hunter-maps-modal-close svg,
    #hunter-maps-unified-modal .hunter-maps-modal-close .hunter-icon {
        pointer-events: none !important;
        cursor: pointer !important;
        width: 20px !important;
        height: 20px !important;
        fill: #ffffff !important;
        color: #ffffff !important;
    }
    
    /* Header - extra padding to avoid close button */
    #hunter-maps-unified-modal .hunter-maps-modal-header {
        padding: 16px 56px 16px 16px;
        flex-shrink: 0;
    }
    
    /* Content - full height on mobile with scroll */
    #hunter-maps-unified-modal .hunter-maps-modal-content {
        height: 100%;
        overflow-y: overlay;
        border-radius: 0;
    }
    
    /* Info modal content - reduced padding on mobile */
    #hunter-maps-unified-modal .hunter-maps-modal-info-content {
        padding: 20px;
    }
}

/* ========================================
   TABLET RESPONSIVE - max-width: 768px
   ======================================== */

@media (min-width: 481px) and (max-width: 768px) {
    /* Overlay - fixed position on tablet to center on viewport */
    #hunter-maps-unified-modal-overlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        padding: 0;
        display: block !important;
        z-index: 9999;
    }
    
    /* Container - positioned with fixed top and side margins */
    #hunter-maps-unified-modal {
        position: absolute !important;
        top: 20px !important;
        left: 20px !important;
        right: 20px !important;
        max-width: none !important;
        width: auto !important;
        max-height: calc(100vh - 40px);
        margin: 0;
    }
}
/* ========================================
   REMOVE ALL FOCUS EFFECTS FROM CLOSE BUTTONS
   ======================================== */

#hunter-maps-unified-modal .hunter-maps-modal-close:focus,
#hunter-maps-unified-modal .hunter-maps-modal-close:focus-visible,
#hunter-maps-unified-modal .hunter-maps-modal-close:active {
    outline: none !important;
    outline-width: 0 !important;
    outline-style: none !important;
    outline-color: transparent !important;
    outline-offset: 0 !important;
    box-shadow: none !important;
    border: none !important;
    background: #000000 !important;
    color: #ffffff !important;
    transform: none !important;
    transition: none !important;
}

#hunter-maps-unified-modal .hunter-maps-modal-close::-moz-focus-inner {
    border: 0 !important;
    padding: 0 !important;
    outline: none !important;
}