/* Custom Popup Styles */
.custom-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.custom-popup-overlay.custom-popup-show {
    opacity: 1;
}

.custom-popup-container {
    background: white;
    border-radius: 12px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(-20px);
    transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
}

.custom-popup-overlay.custom-popup-show .custom-popup-container {
    transform: scale(1) translateY(0);
}

.custom-popup-content {
    padding: 28px 32px;
    display: flex;
    align-items: center;
    gap: 18px;
    position: relative;
}

.custom-popup-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.custom-popup-text {
    flex: 1;
    min-width: 0;
    padding-right: 24px;
}

.custom-popup-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
    display: none;
}

.custom-popup-message {
    font-size: 0.95rem;
    line-height: 1.55;
    color: #475569;
    font-weight: 400;
}

.custom-popup-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.custom-popup-close:hover {
    background: #f1f5f9;
    color: #1e293b;
}

/* Type-specific styles */
.custom-popup-success {
    border-top: 4px solid #10b981;
}

.custom-popup-success .custom-popup-icon {
    color: #10b981;
}

.custom-popup-error {
    border-top: 4px solid #ef4444;
}

.custom-popup-error .custom-popup-icon {
    color: #ef4444;
}

.custom-popup-warning {
    border-top: 4px solid #f59e0b;
}

.custom-popup-warning .custom-popup-icon {
    color: #f59e0b;
}

.custom-popup-info {
    border-top: 4px solid #3b82f6;
}

.custom-popup-info .custom-popup-icon {
    color: #3b82f6;
}

/* Mobile responsive */
@media (max-width: 640px) {
    .custom-popup-container {
        width: 95%;
        margin: 20px;
    }

    .custom-popup-content {
        padding: 20px 20px;
    }

    .custom-popup-icon {
        font-size: 26px;
    }

    .custom-popup-title {
        font-size: 1rem;
    }

    .custom-popup-message {
        font-size: 0.9rem;
    }
}

/* Animation for multiple popups */
@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Cheating Modal Styles */
.cheating-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    backdrop-filter: blur(4px);
}

.cheating-modal-overlay.active {
    display: flex;
}

.cheating-modal-content {
    background: white;
    border-radius: 12px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    animation: cheatingModalSlideIn 0.3s ease;
}

@keyframes cheatingModalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.cheating-modal-header {
    padding: 24px 32px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.cheating-modal-header i {
    font-size: 28px;
}

.cheating-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.cheating-modal-body {
    padding: 24px 32px;
    color: #1f2937;
    line-height: 1.6;
}

.cheating-modal-body p {
    margin: 0 0 12px 0;
}

.cheating-modal-body p:last-child {
    margin-bottom: 0;
}

.cheating-modal-footer {
    padding: 20px 32px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.cheating-modal-footer.teacher-footer {
    justify-content: space-between;
}

.cheating-modal-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b7280;
    font-size: 0.9rem;
}

.cheating-modal-footer .btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.cheating-modal-footer .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cheating-modal-footer .btn-danger {
    background: #ef4444;
    color: white;
}

.cheating-modal-footer .btn-danger:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-1px);
}

.cheating-modal-footer .btn-primary {
    background: #3b82f6;
    color: white;
}

.cheating-modal-footer .btn-primary:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-1px);
}

.cheating-modal-footer .btn .btn-text {
    display: inline;
}

.cheating-modal-footer .btn .btn-loading {
    display: none;
    align-items: center;
    gap: 8px;
}

.cheating-modal-footer .btn[data-loading="true"] .btn-text {
    display: none;
}

.cheating-modal-footer .btn[data-loading="true"] .btn-loading {
    display: inline-flex;
}

.cheating-modal-content.teacher-modal .cheating-modal-header {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* Mobile responsive */
@media (max-width: 640px) {
    .cheating-modal-content {
        width: 95%;
        margin: 20px;
    }

    .cheating-modal-header,
    .cheating-modal-body,
    .cheating-modal-footer {
        padding: 20px 24px;
    }

    .cheating-modal-header h2 {
        font-size: 1.25rem;
    }

    .cheating-modal-footer {
        flex-direction: column;
    }

    .cheating-modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
}

