/**
 * WhatsApp Promo Popup - Modern Styles
 */

:root {
    --wpp-primary: #667eea;
    --wpp-primary-dark: #5a67d8;
    --wpp-primary-light: #a3bffa;
    --wpp-whatsapp: #25D366;
    --wpp-text: #1a202c;
    --wpp-text-muted: #718096;
    --wpp-bg: #ffffff;
    --wpp-border: #e2e8f0;
    --wpp-error: #dc2626;
    --wpp-success: #059669;
    --wpp-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --wpp-radius: 16px;
}

/* Reset */
.wpp-popup * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Popup Container */
.wpp-popup {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--wpp-text);
}

/* Center Modal */
.wpp-popup.wpp-center {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.wpp-popup.wpp-center .wpp-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.wpp-popup.wpp-center .wpp-content {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    animation: wppFadeIn 0.3s ease-out;
}

/* Slide-in Positions */
.wpp-popup.wpp-slide-bottom-right,
.wpp-popup.wpp-slide-bottom-left {
    bottom: 20px;
}

.wpp-popup.wpp-slide-bottom-right {
    right: 20px;
}

.wpp-popup.wpp-slide-bottom-left {
    left: 20px;
}

.wpp-popup.wpp-slide-bottom-right .wpp-content,
.wpp-popup.wpp-slide-bottom-left .wpp-content {
    width: 380px;
    animation: wppSlideUp 0.4s ease-out;
}

/* Content Box */
.wpp-content {
    background: var(--wpp-bg);
    border-radius: var(--wpp-radius);
    box-shadow: var(--wpp-shadow);
    padding: 32px;
    position: relative;
}

/* Close Button */
.wpp-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f7fafc;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wpp-text-muted);
    transition: all 0.2s ease;
}

.wpp-close:hover {
    background: #edf2f7;
    color: var(--wpp-text);
}

.wpp-close:focus {
    outline: 2px solid var(--wpp-primary);
    outline-offset: 2px;
}

/* Header */
.wpp-header {
    text-align: center;
    margin-bottom: 24px;
}

.wpp-whatsapp-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    border-radius: 50%;
}

.wpp-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--wpp-text);
    margin-bottom: 8px;
    line-height: 1.3;
}

.wpp-subtitle {
    font-size: 15px;
    color: var(--wpp-text-muted);
    line-height: 1.6;
}

/* Form */
.wpp-form {
    margin-top: 24px;
}

.wpp-input-group {
    margin-bottom: 20px;
}

.wpp-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--wpp-text);
    margin-bottom: 8px;
}

.wpp-label svg {
    color: var(--wpp-text-muted);
}

.wpp-phone-wrapper {
    display: flex;
    align-items: center;
    border: 2px solid var(--wpp-border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.wpp-phone-wrapper:focus-within {
    border-color: var(--wpp-primary);
    box-shadow: 0 0 0 3px var(--wpp-primary-light);
}

.wpp-country-code {
    padding: 14px 12px;
    background: #f7fafc;
    font-weight: 600;
    color: var(--wpp-text);
    border-right: 2px solid var(--wpp-border);
    font-size: 15px;
}

.wpp-phone-input {
    flex: 1;
    padding: 14px 16px;
    border: none;
    font-size: 16px;
    color: var(--wpp-text);
    background: transparent;
}

.wpp-phone-input:focus {
    outline: none;
}

.wpp-phone-input::placeholder {
    color: #a0aec0;
}

/* Error Messages */
.wpp-error {
    display: block;
    font-size: 13px;
    color: var(--wpp-error);
    margin-top: 6px;
    min-height: 18px;
}

/* Disclaimer Text */
.wpp-disclaimer {
    font-size: 11px;
    color: #9ca3af;
    line-height: 1.5;
    margin: 0 0 16px 0;
    padding: 0;
}

/* Honeypot */
.wpp-hp {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

/* Consent Checkbox */
.wpp-consent {
    margin-bottom: 20px;
}

.wpp-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
}

.wpp-checkbox-label input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.wpp-checkbox-custom {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: 2px solid var(--wpp-border);
    border-radius: 6px;
    position: relative;
    transition: all 0.2s ease;
    margin-top: 2px;
}

.wpp-checkbox-label input:checked + .wpp-checkbox-custom {
    background: var(--wpp-primary);
    border-color: var(--wpp-primary);
}

.wpp-checkbox-label input:checked + .wpp-checkbox-custom::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 7px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.wpp-checkbox-label input:focus + .wpp-checkbox-custom {
    box-shadow: 0 0 0 3px var(--wpp-primary-light);
}

.wpp-consent-text {
    color: var(--wpp-text-muted);
}

/* Submit Button */
.wpp-submit {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--wpp-primary), var(--wpp-primary-dark));
    color: white;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.wpp-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.wpp-submit:active {
    transform: translateY(0);
}

.wpp-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.wpp-spinner {
    animation: wppSpin 1s linear infinite;
}

/* Trust Elements */
.wpp-trust {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--wpp-border);
}

.wpp-trust-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--wpp-text-muted);
}

.wpp-trust-item svg {
    color: var(--wpp-success);
}

/* Success State */
.wpp-success {
    text-align: center;
    padding: 20px 0;
}

.wpp-success-icon {
    margin-bottom: 20px;
}

.wpp-success-icon svg {
    animation: wppBounce 0.5s ease;
}

.wpp-success-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--wpp-success);
    margin-bottom: 12px;
}

.wpp-success-message {
    font-size: 15px;
    color: var(--wpp-text-muted);
    margin-bottom: 24px;
    line-height: 1.6;
}

.wpp-success-close {
    padding: 14px 32px;
    background: var(--wpp-success);
    color: white;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wpp-success-close:hover {
    background: #047857;
}

/* Error State */
.wpp-error-state {
    text-align: center;
    padding: 20px 0;
}

.wpp-error-icon {
    margin-bottom: 16px;
}

.wpp-error-message {
    font-size: 15px;
    color: var(--wpp-text-muted);
    margin-bottom: 20px;
}

.wpp-retry-btn {
    padding: 12px 28px;
    background: var(--wpp-text);
    color: white;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wpp-retry-btn:hover {
    background: #2d3748;
}

/* Animations */
@keyframes wppFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes wppSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes wppSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes wppBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Mobile Styles */
@media (max-width: 480px) {
    .wpp-popup.wpp-center {
        padding: 0;
        align-items: flex-end;
    }
    
    .wpp-popup.wpp-center .wpp-content {
        max-width: 100%;
        max-height: 90vh;
        border-radius: var(--wpp-radius) var(--wpp-radius) 0 0;
        animation: wppSlideUp 0.3s ease-out;
    }
    
    .wpp-popup.wpp-slide-bottom-right,
    .wpp-popup.wpp-slide-bottom-left {
        left: 0;
        right: 0;
        bottom: 0;
    }
    
    .wpp-popup.wpp-slide-bottom-right .wpp-content,
    .wpp-popup.wpp-slide-bottom-left .wpp-content {
        width: 100%;
        border-radius: var(--wpp-radius) var(--wpp-radius) 0 0;
    }
    
    .wpp-content {
        padding: 24px 20px 32px;
    }
    
    .wpp-title {
        font-size: 20px;
    }
    
    .wpp-trust {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .wpp-popup * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark Mode Support (optional) */
@media (prefers-color-scheme: dark) {
    /* Could add dark mode styles here */
}
