/* Abijita Pro Popup - Frontend Styles */

.app-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 999998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.app-popup-overlay.active {
    display: block;
    opacity: 1;
}

.app-popup {
    position: fixed;
    z-index: 999999;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.app-popup.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Position Variations */
.app-popup.center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    max-width: 90%;
    width: 600px;
    max-height: 90vh;
}

.app-popup.center.active {
    transform: translate(-50%, -50%) scale(1);
}

.app-popup.top_bar {
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 0;
    transform: translateY(-100%);
}

.app-popup.top_bar.active {
    transform: translateY(0);
}

.app-popup.bottom_bar {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 0;
    transform: translateY(100%);
}

.app-popup.bottom_bar.active {
    transform: translateY(0);
}

.app-popup.slide_in {
    bottom: 20px;
    right: 20px;
    width: 400px;
    max-width: 90vw;
    transform: translateX(120%);
}

.app-popup.slide_in.active {
    transform: translateX(0);
}

/* Close Button */
.app-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    background: #dc3232;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s ease;
}

.app-popup-close:hover {
    background: #a00;
}

.app-popup-close:before,
.app-popup-close:after {
    content: '';
    position: absolute;
    width: 16px;
    height: 2px;
    background: white;
    border-radius: 1px;
}

.app-popup-close:before {
    transform: rotate(45deg);
}

.app-popup-close:after {
    transform: rotate(-45deg);
}

/* Popup Content */
.app-popup-content {
    padding: 40px;
    overflow-y: auto;
    max-height: calc(90vh - 80px);
}

.app-popup.top_bar .app-popup-content,
.app-popup.bottom_bar .app-popup-content {
    padding: 20px 40px;
    text-align: center;
}

/* Content Types */
.app-popup-image {
    text-align: center;
}

.app-popup-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.app-popup-image a {
    display: block;
}

.app-popup-rich-text {
    font-size: 16px;
    line-height: 1.6;
}

.app-popup-rich-text h1,
.app-popup-rich-text h2,
.app-popup-rich-text h3 {
    margin-top: 0;
}

/* Lead Form */
.app-lead-form {
    max-width: 400px;
    margin: 0 auto;
}

.app-form-title {
    margin: 0 0 10px 0;
    font-size: 24px;
    color: #333;
}

.app-form-description {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 14px;
}

.app-form-group {
    margin-bottom: 20px;
}

.app-form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.app-form-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.app-form-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

.app-form-button {
    background: #007cba;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    width: 100%;
}

.app-form-button:hover {
    background: #005a87;
}

.app-form-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.app-form-success {
    text-align: center;
    padding: 20px;
    color: #46b450;
}

.app-form-error {
    color: #dc3232;
    font-size: 14px;
    margin-top: 5px;
}

/* Auto-Close Timer */
.app-auto-close-timer {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #dc3232;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    animation: pulse 1s infinite;
}

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

/* Animations */
.app-popup.fade-in {
    animation: fadeIn 0.3s ease;
}

.app-popup.slide-down {
    animation: slideDown 0.4s ease;
}

.app-popup.zoom-in {
    animation: zoomIn 0.3s ease;
}

.app-popup.bounce {
    animation: bounce 0.6s ease;
}

.app-popup.swing {
    animation: swing 0.6s ease;
    transform-origin: top center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
    60% { transform: translateY(-10px); }
}

@keyframes swing {
    20% { transform: rotate(15deg); }
    40% { transform: rotate(-10deg); }
    60% { transform: rotate(5deg); }
    80% { transform: rotate(-5deg); }
    100% { transform: rotate(0deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .app-popup.center {
        width: 95%;
        max-height: 95vh;
    }
    
    .app-popup.slide_in {
        width: 90vw;
        right: 5vw;
        bottom: 10px;
    }
    
    .app-popup-content {
        padding: 25px;
    }
    
    .app-popup.top_bar .app-popup-content,
    .app-popup.bottom_bar .app-popup-content {
        padding: 15px 20px;
    }
}

/* Loading State */
.app-popup-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.app-popup-loading:after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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