/* Popup System Styles */

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes closeButtonHover {
    0% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.1) rotate(180deg);
    }
    100% {
        transform: scale(1) rotate(360deg);
    }
}

.modal-enter {
    animation: slideUp 0.5s ease-out forwards;
}

.backdrop-enter {
    animation: fadeIn 0.3s ease-out forwards;
}

.pulse-animation {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.rotate-animation {
    animation: rotate 2s linear infinite;
}

.gradient-border {
    background: linear-gradient(135deg, #10b981, #34d399, #10b981);
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
}

/* Close Button Styles */
.close-button {
    transition: all 0.3s ease;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.close-button:hover {
    animation: closeButtonHover 0.6s ease-in-out;
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.close-button:active {
    transform: scale(0.95);
}

/* Backdrop Blur Fix */
#popupBackdrop {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(0, 0, 0, 0.3);
}

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #10b981;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Position Classes */
.popup-position-center {
    /* Default center position */
}

.popup-position-top-left {
    align-items: flex-start;
    justify-content: flex-start;
    padding: 2rem;
}

.popup-position-top-right {
    align-items: flex-start;
    justify-content: flex-end;
    padding: 2rem;
}

.popup-position-bottom-left {
    align-items: flex-end;
    justify-content: flex-start;
    padding: 2rem;
}

.popup-position-bottom-right {
    align-items: flex-end;
    justify-content: flex-end;
    padding: 2rem;
}

/* Size Classes */
.popup-size-small {
    max-width: 400px;
}

.popup-size-medium {
    max-width: 500px;
}

.popup-size-large {
    max-width: 700px;
}

.popup-size-fullscreen {
    max-width: 90vw;
    max-height: 90vh;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #popupContent {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    .popup-position-top-left,
    .popup-position-top-right,
    .popup-position-bottom-left,
    .popup-position-bottom-right {
        align-items: center;
        justify-content: center;
        padding: 1rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .modal-enter,
    .backdrop-enter,
    .pulse-animation,
    .rotate-animation,
    .gradient-border,
    .spinner,
    .close-button:hover {
        animation: none;
    }
}

/* Focus Styles */
button:focus {
    outline: 2px solid #10b981;
    outline-offset: 2px;
}

/* Button Cursor Styles */
button {
    cursor: pointer;
}

/* Toast Styles */
#successToast {
    cursor: pointer;
    z-index: 10000;
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    background: #10b981;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 400px;
}

#successToast.show {
    transform: translateY(0);
}
