/* WordPress Discount Popup Styles */

/* Popup Overlay */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    backdrop-filter: blur(3px);
}

/* Popup Container */
.popup-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #DCD6C2 0%, #E8E2CF 100%);
    border-radius: 20px;
    padding: 0;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 90%;
    overflow: hidden;
    animation: popupSlideIn 0.4s ease-out;
    border: 2px solid #C9A17A;
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Close Button */
.popup-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(201, 161, 122, 0.2);
    border: 1px solid #C9A17A;
    color: #C9A17A;
    font-size: 24px;
    cursor: pointer;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.popup-close:hover {
    background: rgba(201, 161, 122, 0.3);
    transform: rotate(90deg);
    color: #A6845F;
}

/* Popup Content */
.popup-content {
    padding: 40px 35px 35px;
    text-align: center;
    color: #C9A17A;
}

.popup-title {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    color: #A6845F;
}

.popup-subtitle {
    font-size: 16px;
    margin-bottom: 25px;
    opacity: 0.9;
    color: #C9A17A;
}

.discount-badge {
    background: linear-gradient(45deg, #C9A17A, #B39660);
    color: #FFFFFF;
    font-size: 48px;
    font-weight: bold;
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: pulse 2s infinite;
    border: 2px solid #A6845F;
}

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

/* Form Styles */
.popup-form {
    margin-top: 25px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #A6845F;
}

.form-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #C9A17A;
    border-radius: 10px;
    font-size: 16px;
    background: #FFFFFF;
    color: #A6845F;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-input::placeholder {
    color: rgba(201, 161, 122, 0.6);
}

.form-input:focus {
    outline: none;
    background: #FFFFFF;
    border-color: #A6845F;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(201, 161, 122, 0.3);
}

.submit-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(45deg, #C9A17A, #B39660);
    color: #FFFFFF;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(201, 161, 122, 0.3);
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(201, 161, 122, 0.4);
    background: linear-gradient(45deg, #B39660, #A6845F);
}

.submit-btn:active {
    transform: translateY(-1px);
}

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

/* Loading State */
.submit-btn.loading {
    position: relative;
    color: transparent;
}

.submit-btn.loading:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success Message */
.success-message {
    display: none;
    text-align: center;
    padding: 20px;
}

.success-message h3 {
    color: #A6845F;
    margin-bottom: 15px;
    font-size: 24px;
}

.discount-code {
    background: rgba(201, 161, 122, 0.1);
    padding: 15px;
    border-radius: 10px;
    font-family: monospace;
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 2px;
    margin: 15px 0;
    border: 2px dashed #C9A17A;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #A6845F;
}

.discount-code:hover {
    background: rgba(201, 161, 122, 0.2);
    transform: scale(1.02);
    border-color: #A6845F;
}

.discount-code.copied:after {
    content: 'Copied!';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #A6845F;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-family: Arial, sans-serif;
    letter-spacing: normal;
    animation: fadeInOut 2s ease-in-out;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; transform: translateX(-50%) translateY(10px); }
    50% { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Error Message */
.error-message {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #dc3545;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    display: none;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .popup-container {
        width: 95%;
        margin: 20px;
    }
    
    .popup-content {
        padding: 30px 25px 25px;
    }
    
    .popup-title {
        font-size: 24px;
    }
    
    .discount-badge {
        font-size: 36px;
        padding: 15px;
    }
    
    .form-input {
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .submit-btn {
        padding: 15px;
        font-size: 16px;
    }
}

/* Tablet Responsive */
@media (max-width: 768px) and (min-width: 481px) {
    .popup-container {
        width: 80%;
    }
    
    .popup-content {
        padding: 35px 30px 30px;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .popup-container {
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    }
}

/* Accessibility */
.popup-overlay:focus-within .popup-container {
    outline: 2px solid #C9A17A;
    outline-offset: 2px;
}

.form-input:focus {
    box-shadow: 0 0 0 2px rgba(201, 161, 122, 0.3), 0 8px 25px rgba(201, 161, 122, 0.3);
}

.submit-btn:focus {
    outline: 2px solid rgba(201, 161, 122, 0.5);
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .popup-container {
        animation: none;
    }
    
    .discount-badge {
        animation: none;
    }
    
    .submit-btn.loading:after {
        animation: none;
    }
    
    .form-input {
        transition: none;
    }
    
    .submit-btn {
        transition: none;
    }
}

/* Print Styles */
@media print {
    .popup-overlay {
        display: none !important;
    }
}

/* Additional Styling for Brand Consistency */
.popup-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #C9A17A, #B39660, #A6845F);
    border-radius: 20px 20px 0 0;
}

/* Custom scrollbar for webkit browsers */
.popup-content::-webkit-scrollbar {
    width: 8px;
}

.popup-content::-webkit-scrollbar-track {
    background: #DCD6C2;
    border-radius: 4px;
}

.popup-content::-webkit-scrollbar-thumb {
    background: #C9A17A;
    border-radius: 4px;
}

.popup-content::-webkit-scrollbar-thumb:hover {
    background: #A6845F;
}