/**
 * CloudHost Pro - Popup System Styles
 * Modern, responsive popup styling
 */

/* Overlay */
.chp-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.chp-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Container */
.chp-popup-container {
    background: #1e3a8a;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 40px;
    max-width: 90%;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.chp-popup-overlay.active .chp-popup-container {
    transform: scale(1);
}

/* Sizes */
.chp-popup-small {
    width: 400px;
}

.chp-popup-medium {
    width: 600px;
}

.chp-popup-large {
    width: 800px;
}

.chp-popup-fullscreen {
    width: 95%;
    height: 95%;
    max-width: 1200px;
}

/* Positions */
.chp-popup-center {
    /* Default - centered */
}

.chp-popup-top-center {
    align-self: flex-start;
    margin-top: 40px;
}

.chp-popup-bottom-center {
    align-self: flex-end;
    margin-bottom: 40px;
}

.chp-popup-bottom-right {
    position: fixed;
    bottom: 20px;
    right: 20px;
    top: auto;
    left: auto;
}

.chp-popup-bottom-left {
    position: fixed;
    bottom: 20px;
    left: 20px;
    top: auto;
    right: auto;
}

/* Animations */
.chp-popup-animation-fade .chp-popup-container {
    animation: fadeIn 0.4s ease;
}

.chp-popup-animation-slide .chp-popup-container {
    animation: slideUp 0.4s ease;
}

.chp-popup-animation-bounce .chp-popup-container {
    animation: bounceIn 0.6s ease;
}

.chp-popup-animation-zoom .chp-popup-container {
    animation: zoomIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes zoomIn {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Close Button */
.chp-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s ease;
    z-index: 10;
}

.chp-popup-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Image */
.chp-popup-image {
    margin: -40px -40px 24px -40px;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
}

.chp-popup-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Title */
.chp-popup-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: inherit;
    line-height: 1.3;
}

/* Description */
.chp-popup-description {
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 24px 0;
    opacity: 0.95;
}

/* Form */
.chp-popup-form {
    margin-top: 24px;
}

.chp-form-field {
    margin-bottom: 20px;
}

.chp-form-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: inherit;
    opacity: 0.95;
}

.chp-form-field input,
.chp-form-field textarea,
.chp-form-field select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transition: all 0.2s ease;
}

.chp-form-field input::placeholder,
.chp-form-field textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.chp-form-field input:focus,
.chp-form-field textarea:focus,
.chp-form-field select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
}

.chp-form-field textarea {
    resize: vertical;
    min-height: 100px;
}

/* Button */
.chp-popup-button {
    display: inline-block;
    width: 100%;
    padding: 16px 32px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    margin-top: 8px;
}

.chp-popup-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.chp-popup-button:active {
    transform: translateY(0);
}

.chp-popup-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Coupon Code */
.chp-coupon-code {
    margin-top: 24px;
    text-align: center;
}

.chp-coupon-display {
    background: rgba(255, 255, 255, 0.15);
    border: 2px dashed rgba(255, 255, 255, 0.4);
    padding: 20px;
    border-radius: 8px;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 4px;
    margin-bottom: 16px;
    font-family: 'Courier New', monospace;
}

/* Form Messages */
.chp-form-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

.chp-form-success {
    background: rgba(34, 197, 94, 0.2);
    border: 2px solid rgba(34, 197, 94, 0.4);
    color: #86efac;
}

.chp-form-error {
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

/* Responsive */
@media (max-width: 768px) {
    .chp-popup-container {
        padding: 24px;
        max-width: 95%;
    }
    
    .chp-popup-small,
    .chp-popup-medium,
    .chp-popup-large {
        width: 100%;
    }
    
    .chp-popup-title {
        font-size: 24px;
    }
    
    .chp-popup-description {
        font-size: 14px;
    }
    
    .chp-popup-image {
        margin: -24px -24px 16px -24px;
    }
    
    .chp-popup-bottom-right,
    .chp-popup-bottom-left {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
    }
    
    .chp-coupon-display {
        font-size: 24px;
        letter-spacing: 2px;
    }
}

/* Scrollbar for popup container */
.chp-popup-container::-webkit-scrollbar {
    width: 8px;
}

.chp-popup-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.chp-popup-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.chp-popup-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Dark Mode Support (if needed) */
@media (prefers-color-scheme: dark) {
    /* Styles are already dark-themed */
}

/* Accessibility */
.chp-popup-overlay:focus-within {
    outline: 2px solid rgba(59, 130, 246, 0.5);
    outline-offset: 4px;
}

.chp-popup-button:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.chp-form-field input:focus,
.chp-form-field textarea:focus,
.chp-form-field select:focus {
    outline: 2px solid rgba(255, 255, 255, 0.3);
    outline-offset: -2px;
}
