﻿/* ============================================
   GLOBAL LOADER - Reusable Across All Screens
   ============================================ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(20, 24, 82, 0.35);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    .loading-overlay.active {
        display: flex;
        opacity: 1;
    }

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}


/* ============================================
   GLOBAL TOAST NOTIFICATION SYSTEM
   Reusable across all screens
   ============================================ */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100001;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    min-width: 320px;
    max-width: 420px;
    padding: 16px 20px;
    border-radius: 8px;
    background-color: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    pointer-events: auto;
    animation: toastSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

    /* Left vertical bar via pseudo-element */
    .toast::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 4px;
        height: 100%; /* Poori height - bottom tak */
        background-color: #6366f1;
        border-top-left-radius: 8px;
        border-bottom-left-radius: 8px; /* Bottom-left corner bhi rounded */
        z-index: 2; /* Progress ke upar rahe */
    }

    /* Type-specific colors for the left bar */
    .toast.toast-error::before {
        background-color: #ef4444;
    }

    .toast.toast-success::before {
        background-color: #10b981;
    }

    .toast.toast-info::before {
        background-color: #3b82f6;
    }


/* Toast Content */
.toast-content { flex: 1; }
.toast-title {
    font-weight: 600;
    color: #111827;
    font-size: 0.95rem;
    margin-bottom: 2px;
}
.toast-message {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Toast Close Button */
.toast-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    flex-shrink: 0;
}
.toast-close:hover { color: #111827; }
/* ============================================
   PROGRESS BAR (Horizontal - Left to Right)
   ============================================ */

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background-color: #6366f1;
    animation: toastProgress var(--toast-duration, 4s) linear forwards;
    transform-origin: left center;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    z-index: 1; /* Left bar ke neeche rahe */
}

/* Type-specific colors */
.toast.toast-error .toast-progress {
    background-color: #ef4444;
}

.toast.toast-success .toast-progress {
    background-color: #10b981;
}

.toast.toast-info .toast-progress {
    background-color: #3b82f6;
}

/* Animation - Right se shrink karega (visual: left se right ja raha hai) */
@keyframes toastProgress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}
/* ============================================
   SUCCESS CHECKMARK ANIMATION
   ============================================ */
.success-checkmark {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 100000;
}
.success-checkmark.active {
    display: block;
    animation: checkmarkPop 0.5s ease-out forwards;
}
.success-checkmark-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
}
.success-checkmark-circle i {
    color: white;
    font-size: 2.5rem;
    animation: checkmarkIcon 0.4s ease-out 0.2s both;
}
@keyframes checkmarkPop {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    60% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
@keyframes checkmarkIcon {
    0% { transform: scale(0) rotate(-45deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Mobile */
@media (max-width: 600px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    .toast {
        min-width: auto;
        max-width: 100%;
    }
}