/**
 * User Type Selection Popup Styles
 * 
 * Styling for the user type selection popup modal
 * with card-based layout and hover effects
 * 
 * @package AspirePortfolio
 * @since 2.1.0
 */

/* ========================================
   MAGNIFIC POPUP OVERRIDES
   ======================================== */

/* Override Magnific Popup background to 100% opaque white */
.mfp-bg.user-type-popup-magnific {
    background: #ffffff !important;
    background-color: #ffffff !important;
    opacity: 1 !important;
    filter: alpha(opacity=100) !important; /* IE8 */
}

.user-type-popup-magnific .mfp-bg {
    background: #ffffff !important;
    background-color: #ffffff !important;
    opacity: 1 !important;
    filter: alpha(opacity=100) !important;
}

/* Additional override for Magnific Popup's default background */
.mfp-wrap.user-type-popup-magnific {
    background: #ffffff !important;
    background-color: #ffffff !important;
}

/* Ensure the background overlay itself is white */
.mfp-bg {
    background: #ffffff !important;
    background-color: #ffffff !important;
    opacity: 1 !important;
    z-index: 99998 !important; /* Below popup content, above all page elements */
}

/* Cover entire viewport with white */
body.mfp-open .mfp-bg {
    background: #ffffff !important;
    background-color: #ffffff !important;
    opacity: 1 !important;
    z-index: 99998 !important; /* Below popup content, above all page elements */
}

/* Hide close button completely - force user to select a type */
.user-type-popup-magnific .mfp-close,
.mfp-close,
button.mfp-close,
.mfp-close-btn-in .mfp-close {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Popup content wrapper */
.user-type-popup-magnific .mfp-content {
    max-width: 1200px;
    width: 90%;
    position: relative;
    z-index: 99999 !important; /* Highest - always on top */
}

/* Ensure wrapper itself is above background and all page content */
.mfp-wrap {
    z-index: 99999 !important; /* Highest - always on top */
}

.user-type-popup-magnific.mfp-wrap {
    z-index: 99999 !important; /* Highest - always on top */
}

/* Remove default Magnific Popup styling */
.user-type-popup-magnific .mfp-close {
    display: none !important;
}

/* Ensure content container is visible */
.mfp-inline-holder .mfp-content {
    background: #ffffff !important;
}

/* ========================================
   POPUP CONTAINER
   ======================================== */

.user-type-popup-container {
    background: #ffffff!important;
    padding: 0 !important;
    margin: 0 auto !important;
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 1200px !important;
    display: block !important;
    visibility: visible !important;
}

.user-type-popup-inner {
    background: transparent !important;
    padding: 60px 20px !important;
    text-align: center !important;
    display: block !important;
    visibility: visible !important;
}

/* ========================================
   POPUP TITLE
   ======================================== */

.popup-title {
    margin-bottom: 50px;
}

.popup-title h2 {
    font-size: 42px;
    font-weight: bold;
    color: #221e46;
    margin: 0 0 15px 0;
    line-height: 1.2;
}

.popup-title p {
    font-size: 18px;
    color: #666;
    margin: 0;
}

/* ========================================
   USER TYPE CARDS
   ======================================== */

.user-type-cards {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 40px;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.user-type-card {
    width: 350px;
    cursor: pointer;
    transition: transform 0.3s ease;
    position: relative;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1); /* iOS tap feedback */
    -webkit-touch-callout: none; /* Prevent iOS context menu */
    pointer-events: auto !important; /* Ensure cards are clickable */
    z-index: 10; /* Above other elements */
}

.user-type-card:hover {
    transform: translateY(-5px);
}

/* ========================================
   CARD IMAGE WRAPPER
   ======================================== */

.card-image-wrapper {
    width: 350px;
    height: 350px;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1); /* iOS tap feedback */
    background: #f0f0f0;
    pointer-events: auto !important; /* Ensure wrapper is clickable */
}

/* Card Image - Blurs on hover */
.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.7s ease;
    display: block;
    filter: blur(0px); /* Start with no blur */
}

/* Blur effect on hover - image blurs as overlay slides up */
.user-type-card:hover .card-image {
    filter: blur(20px); /* 20px blur on hover */
}

/* ========================================
   SVG MASK OVERLAY
   ======================================== */

.card-svg-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    overflow: hidden; /* Clip the overlay within card boundaries */
}

.card-svg-mask svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Blue overlay group - initially positioned to show curve at bottom of card */
.blue-overlay-group {
    transform: translateY(260px); /* Position so curve appears at bottom */
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1); /* Smooth, elegant easing */
    transform-origin: top center;
}

/* Slide up on hover - curve moves up and disappears off top, solid blue fills card */
.user-type-card:hover .blue-overlay-group {
    transform: translateY(-30px); /* Slide up to hide curve above card, solid blue remains */
}

/* ========================================
   CARD LABEL
   ======================================== */

.card-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 3; /* Above SVG mask */
    padding: 35px 10px 25px 10px; /* Reduced horizontal padding for better text fit in Chrome */
    pointer-events: none; /* Allow clicks to pass through to card */
}

.card-label h3 {
    font-size: 21px; /* Reduced from 22px for consistent rendering across Chrome/Safari */
    font-weight: bold;
    color: #ffffff; /* White text over dark blue mask */
    margin: 0;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); /* Subtle shadow for readability */
}

.card-label p {
    font-size: 16px;
    color: #ffffff;
    margin: 0;
}

/* ========================================
   HOVER STATES
   ======================================== */

/* Add subtle shadow on hover */
.user-type-card:hover .card-image-wrapper {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Label transitions smoothly with the overlay */
.card-label h3 {
    transition: color 0.3s ease 0.2s; /* Slight delay for smoother effect */
}

/* Brighten label on hover */
.user-type-card:hover .card-label h3 {
    color: #20D38E; /* Aspire green on hover */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4); /* Slightly stronger shadow on hover */
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Tablet - Stack cards vertically, reduce size */
@media (max-width: 1024px) {
    .user-type-cards {
        gap: 30px;
    }
    
    .user-type-card {
        width: 300px;
    }
    
    .card-image-wrapper {
        width: 300px;
        height: 300px;
    }
    
    .popup-title h2 {
        font-size: 36px;
    }
}

/* Mobile - Simplified cards without images */
@media (max-width: 768px) {
    .user-type-popup-inner {
        padding: 40px 15px;
    }
    
    .popup-title {
        margin-bottom: 30px;
    }
    
    .popup-title h2 {
        font-size: 28px;
    }
    
    .popup-title p {
        font-size: 16px;
    }
    
    .user-type-cards {
        flex-direction: column;
        align-items: center;
        gap: 15px; /* Reduced gap between cards */
    }
    
    .user-type-card {
        width: 90%; /* Full width with margins */
        max-width: 350px;
    }
    
    /* Simplified card wrapper - just dark blue rectangle */
    .card-image-wrapper {
        width: 100%;
        height: auto; /* Auto height based on content */
        min-height: 80px; /* Reduced minimum height */
        background-color: #221e46; /* Solid dark blue background */
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px 15px; /* Reduced padding for shorter height */
    }
    
    /* Hide the actual image on mobile */
    .card-image {
        display: none !important;
    }
    
    /* Hide SVG mask on mobile */
    .card-svg-mask {
        display: none !important;
    }
    
    /* Reposition label to be centered and static (not absolute) */
    .card-label {
        position: static; /* Remove absolute positioning */
        padding: 0; /* Remove padding */
        width: 100%;
        pointer-events: auto; /* Re-enable pointer events for mobile */
    }
    
    .card-label h3 {
        font-size: 18px; /* Slightly smaller font */
        color: #ffffff;
        margin: 0;
        line-height: 1.3; /* Tighter line height */
    }
    
    .card-label p {
        font-size: 14px;
    }
}

/* Small mobile - Even smaller cards */
@media (max-width: 480px) {
    .user-type-popup-inner {
        padding: 30px 10px;
    }
    
    .popup-title h2 {
        font-size: 24px;
    }
    
    .popup-title p {
        font-size: 14px;
    }
    
    .user-type-card {
        width: 95%; /* Wider on small screens */
        max-width: 320px;
    }
    
    /* Override with simplified mobile design - NO FIXED HEIGHT */
    .card-image-wrapper {
        width: 100%;
        height: auto !important; /* Force auto height */
        min-height: 70px !important; /* Even shorter for small mobile */
        background-color: #221e46;
        padding: 18px 12px !important; /* Smaller padding */
    }
    
    .card-label h3 {
        font-size: 17px; /* Slightly smaller */
        line-height: 1.25;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

/* Keyboard focus states */
.user-type-card:focus {
    outline: 3px solid #20D38E;
    outline-offset: 5px;
}

/* Add focus indicator for keyboard navigation */
.user-type-card {
    -webkit-tap-highlight-color: rgba(32, 211, 142, 0.3);
}

/* ========================================
   ANIMATION
   ======================================== */

/* Fade in animation when popup opens */
.mfp-fade.mfp-bg {
    transition: opacity 0.3s ease-out;
}

.mfp-fade.mfp-wrap .mfp-content {
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.mfp-fade.mfp-ready .mfp-content {
    opacity: 1;
}

.mfp-fade.mfp-removing .mfp-content {
    opacity: 0;
}

