/**
 * Error and Success Popup Modal Styles
 */

/* Error Popup Modal */
.error-popup-modal,
.success-popup-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999999;
    display: none;
    animation: fadeIn 0.3s ease;
}

.error-popup-modal.show,
.success-popup-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Backdrop */
.error-popup-backdrop,
.success-popup-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    cursor: pointer;
}

/* Content Container */
.error-popup-content,
.success-popup-content {
    position: relative;
    background: linear-gradient(135deg, #1e1e2e 0%, #2a2a3e 100%);
    border-radius: 20px;
    max-width: 420px;
    width: 90%;
    max-height: 90vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s ease;
    overflow: hidden;
    margin: 20px;
}

/* Header */
.error-popup-header,
.success-popup-header {
    position: relative;
    padding: 20px;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Icon Wrapper */
.error-icon-wrapper {
    width: 60px;
    height: 60px;
    margin: 0 auto;
    background: linear-gradient(135deg, #ff4757, #ff6b81);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(255, 71, 87, 0.3);
}

.success-icon-wrapper {
    width: 60px;
    height: 60px;
    margin: 0 auto;
    background: linear-gradient(135deg, #00d2d3, #54a0ff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(84, 160, 255, 0.3);
}

.error-icon-wrapper i,
.success-icon-wrapper i {
    font-size: 30px;
    color: white;
}

/* Close Button */
.error-popup-close,
.success-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.error-popup-close:hover,
.success-popup-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: rotate(90deg);
}

/* Body */
.error-popup-body,
.success-popup-body {
    padding: 25px;
    text-align: center;
    max-height: 50vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom scrollbar for popup body */
.error-popup-body::-webkit-scrollbar,
.success-popup-body::-webkit-scrollbar {
    width: 6px;
}

.error-popup-body::-webkit-scrollbar-track,
.success-popup-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.error-popup-body::-webkit-scrollbar-thumb,
.success-popup-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.error-popup-body::-webkit-scrollbar-thumb:hover,
.success-popup-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.error-popup-title,
.success-popup-title {
    color: white;
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 15px 0;
    word-wrap: break-word;
    word-break: break-word;
}

.error-popup-message,
.success-popup-message {
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
    word-wrap: break-word;
    word-break: break-word;
    white-space: pre-wrap;
}

/* Footer */
.error-popup-footer,
.success-popup-footer {
    padding: 20px;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.error-popup-btn {
    background: linear-gradient(135deg, #ff4757, #ff6b81);
    color: white;
    border: none;
    padding: 12px 40px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.3);
}

.success-popup-btn {
    background: linear-gradient(135deg, #00d2d3, #54a0ff);
    color: white;
    border: none;
    padding: 12px 40px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(84, 160, 255, 0.3);
}

.error-popup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 71, 87, 0.4);
}

.success-popup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(84, 160, 255, 0.4);
}

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

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

/* Mobile Responsive */
@media (max-width: 480px) {
    .error-popup-modal,
    .success-popup-modal {
        padding: 10px;
    }

    .error-popup-content,
    .success-popup-content {
        width: calc(100% - 20px);
        margin: 10px;
        border-radius: 15px;
        max-height: 80vh;
    }

    .error-popup-header,
    .success-popup-header {
        padding: 15px;
    }

    .error-popup-body,
    .success-popup-body {
        padding: 15px 20px;
        max-height: 40vh;
    }

    .error-icon-wrapper,
    .success-icon-wrapper {
        width: 45px;
        height: 45px;
    }

    .error-icon-wrapper i,
    .success-icon-wrapper i {
        font-size: 22px;
    }

    .error-popup-title,
    .success-popup-title {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .error-popup-message,
    .success-popup-message {
        font-size: 14px;
        line-height: 1.5;
        padding: 0 5px;
    }

    .error-popup-footer,
    .success-popup-footer {
        padding: 15px;
    }

    .error-popup-btn,
    .success-popup-btn {
        padding: 10px 30px;
        font-size: 14px;
        width: 100%;
        max-width: 200px;
    }

    .error-popup-close,
    .success-popup-close {
        width: 28px;
        height: 28px;
        font-size: 18px;
        top: 10px;
        right: 10px;
    }
}

/* Small mobile devices */
@media (max-width: 360px) {
    .error-popup-content,
    .success-popup-content {
        width: calc(100% - 16px);
        margin: 8px;
    }

    .error-popup-body,
    .success-popup-body {
        padding: 12px 15px;
    }

    .error-popup-message,
    .success-popup-message {
        font-size: 13px;
    }

    .error-popup-title,
    .success-popup-title {
        font-size: 16px;
    }
}

/* Ensure popups appear above everything */
.error-popup-modal {
    z-index: 10000000 !important;
}

.success-popup-modal {
    z-index: 10000000 !important;
}

/* Prevent body scroll when popup is open */
body.popup-open {
    overflow: hidden !important;
}