/* CS Newsletter Frontend Styles */

/* Newsletter Button */
.cs-newsletter-button {
    position: fixed;
    z-index: 9997;
    transition: all 0.3s ease-in-out;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.cs-newsletter-button.cs-newsletter-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.cs-newsletter-button button {
    border: none;
    background-color: var(--cs-current-area-color);
    font-size: 14px;
    border-radius: 0;
    padding: 0;
    width: 150px;
    height: 40px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.cs-newsletter-button button:hover {
    background: var(--cs-current-area-color);
    transform: translateY(-2px);
}

/* Button Positions */
.cs-newsletter-button-bottom-right {
    bottom: 30px;
    right: 30px;
}

.cs-newsletter-button-bottom-left {
    bottom: 30px;
    left: 30px;
}

.cs-newsletter-button-top-right {
    top: 100px;
    right: 30px;
}

.cs-newsletter-button-top-left {
    top: 100px;
    left: 30px;
}

/* Newsletter Popup */
.cs-newsletter-popup {
    position: fixed;
    z-index: 999999;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    background: white;
    border-radius: 0px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: scale(1) translateY(0);
}

.cs-newsletter-popup.cs-newsletter-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(0.8) translateY(20px);
}

/* Popup Positions */
.cs-newsletter-position-bottom-right {
    bottom: 30px;
    right: 30px;
}

.cs-newsletter-position-bottom-left {
    bottom: 30px;
    left: 30px;
}

.cs-newsletter-position-top-right {
    top: 100px;
    right: 30px;
}

.cs-newsletter-position-top-left {
    top: 100px;
    left: 30px;
}

/* Popup Content */
.cs-newsletter-popup-content {
    position: relative;
    padding: 0;
    background: white;
    border-radius: 0px;
    overflow: hidden;
}

.cs-newsletter-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: bold;
    padding: 0;
}

.cs-newsletter-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: rotate(90deg);
}

.cs-newsletter-close-text {
    display: none;
}

.cs-newsletter-close-icon {
    line-height: 1;
}

.cs-newsletter-content {
    padding: 0;
    min-height: 200px;
}

/* Make sure Elementor content fits properly */
.cs-newsletter-content .elementor {
    width: 100% !important;
}

.cs-newsletter-content .elementor-container {
    max-width: 100% !important;
    margin: 0 !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cs-newsletter-popup {
        max-width: calc(100vw - 40px);
        max-height: calc(100vh - 100px);
        left: 20px !important;
        right: 20px !important;
        bottom: 20px !important;
        top: auto !important;
        margin: 0;
    }
    
    .cs-newsletter-button {
        bottom: 20px !important;
        right: 20px !important;
        left: auto !important;
        top: auto !important;
    }
    
    .cs-newsletter-button button {
        padding: 10px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .cs-newsletter-popup {
        max-width: calc(100vw - 20px);
        left: 10px !important;
        right: 10px !important;
        bottom: 10px !important;
    }
    
    .cs-newsletter-button {
        bottom: 10px !important;
        right: 10px !important;
    }
    
    .cs-newsletter-close {
        top: 10px;
        right: 10px;
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
}

/* Animation for popup entrance */
@keyframes cs-newsletter-bounce-in {
    0% {
        opacity: 0;
        transform: translateY(100px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.cs-newsletter-popup.cs-newsletter-animate-in {
    animation: cs-newsletter-bounce-in 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@supports (-webkit-appearance: none) {
    .cs-newsletter-popup.cs-newsletter-animate-in {
        animation: cs-newsletter-bounce-in 0.3s ease-out;
    }
}

/* Animation for button entrance */
@keyframes cs-newsletter-slide-in {
    0% {
        opacity: 0;
        transform: translateY(100px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.cs-newsletter-button.cs-newsletter-animate-in {
    animation: cs-newsletter-slide-in 0.5s ease-out;
}

/* Overlay for mobile when popup is open */
.cs-newsletter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cs-newsletter-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Scrollbar styling for popup */
.cs-newsletter-popup::-webkit-scrollbar {
    width: 6px;
}

.cs-newsletter-popup::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.cs-newsletter-popup::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.cs-newsletter-popup::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}