/**
 * Education Signup Popup - Frontend Styles
 * Popup styling and animations
 */

/* Overlay */
.esp-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.esp-popup-overlay.esp-show {
    display: flex;
    opacity: 1;
}

/* Position Classes */
.esp-position-center {
    justify-content: center;
    align-items: center;
}

.esp-position-top {
    justify-content: center;
    align-items: flex-start;
    padding-top: 50px;
}

.esp-position-bottom {
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 50px;
}

.esp-position-bottom-right {
    justify-content: flex-end;
    align-items: flex-end;
    padding: 20px;
}

.esp-position-bottom-left {
    justify-content: flex-start;
    align-items: flex-end;
    padding: 20px;
}

/* Popup Container */
.esp-popup-container {
    position: relative;
    width: 90%;
    padding: 40px 30px 30px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.7);
    opacity: 0;
    transition: all 0.3s ease;
}

/* Close Button */
.esp-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease, transform 0.2s ease;
    opacity: 0.7;
}

.esp-close-btn:hover {
    opacity: 1;
    transform: rotate(90deg);
}

/* Content */
.esp-popup-content {
    text-align: center;
}

.esp-popup-text {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 25px;
}

/* Buttons */
.esp-popup-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.esp-btn {
    width: 100%;
    max-width: 400px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    line-height: 1.4;
    outline: none !important;
}

.esp-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.esp-btn:active {
    transform: translateY(0);
}

.esp-btn:focus,
.esp-btn:hover {
    outline: none !important;
}

.esp-btn-signup {
    font-weight: 700;
}

.esp-btn-dismiss {
    font-weight: 500;
}

/* Animation Classes */
.esp-animate-fade {
    animation: espFadeIn 0.4s ease forwards;
}

.esp-animate-slide-up {
    animation: espSlideUp 0.4s ease forwards;
}

.esp-animate-slide-down {
    animation: espSlideDown 0.4s ease forwards;
}

.esp-animate-scale {
    animation: espScale 0.4s ease forwards;
}

/* Keyframe Animations */
@keyframes espFadeIn {
    from {
        opacity: 0;
        transform: scale(1);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes espSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes espScale {
    from {
        opacity: 0;
        transform: scale(0.7);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .esp-popup-container {
        width: 95%;
        padding: 35px 20px 25px;
    }
    
    .esp-popup-text {
        font-size: 16px;
    }
    
    .esp-btn {
        font-size: 15px;
        padding: 12px 20px;
    }
    
    .esp-close-btn {
        font-size: 28px;
        top: 10px;
        right: 10px;
    }
    
    /* Adjust positioning for mobile */
    .esp-position-bottom-right,
    .esp-position-bottom-left {
        padding: 15px;
    }
    
    .esp-position-top {
        padding-top: 30px;
    }
    
    .esp-position-bottom {
        padding-bottom: 30px;
    }
}

@media (max-width: 480px) {
    .esp-popup-text {
        font-size: 15px;
        margin-bottom: 20px;
    }
    
    .esp-btn {
        font-size: 14px;
        padding: 11px 18px;
    }
    
    .esp-popup-buttons {
        gap: 10px;
    }
}

/* Accessibility */
.esp-btn:focus,
.esp-close-btn:focus {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

/* Prevent text selection on buttons */
.esp-btn,
.esp-close-btn {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .esp-popup-container {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .esp-popup-overlay,
    .esp-popup-container,
    .esp-btn,
    .esp-close-btn {
        transition: none;
        animation: none;
    }
    
    .esp-animate-fade,
    .esp-animate-slide-up,
    .esp-animate-slide-down,
    .esp-animate-scale {
        animation: none;
        opacity: 1;
        transform: none;
    }
}
