/**
 * Popup Subscription Styles
 * 
 * @package CPBTheme
 */

/* Overlay */
.cpb-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cpb-popup-overlay.cpb-popup-visible {
    opacity: 1;
}

/* Container */
.cpb-popup-container {
    background: #fff;
    border-radius: 20px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.cpb-popup-overlay.cpb-popup-visible .cpb-popup-container {
    transform: scale(1);
}

/* Close Button */
.cpb-popup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cpb-popup-close:hover {
    background: #fff;
    transform: rotate(90deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Content Layout */
.cpb-popup-content {
    display: grid;
    grid-template-columns: 45% 55%;
    min-height: 500px;
}

/* Image Side */
.cpb-popup-image {
    background-size: cover;
    background-position: center;
    position: relative;
    min-height: 500px;
}

.cpb-popup-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(92, 184, 92, 0.6), rgba(34, 197, 94, 0.7));
}

/* Form Side */
.cpb-popup-form-wrapper {
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cpb-popup-header {
    margin-bottom: 30px;
}

.cpb-popup-heading {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.cpb-popup-description {
    font-size: 15px;
    color: #666;
    margin: 0;
    line-height: 1.6;
}

/* Form Fields */
.cpb-popup-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cpb-popup-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cpb-popup-label {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cpb-popup-input {
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: #fff;
}

.cpb-popup-input:focus {
    outline: none;
    border-color: var(--color-primary, #5cb85c);
    box-shadow: 0 0 0 3px rgba(92, 184, 92, 0.1);
}

.cpb-popup-input::placeholder {
    color: #999;
}

/* Consent Checkbox */
.cpb-popup-consent {
    margin-top: 8px;
}

.cpb-popup-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    line-height: 1.5;
}

.cpb-popup-checkbox-label input[type="checkbox"] {
    margin-top: 2px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

/* Submit Button */
.cpb-popup-submit {
    padding: 16px 24px;
    background: var(--color-primary, #5cb85c);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.cpb-popup-submit:hover {
    background: var(--color-primary-hover, #4cae4c);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(92, 184, 92, 0.3);
}

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

.cpb-popup-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Spinner Animation */
@keyframes cpb-spin {
    to {
        transform: rotate(360deg);
    }
}

.cpb-spinner {
    animation: cpb-spin 0.8s linear infinite;
    transform-origin: center;
}

/* Message */
.cpb-popup-message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    margin-top: 16px;
}

.cpb-popup-message.cpb-error {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.cpb-popup-message.cpb-success {
    background: #efe;
    color: #3c3;
    border: 1px solid #cfc;
}

/* Success State */
.cpb-popup-success {
    text-align: center;
    padding: 40px 20px;
}

.cpb-popup-success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--color-primary, #5cb85c);
    color: #fff;
    font-size: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    animation: cpb-success-pop 0.5s ease;
}

@keyframes cpb-success-pop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.cpb-popup-success-title {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 12px 0;
}

.cpb-popup-success-text {
    font-size: 15px;
    color: #666;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cpb-popup-content {
        grid-template-columns: 1fr;
    }
    
    .cpb-popup-image {
        display: none;
    }
    
    .cpb-popup-form-wrapper {
        padding: 40px 30px;
    }
    
    .cpb-popup-heading {
        font-size: 24px;
    }
    
    .cpb-popup-close {
        top: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .cpb-popup-overlay {
        padding: 10px;
    }
    
    .cpb-popup-container {
        border-radius: 12px;
    }
    
    .cpb-popup-form-wrapper {
        padding: 30px 20px;
    }
    
    .cpb-popup-heading {
        font-size: 20px;
    }
    
    .cpb-popup-description {
        font-size: 14px;
    }
}
