/* Email Collection Popup Wall */
/* Neumorphic design for email capture */

.email-popup-wall {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    padding: 20px;
}

.email-popup-wall.show {
    opacity: 1;
    visibility: visible;
}

.email-popup-content {
    background: var(--surface-color);
    border-radius: var(--radius-large);
    padding: 40px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    position: relative;
    box-shadow: 
        16px 16px 32px var(--shadow-color),
        -16px -16px 32px var(--highlight-color),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    transform: scale(0.8) translateY(40px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.email-popup-wall.show .email-popup-content {
    transform: scale(1) translateY(0);
}

/* Popup Header */
.popup-header {
    margin-bottom: 24px;
}

.popup-title {
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text-primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.popup-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.popup-benefits {
    text-align: left;
    margin: 20px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.popup-benefits ul {
    list-style: none;
    padding: 0;
}

.popup-benefits li {
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.popup-benefits li::before {
    content: "✨";
    font-size: 12px;
}

/* Email Form */
.email-form {
    margin: 24px 0;
}

.email-input-group {
    position: relative;
    margin-bottom: 16px;
}

.email-input {
    width: 100%;
    padding: 16px 20px;
    border: none;
    border-radius: var(--radius-medium);
    background: var(--surface-color);
    color: var(--text-primary);
    font-size: 16px;
    box-shadow: 
        inset 4px 4px 8px var(--shadow-inset-color),
        inset -4px -4px 8px var(--highlight-color);
    transition: all var(--transition-fast);
    outline: none;
}

.email-input:focus {
    box-shadow: 
        inset 4px 4px 8px var(--shadow-inset-color),
        inset -4px -4px 8px var(--highlight-color),
        0 0 0 2px var(--accent);
}

.email-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Subscribe Button */
.subscribe-btn {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: var(--radius-medium);
    background: linear-gradient(135deg, var(--accent), #ff8c5a);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 
        6px 6px 12px var(--shadow-color),
        -6px -6px 12px var(--highlight-color);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.subscribe-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        8px 8px 16px var(--shadow-color),
        -8px -8px 16px var(--highlight-color);
}

.subscribe-btn:active {
    transform: translateY(0);
    box-shadow: 
        3px 3px 6px var(--shadow-color),
        -3px -3px 6px var(--highlight-color);
}

.subscribe-btn.loading {
    color: transparent;
}

.subscribe-btn.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Close Button */
.popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--surface-color);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 
        3px 3px 6px var(--shadow-color),
        -3px -3px 6px var(--highlight-color);
    transition: all var(--transition-fast);
}

.popup-close:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

/* Privacy Note */
.privacy-note {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 16px;
    opacity: 0.8;
    line-height: 1.4;
}

.privacy-note a {
    color: var(--accent);
    text-decoration: none;
}

.privacy-note a:hover {
    text-decoration: underline;
}

/* Success State */
.popup-success {
    display: none;
    text-align: center;
}

.popup-success.show {
    display: block;
}

.success-icon {
    width: 64px;
    height: 64px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 24px;
    color: white;
    box-shadow: 
        6px 6px 12px var(--shadow-color),
        -6px -6px 12px var(--highlight-color),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-title {
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
}

.success-message {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 24px;
}

.continue-btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-medium);
    background: var(--surface-color);
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: 
        4px 4px 8px var(--shadow-color),
        -4px -4px 8px var(--highlight-color);
    transition: all var(--transition-fast);
}

.continue-btn:hover {
    transform: translateY(-1px);
    box-shadow: 
        5px 5px 10px var(--shadow-color),
        -5px -5px 10px var(--highlight-color);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .email-popup-content {
        padding: 32px 24px;
        margin: 20px;
        max-width: 90vw;
    }
    
    .popup-title {
        font-size: 24px;
    }
    
    .popup-subtitle {
        font-size: 14px;
    }
    
    .email-input,
    .subscribe-btn {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .email-popup-wall,
    .email-popup-content,
    .subscribe-btn,
    .success-icon {
        transition-duration: 0.1ms !important;
        animation-duration: 0.1ms !important;
    }
}

/* Focus management for accessibility */
.email-popup-wall.show .email-input:first-of-type {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .email-popup-content {
        border: 2px solid var(--text-primary);
    }
    
    .email-input {
        border: 1px solid var(--text-secondary);
    }
}