/* Popup System CSS */

/* Base popup styles */
.ao-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.55, 0.02, 0.1, 0.9);
}

.ao-popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Fullscreen popup for homepage */
.ao-popup-fullscreen {
    background-color: var(--bg-color);
    width: 90%;
    max-width: 800px;
    padding: 60px 40px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    position: relative;
    transform: scale(0.8) translateY(50px);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ao-popup-overlay.show .ao-popup-fullscreen {
    transform: scale(1) translateY(0);
}

/* Bottom popup for other pages */
.ao-popup-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    min-height: 300px;
    max-height: 60vh;
    background-color: var(--bg-color);
    border-top: 2px solid var(--theme-color);
    padding: 25px 30px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.55, 0.02, 0.1, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

.ao-popup-bottom.show {
    transform: translateY(0);
}

/* Popup content */
.ao-popup-content {
    color: var(--font-color);
    font-family: var(--body-font);
    line-height: var(--line-height-content);
    text-align: center;
}

.ao-popup-content h3 {
    color: var(--heading-color);
    font-family: var(--heading-font);
    font-size: var(--font-size-h3);
    font-weight: var(--font-weight-heading);
    margin-bottom: 30px;
    text-align: center;
}

.ao-popup-content p {
    margin-bottom: 20px;
    font-size: 16px;
    opacity: 0.9;
    white-space: pre-line;
}

/* Bottom popup content layout */
.ao-popup-bottom .ao-popup-content {
    flex: 1;
    text-align: left;
    padding-right: 20px;
    margin-bottom: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.ao-popup-bottom .ao-popup-content p {
    padding-left: 5%;
    padding-right: 5%;
    font-size: 15px;
    margin-bottom: 15px;
    line-height: 1.5;
    white-space: pre-line;
    overflow: visible;
}

/* Button container */
.ao-popup-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 40px;
    flex-wrap: wrap;
}

.ao-popup-bottom .ao-popup-buttons {
    margin-top: 10px;
    flex-shrink: 0;
    gap: 15px;
    align-self: center;
}

/* Popup buttons using website's button style */
.ao-popup-btn {
    position: relative;
    padding: 15px 25px;
    font-size: 12px;
    line-height: 16px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--heading-color);
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: var(--heading-font);
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    min-width: 140px;
}

.ao-popup-btn:hover {
    color: var(--heading-color);
    text-decoration: none;
}

/* Button border effect (similar to dsn-border) */
.ao-popup-btn:before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    clip-path: polygon(0% 0%, 0% 100%, 44% 100%, 35% 0, 47% 0, 60% 100%, 100% 100%, 100% 0%);
    transition: clip-path 0.5s;
    z-index: 1;
}

.ao-popup-btn:hover:before {
    clip-path: polygon(0% 0%, 0% 100%, 94% 100%, 0 0, 5% 0, 100% 100%, 100% 100%, 100% 0%);
}

/* Primary button (Wish luck) */
.ao-popup-btn.primary:before {
    background: rgba(var(--theme-color-rgb, 47, 131, 255), 0.07);
}

.ao-popup-btn.primary {
    color: #fff;
}

/* Close button */
.ao-popup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--heading-color);
    font-size: 24px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.ao-popup-close:hover {
    opacity: 1;
}

.ao-popup-close:before,
.ao-popup-close:after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background-color: var(--heading-color);
    transition: all 0.3s ease;
}

.ao-popup-close:before {
    transform: rotate(45deg);
}

.ao-popup-close:after {
    transform: rotate(-45deg);
}

.ao-popup-close:hover:before,
.ao-popup-close:hover:after {
    background-color: var(--theme-color);
}

/* Bottom popup close button */
.ao-popup-bottom .ao-popup-close {
    position: relative;
    top: auto;
    right: auto;
    width: 30px;
    height: 30px;
    margin-left: 15px;
}

.ao-popup-bottom .ao-popup-close:before,
.ao-popup-bottom .ao-popup-close:after {
    width: 16px;
}

/* Heart symbol for text */
.ao-popup-heart {
    color: var(--theme-color);
    font-size: 1.2em;
    display: inline-block;
    animation: heartbeat 2s ease-in-out infinite;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Responsive design */
@media (max-width: 768px) {
    .ao-popup-fullscreen {
        width: 95%;
        padding: 40px 30px;
        margin: 20px;
    }
    
    .ao-popup-content h3 {
        font-size: 24px;
    }
    
    .ao-popup-content p {
        font-size: 15px;
    }
    
    .ao-popup-buttons {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .ao-popup-btn {
        width: 100%;
        max-width: 200px;
        padding: 12px 20px;
    }
      .ao-popup-bottom {
        max-height: 70vh;
        padding: 20px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ao-popup-bottom .ao-popup-content {
        padding-right: 0;
        margin-bottom: 15px;
        width: 100%;
    }
    
    .ao-popup-bottom .ao-popup-content p {
        font-size: 13px;
        padding-left: 2%;
        padding-right: 2%;
    }
    
    .ao-popup-bottom .ao-popup-buttons {
        align-self: flex-end;
        margin-top: 5px;
    }
    
    .ao-popup-bottom .ao-popup-btn {
        padding: 8px 15px;
        font-size: 11px;
        min-width: 100px;
    }
}

@media (max-width: 480px) {
    .ao-popup-fullscreen {
        width: 98%;
        padding: 30px 20px;
        margin: 10px;
    }
    
    .ao-popup-content h3 {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .ao-popup-content p {
        font-size: 14px;
    }
      .ao-popup-bottom {
        padding: 15px;
        max-height: 80vh;
    }
    
    .ao-popup-bottom .ao-popup-content p {
        font-size: 12px;
        padding: 0;
    }
}

/* Animation classes for enhanced effects */
.ao-popup-content.animate {
    animation: slideInUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading state for wish luck button */
.ao-popup-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.ao-popup-btn.loading:after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
