/* Frontend Styles for FFSOFT Popup */
.ffsoft-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 999999;
    justify-content: center;
    align-items: center;
    font-family: Montserrat, sans-serif;
    animation: ffsoftPopupFadeIn 0.3s ease-out;
    padding: 20px;
    box-sizing: border-box;
}

.ffsoft-popup-container {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    max-height: 90vh;
    animation: ffsoftPopupSlideIn 0.4s ease-out;
    display: flex;
    flex-direction: column;
}

.ffsoft-popup-content {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
}

/* Close Button */
.ffsoft-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.ffsoft-popup-close:hover {
    color: #ff0000;
    background: white;
    transform: rotate(90deg);
}

/* Image Wrapper */
.ffsoft-popup-image-wrapper {
    position: relative;
    width: 100%;
    flex: 1;
    overflow: hidden;
}

.ffsoft-popup-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
}

.ffsoft-popup-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Text Overlay (when image exists) */
.ffsoft-popup-text-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
    color: white;
    padding: 20px 25px 25px;
    text-align: center;
    z-index: 10;
}

.ffsoft-popup-text-overlay .ffsoft-popup-heading {
    color: white;
    margin: 0 0 8px 0;
    font-weight: 700;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    font-size: 22px;
}

.ffsoft-popup-text-overlay .ffsoft-popup-subheading {
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    font-weight: 400;
    line-height: 1.4;
    font-size: 15px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Text Only Section (when no image) */
.ffsoft-popup-text-only {
    padding: 30px 25px;
    text-align: center;
    background: white;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ffsoft-popup-text-only .ffsoft-popup-heading {
    margin: 0 0 12px 0;
    font-weight: 700;
    line-height: 1.3;
    color: #333;
}

.ffsoft-popup-text-only .ffsoft-popup-subheading {
    margin: 0;
    font-weight: 400;
    line-height: 1.5;
    color: #666;
}

/* Button */
.ffsoft-popup-button {
    padding: 20px 25px;
    text-align: center;
    background: white;
    border-top: 1px solid #eee;
}

.ffsoft-popup-btn {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 30px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    min-width: 160px;
}

.ffsoft-popup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

/* Social Links */
.ffsoft-popup-social {
    padding: 15px 25px 20px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    text-align: center;
}

.ffsoft-popup-social-icons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ffsoft-popup-social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: white;
    color: #555;
    text-decoration: none;
    font-size: 16px;
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
}

.ffsoft-popup-social-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-color: transparent;
}

/* Social icon colors on hover */
.ffsoft-popup-social-icon:hover i.fa-youtube {
    color: #ff0000;
}

.ffsoft-popup-social-icon:hover i.fa-facebook {
    color: #1877f2;
}

.ffsoft-popup-social-icon:hover i.fa-twitter {
    color: #1da1f2;
}

.ffsoft-popup-social-icon:hover i.fa-x-twitter {
    color: #000000;
}

.ffsoft-popup-social-icon:hover i.fa-whatsapp {
    color: #25d366;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ffsoft-popup-overlay {
        padding: 10px;
    }
    
    .ffsoft-popup-container {
        width: 95% !important;
        max-height: 85vh;
        border-radius: 10px;
    }
    
    .ffsoft-popup-close {
        top: 8px;
        right: 8px;
        width: 28px;
        height: 28px;
        font-size: 20px;
    }
    
    .ffsoft-popup-text-overlay {
        padding: 15px 20px 20px;
    }
    
    .ffsoft-popup-text-overlay .ffsoft-popup-heading {
        font-size: 18px;
        margin-bottom: 6px;
    }
    
    .ffsoft-popup-text-overlay .ffsoft-popup-subheading {
        font-size: 14px;
    }
    
    .ffsoft-popup-text-only {
        padding: 25px 20px;
    }
    
    .ffsoft-popup-text-only .ffsoft-popup-heading {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .ffsoft-popup-text-only .ffsoft-popup-subheading {
        font-size: 14px;
    }
    
    .ffsoft-popup-button {
        padding: 15px 20px;
    }
    
    .ffsoft-popup-btn {
        padding: 10px 25px;
        font-size: 14px;
        min-width: 140px;
    }
    
    .ffsoft-popup-social {
        padding: 12px 20px 15px;
    }
    
    .ffsoft-popup-social-icon {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }
    
    .ffsoft-popup-social-icons {
        gap: 8px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .ffsoft-popup-overlay {
        padding: 5px;
    }
    
    .ffsoft-popup-container {
        width: 98% !important;
        max-height: 90vh;
        border-radius: 8px;
    }
    
    .ffsoft-popup-text-overlay {
        padding: 12px 15px 15px;
    }
    
    .ffsoft-popup-text-overlay .ffsoft-popup-heading {
        font-size: 16px;
    }
    
    .ffsoft-popup-text-overlay .ffsoft-popup-subheading {
        font-size: 13px;
        line-height: 1.3;
    }
    
    .ffsoft-popup-text-only {
        padding: 20px 15px;
    }
    
    .ffsoft-popup-text-only .ffsoft-popup-heading {
        font-size: 16px;
    }
    
    .ffsoft-popup-text-only .ffsoft-popup-subheading {
        font-size: 13px;
    }
    
    .ffsoft-popup-btn {
        padding: 10px 20px;
        font-size: 13px;
        min-width: 120px;
    }
    
    .ffsoft-popup-social-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

/* Tablet Responsive */
@media (min-width: 769px) and (max-width: 1024px) {
    .ffsoft-popup-container {
        width: 85% !important;
        max-height: 85vh;
    }
    
    .ffsoft-popup-text-overlay .ffsoft-popup-heading {
        font-size: 20px;
    }
    
    .ffsoft-popup-text-overlay .ffsoft-popup-subheading {
        font-size: 15px;
    }
}

/* Landscape Mobile */
@media (max-height: 600px) and (orientation: landscape) {
    .ffsoft-popup-container {
        max-height: 95vh;
        width: 70% !important;
    }
    
    .ffsoft-popup-image-wrapper {
        max-height: 60vh;
    }
    
    .ffsoft-popup-text-overlay {
        padding: 10px 15px 12px;
    }
    
    .ffsoft-popup-text-overlay .ffsoft-popup-heading {
        font-size: 16px;
        margin-bottom: 4px;
    }
    
    .ffsoft-popup-text-overlay .ffsoft-popup-subheading {
        font-size: 12px;
        line-height: 1.2;
    }
    
    .ffsoft-popup-button {
        padding: 10px 15px;
    }
    
    .ffsoft-popup-social {
        padding: 8px 15px 10px;
    }
}

/* Animations */
@keyframes ffsoftPopupFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes ffsoftPopupSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Loading state */
.ffsoft-popup-container.loading {
    opacity: 0;
}

/* Print styles - hide popup when printing */
@media print {
    .ffsoft-popup-overlay {
        display: none !important;
    }
}

/* Ensure proper layout for different content combinations */
.ffsoft-popup-container:has(.ffsoft-popup-image-wrapper) .ffsoft-popup-button,
.ffsoft-popup-container:has(.ffsoft-popup-text-only) .ffsoft-popup-button {
    margin-top: 0;
}

/* Adjust text-only layout when there's no image but has button/social */
.ffsoft-popup-text-only + .ffsoft-popup-button {
    border-top: 1px solid #eee;
}

/* Compact layout adjustments */
.ffsoft-popup-content {
    gap: 0;
}

/* Ensure image takes full width of container */
.ffsoft-popup-image-wrapper {
    min-height: 200px;
}

/* Fallback for browsers that don't support :has() */
.no-has-support .ffsoft-popup-button {
    border-top: 1px solid #eee;
}