/* ==========================================================================
   Notifal Activation Popup Styles - Modern Design
   ========================================================================== */

/**
 * Activation popup uses shared notifal color variables for consistency
 */

/**
 * Overlay background
 * Creates the backdrop effect for the popup
 */
.notifal-activation-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: 999999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/**
 * Show state for overlay
 */
.notifal-activation-popup-overlay.show {
    display: block;
    opacity: 1;
}

/**
 * Main popup content container
 * Modern card-based design with shadow and border radius
 */
.notifal-activation-popup-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--notifal-white);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
    max-width: 560px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    z-index: 1000000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/**
 * Show state for popup content
 */
.notifal-activation-popup-content.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/**
 * Hide animation state
 */
.notifal-activation-popup-content.hide {
    transform: translate(-50%, -50%) scale(0.95);
    opacity: 0;
}

/**
 * Popup header with gradient background
 * Includes welcome icon and title
 */
.notifal-activation-popup-header {
    position: relative;
    padding: 40px 32px 32px;
    background: linear-gradient(135deg, var(--notifal-primary) 0%, var(--notifal-primary-hover) 100%);
    text-align: center;
    border-bottom: none;
}

/**
 * Welcome icon container
 */
.notifal-activation-popup-welcome-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    margin-bottom: 20px;
    animation: notifal-activation-popup-icon-bounce 0.8s ease-out;
}

/**
 * Icon bounce animation
 */
@keyframes notifal-activation-popup-icon-bounce {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.1) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/**
 * Welcome icon emoji
 */
.notifal-activation-popup-welcome-icon .notifal-popup-emoji {
    font-size: 48px;
    line-height: 1;
    display: block;
}

/**
 * Popup header title
 */
.notifal-activation-popup-header h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: var(--notifal-white);
    line-height: 1.3;
    letter-spacing: -0.5px;
}

/**
 * Close button
 * Positioned in top-right corner
 */
.notifal-activation-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    font-size: 20px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 8px;
    line-height: 1;
    border-radius: 8px;
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/**
 * Close button hover state
 */
.notifal-activation-popup-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--notifal-white);
    transform: rotate(90deg);
}

/**
 * Close button focus state for accessibility
 */
.notifal-activation-popup-close:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/**
 * Popup body
 * Contains description and action buttons
 */
.notifal-activation-popup-body {
    padding: 32px;
    overflow-y: auto;
    max-height: calc(90vh - 200px);
}

/**
 * Description text
 */
.notifal-activation-popup-description {
    margin: 0 0 28px 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--notifal-text-muted);
    text-align: center;
}

/**
 * Action buttons container
 */
.notifal-activation-popup-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/**
 * Base button styles
 */
.notifal-activation-popup-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    text-decoration: none;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

/**
 * Button focus state for accessibility
 */
.notifal-activation-popup-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(126, 43, 210, 0.3);
}

/**
 * Button hover state
 */
.notifal-activation-popup-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    color: white; 
}

/**
 * Button active state
 */
.notifal-activation-popup-button:active {
    transform: translateY(0);
}

/**
 * Primary button (main CTA)
 */
.notifal-activation-popup-button-primary {
    background: linear-gradient(135deg, var(--notifal-primary) 0%, var(--notifal-primary-hover) 100%);
    color: var(--notifal-white);
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(126, 43, 210, 0.3);
}

/**
 * Primary button hover state
 */
.notifal-activation-popup-button-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #651bb0 0%, #541a95 100%);
    box-shadow: 0 8px 20px rgba(126, 43, 210, 0.4);
    transform: translateY(-2px);
}

/**
 * Secondary buttons (non-primary actions)
 */
.notifal-activation-popup-button:not(.notifal-activation-popup-button-primary) {
    background-color: var(--notifal-white);
    color: var(--notifal-text-dark);
    border: 2px solid var(--notifal-border);
}

/**
 * Secondary button hover state
 */
.notifal-activation-popup-button:not(.notifal-activation-popup-button-primary):hover {
    background-color: var(--notifal-secondary);
    border-color: var(--notifal-primary);
    color: var(--notifal-primary);
}

/**
 * External button styling (for buttons that open in new tabs)
 * Currently no additional styling needed, but class is available for future use
 */

/**
 * Button icons (Notifal Icons)
 */
.notifal-activation-popup-button [class^="notifal-icon-"],
.notifal-activation-popup-button [class*=" notifal-icon-"] {
    font-size: 20px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}


/* ==========================================================================
   Responsive Design
   ========================================================================== */

/**
 * Tablet and smaller devices
 */
@media (max-width: 768px) {
    /**
     * Adjust popup content width
     */
    .notifal-activation-popup-content {
        width: 95%;
        max-width: 500px;
    }

    /**
     * Reduce header padding
     */
    .notifal-activation-popup-header {
        padding: 32px 24px 24px;
    }

    /**
     * Adjust welcome icon size
     */
    .notifal-activation-popup-welcome-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 16px;
    }

    /**
     * Smaller emoji size
     */
    .notifal-activation-popup-welcome-icon .notifal-popup-emoji {
        font-size: 40px;
    }

    /**
     * Adjust header title size
     */
    .notifal-activation-popup-header h2 {
        font-size: 24px;
    }

    /**
     * Reduce body padding
     */
    .notifal-activation-popup-body {
        padding: 24px;
    }

    /**
     * Adjust description font size
     */
    .notifal-activation-popup-description {
        font-size: 14px;
    }

    /**
     * Reduce button padding
     */
    .notifal-activation-popup-button {
        padding: 12px 20px;
        font-size: 14px;
    }
}

/**
 * Mobile devices
 */
@media (max-width: 480px) {
    /**
     * Full width on mobile
     */
    .notifal-activation-popup-content {
        width: 95%;
        max-width: calc(100vw - 20px);
        border-radius: 12px;
    }

    /**
     * Further reduce header padding
     */
    .notifal-activation-popup-header {
        padding: 24px 20px 20px;
    }

    /**
     * Smaller welcome icon
     */
    .notifal-activation-popup-welcome-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 12px;
    }

    /**
     * Smaller emoji
     */
    .notifal-activation-popup-welcome-icon .notifal-popup-emoji {
        font-size: 32px;
    }

    /**
     * Smaller title
     */
    .notifal-activation-popup-header h2 {
        font-size: 20px;
    }

    /**
     * Reduce body padding
     */
    .notifal-activation-popup-body {
        padding: 20px 16px;
    }

    /**
     * Smaller description text
     */
    .notifal-activation-popup-description {
        font-size: 13px;
        margin-bottom: 20px;
    }

    /**
     * Adjust action buttons gap
     */
    .notifal-activation-popup-actions {
        gap: 10px;
    }

    /**
     * Smaller buttons
     */
    .notifal-activation-popup-button {
        padding: 12px 16px;
        font-size: 14px;
    }

    /**
     * Smaller button icons
     */
    .notifal-activation-popup-button [class^="notifal-icon-"],
    .notifal-activation-popup-button [class*=" notifal-icon-"] {
        font-size: 18px;
        width: 18px;
        height: 18px;
    }

    /**
     * Smaller close button
     */
    .notifal-activation-popup-close {
        width: 32px;
        height: 32px;
        font-size: 18px;
        top: 12px;
        right: 12px;
    }

    /**
     * RTL mobile adjustments
     */
    body.rtl .notifal-activation-popup-close {
        left: 12px;
        right: auto;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

/**
 * Reduce motion for users who prefer it
 * Respects prefers-reduced-motion media query
 */
@media (prefers-reduced-motion: reduce) {
    .notifal-activation-popup-overlay,
    .notifal-activation-popup-content,
    .notifal-activation-popup-close,
    .notifal-activation-popup-button,
    .notifal-activation-popup-welcome-icon {
        transition: none;
        animation: none;
    }

    /**
     * Disable icon bounce animation
     */
    @keyframes notifal-activation-popup-icon-bounce {
        0%, 100% {
            transform: scale(1) rotate(0deg);
            opacity: 1;
        }
    }
}

/**
 * Screen reader only text
 * Hides content visually but keeps it accessible to screen readers
 */
.notifal-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/**
 * Focus visible styles for better keyboard navigation
 * Only shows outline when user is using keyboard
 */
.notifal-activation-popup-button:focus-visible,
.notifal-activation-popup-close:focus-visible {
    outline: 3px solid rgba(126, 43, 210, 0.5);
    outline-offset: 2px;
}

/* ==========================================================================
   Animation for popup close
   ========================================================================== */

/**
 * Closing animation class
 */
.notifal-activation-popup-closing {
    animation: notifal-activation-popup-fade-out 0.3s ease-in forwards;
}

/**
 * Fade out animation keyframes
 */
@keyframes notifal-activation-popup-fade-out {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* ==========================================================================
   RTL Support for Activation Popup
   ========================================================================== */

body.rtl .notifal-activation-popup-content {
    direction: rtl;
}

body.rtl .notifal-activation-popup-header {
    text-align: right;
}

body.rtl .notifal-activation-popup-description {
    text-align: right;
}

body.rtl .notifal-activation-popup-close {
    left: 16px;
    right: auto;
}

body.rtl .notifal-activation-popup-actions {
    direction: rtl;
}

body.rtl .notifal-activation-popup-button:not(.notifal-activation-popup-button-primary) {
    text-align: right;
}

body.rtl .notifal-activation-popup-button [class^="notifal-icon-"],
body.rtl .notifal-activation-popup-button [class*=" notifal-icon-"] {
    margin-left: 10px;
    margin-right: 0;
}

/* ==========================================================================
   Body scroll lock when popup is active
   ========================================================================== */

/**
 * Prevent body scroll when popup is open
 */
body.notifal-activation-popup-active {
    overflow: hidden;
}
