/* === CUSTOM POPUP SYSTEM === */

/* Popup Overlay */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1rem;
}

.popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Popup Container */
.popup-container {
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #E5E7EB;
    position: relative;
}

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

/* Popup Header */
.popup-header {
    padding: 1.5rem 2rem 1rem 2rem;
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.popup-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1E3A8A;
    margin: 0;
    line-height: 1.3;
}

.popup-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6B7280;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    transition: all 0.2s;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 1rem;
}

.popup-close:hover {
    background-color: #F3F4F6;
    color: var(--color-primary);
}

/* Popup Content */
.popup-content {
    padding: 1.5rem 2rem 2rem 2rem;
}

.popup-message {
    color: #1F2937;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.popup-message:last-child {
    margin-bottom: 0;
}

/* Popup Footer */
.popup-footer {
    padding: 1rem 2rem 2rem 2rem;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    border-top: 1px solid #E5E7EB;
    background-color: #F9FAFB;
    border-radius: 0 0 12px 12px;
}

.popup-footer .btn {
    min-width: 100px;
}

/* Popup Types */
.popup-success .popup-title {
    color: #059669;
}

.popup-error .popup-title {
    color: #DC2626;
}

.popup-warning .popup-title {
    color: #D97706;
}

.popup-info .popup-title {
    color: #1E3A8A;
}

/* Popup with Icon */
.popup-with-icon {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.popup-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.popup-success .popup-icon {
    background: linear-gradient(135deg, #10B981, #059669);
}

.popup-error .popup-icon {
    background: linear-gradient(135deg, #EF4444, #DC2626);
}

.popup-warning .popup-icon {
    background: linear-gradient(135deg, #F59E0B, #D97706);
}

.popup-info .popup-icon {
    background: linear-gradient(135deg, #3B82F6, #1E3A8A);
}

.popup-content-with-icon {
    flex: 1;
}

/* Large Popup */
.popup-large .popup-container {
    max-width: 700px;
}

/* Small Popup */
.popup-small .popup-container {
    max-width: 400px;
}

/* Confirmation Popup */
.popup-confirmation .popup-footer {
    justify-content: center;
}

.popup-confirmation .popup-footer .btn {
    min-width: 120px;
}

/* Form Popup */
.popup-form .popup-content {
    padding-bottom: 1rem;
}

.popup-form .popup-footer {
    justify-content: flex-end;
}

/* Loading Popup */
.popup-loading .popup-content {
    text-align: center;
    padding: 2rem;
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid #E5E7EB;
    border-radius: 50%;
    border-top-color: #1E3A8A;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .popup-overlay {
        padding: 0.5rem;
    }
    
    .popup-container {
        max-width: 100%;
        margin: 0 0.5rem;
    }
    
    .popup-header,
    .popup-content,
    .popup-footer {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .popup-title {
        font-size: 1.25rem;
    }
    
    .popup-footer {
        flex-direction: column;
    }
    
    .popup-footer .btn {
        width: 100%;
        min-width: auto;
    }
    
    .popup-with-icon {
        flex-direction: column;
        text-align: center;
    }
    
    .popup-icon {
        align-self: center;
    }
}

/* Animation for different popup types */
.popup-overlay.popup-slide-up .popup-container {
    transform: scale(0.9) translateY(50px);
}

.popup-overlay.popup-slide-up.active .popup-container {
    transform: scale(1) translateY(0);
}

.popup-overlay.popup-zoom .popup-container {
    transform: scale(0.7);
}

.popup-overlay.popup-zoom.active .popup-container {
    transform: scale(1);
}

/* Accessibility */
.popup-overlay:focus {
    outline: none;
}

.popup-container:focus {
    outline: none;
}

/* Keyboard navigation */
.popup-overlay[tabindex]:focus {
    outline: 2px solid #1E3A8A;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .popup-overlay {
        background: rgba(0, 0, 0, 0.8);
    }
    
    .popup-container {
    border: 2px solid #1E3A8A;
}
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .popup-overlay,
    .popup-container,
    .popup-close {
        transition: none;
    }
    
    .loading-spinner {
        animation: none;
    }
} 