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

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

.popup-modal {
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.7) translateY(50px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

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

.popup-header {
    padding: 25px 30px 20px;
    text-align: center;
    position: relative;
}

.popup-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 20px;
    position: relative;
    overflow: hidden;
}

.popup-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shine 2s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.popup-icon.success {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.popup-icon.warning {
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: white;
}

.popup-icon.danger {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
}

.popup-icon.info {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
}

.popup-icon.question {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
    color: white;
}

.popup-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 10px;
    animation: fadeInUp 0.5s ease 0.2s both;
}

.popup-message {
    font-size: 1rem;
    color: #666;
    line-height: 1.5;
    margin: 0;
    animation: fadeInUp 0.5s ease 0.3s both;
}

.popup-buttons {
    padding: 20px 30px 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
    animation: fadeInUp 0.5s ease 0.4s both;
}

.popup-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 120px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.popup-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.popup-btn:hover::before {
    left: 100%;
}

.popup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

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

.popup-btn.primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.popup-btn.success {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.popup-btn.danger {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
}

.popup-btn.warning {
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: white;
}

.popup-btn.secondary {
    background: #f8f9fa;
    color: #666;
    border: 2px solid #e9ecef;
}

.popup-btn.secondary:hover {
    background: #e9ecef;
    color: #333;
}

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

/* Close button */
.popup-close {
    position: absolute;
    top: 15px;
    right: 20px;
    width: 35px;
    height: 35px;
    border: none;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #666;
    font-size: 1.2rem;
    z-index: 1000;
}

.popup-close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: rotate(90deg);
}

/* Loading spinner */
.popup-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    pointer-events: none;
    max-width: 400px; /* Increased width for better message display */
}

.toast {
    background: white;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25); /* Enhanced shadow for better visibility */
    margin-bottom: 15px;
    padding: 20px 25px; /* Increased padding for better spacing */
    min-width: 350px; /* Increased minimum width */
    transform: translateX(450px); /* Adjusted for new width */
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1); /* Slightly slower animation */
    pointer-events: auto;
    border-left: 5px solid; /* Slightly thicker border */
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px); /* Add glassmorphism effect */
}

.toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 4px;
    animation: toastProgress 5s linear;
    z-index: -1;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left-color: #4CAF50;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
}

.toast.success::before {
    background: #4CAF50;
}

/* Add success pulse animation */
@keyframes successPulse {
    0% {
        transform: translateX(450px) scale(0.95);
        box-shadow: 0 15px 40px rgba(76, 175, 80, 0.3);
    }
    50% {
        transform: translateX(0) scale(1.02);
        box-shadow: 0 20px 50px rgba(76, 175, 80, 0.4);
    }
    100% {
        transform: translateX(0) scale(1);
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    }
}

.toast.error {
    border-left-color: #f44336;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
}

.toast.error::before {
    background: #f44336;
}

.toast.warning {
    border-left-color: #FF9800;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
}

.toast.warning::before {
    background: #FF9800;
}

.toast.info {
    border-left-color: #2196F3;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
}

.toast.info::before {
    background: #2196F3;
}

@keyframes toastProgress {
    from { 
        width: 4px;
        opacity: 0.8;
    }
    to { 
        width: 100%;
        opacity: 0.3;
    }
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 0.9rem;
    color: white;
    vertical-align: middle;
}

.toast-content {
    display: inline-block;
    vertical-align: middle;
    flex: 1;
}

.toast-title {
    font-weight: 600;
    color: #333;
    margin: 0 0 4px;
    font-size: 0.9rem;
}

.toast-message {
    color: #666;
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.4;
}

.toast-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #666;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .popup-modal {
        width: 95%;
        margin: 20px;
        border-radius: 15px;
    }
    
    .popup-header {
        padding: 20px 20px 15px;
    }
    
    .popup-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
        margin-bottom: 15px;
    }
    
    .popup-title {
        font-size: 1.3rem;
    }
    
    .popup-message {
        font-size: 0.95rem;
    }
    
    .popup-buttons {
        padding: 15px 20px 25px;
        flex-direction: column;
    }
    
    .popup-btn {
        padding: 15px 25px;
        margin-bottom: 10px;
    }
    
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: auto;
        margin-bottom: 10px;
    }
}
