/* ===== Enhanced Notification System with Modern Design ===== */

/* Notification Container */
.notification-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 16px;
    pointer-events: none;
    max-height: 80vh;
    overflow-y: auto;
    scrollbar-width: thin;
    border-radius: 12px;
}

.notification-container::-webkit-scrollbar {
    width: 4px;
}

.notification-container::-webkit-scrollbar-track {
    background: transparent;
}

.notification-container::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

/* Individual Notification */
.notification {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 16px;
    min-width: 320px;
    max-width: 400px;
    box-shadow: 
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05),
        0 0 0 1px rgba(0, 0, 0, 0.02);
    transform: translateX(120%) scale(0.95);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: all;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-left: 5px solid transparent;
}

/* Show Animation */
.notification.show {
    transform: translateX(0) scale(1);
    opacity: 1;
}

/* Hiding Animation */
.notification.hiding {
    transform: translateX(120%) scale(0.95);
    opacity: 0;
    transition: all 0.3s ease-out;
}

/* Notification Content Wrapper */
.notification-content {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding-right: 24px;
}

/* Notification Icon Container */
.notification-icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    background-color: rgba(0, 0, 0, 0.07);
    transform: scale(0);
    animation: pop-in 0.4s 0.1s forwards cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Notification Title and Message Container */
.notification-text-content {
    flex: 1;
}

/* Notification Title */
.notification-title {
    color: #111827;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 6px;
    opacity: 0;
    transform: translateY(-5px);
    animation: fade-slide-down 0.4s 0.2s forwards;
}

/* Notification Message */
.notification-message {
    color: #4B5563;
    font-size: 14px;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(5px);
    animation: fade-slide-up 0.4s 0.3s forwards;
}

/* Close Button */
.notification-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    line-height: 0;
    color: #9CA3AF;
    transition: all 0.2s ease;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0);
    animation: pop-in 0.3s 0.4s forwards cubic-bezier(0.34, 1.56, 0.64, 1);
    width: 24px;
    height: 24px;
}

.notification-close:hover {
    background: rgba(0, 0, 0, 0.07);
    color: #1F2937;
    transform: rotate(90deg) scale(1.1);
}

.notification-close i {
    font-size: 12px;
}

/* Progress Bar Container */
.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(0, 0, 0, 0.03);
}

/* Progress Bar */
.notification-progress-bar {
    height: 100%;
    width: 100%;
    transform-origin: left;
    animation: progress 5s linear;
    transition: background-color 0.3s ease;
}

/* Action Button */
.notification-action {
    margin-top: 12px;
    opacity: 0;
    transform: translateY(10px);
    animation: fade-slide-up 0.4s 0.4s forwards;
}

.notification-action button {
    padding: 6px 12px;
    background-color: rgba(0, 0, 0, 0.07);
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.notification-action button:hover {
    background-color: rgba(0, 0, 0, 0.12);
}

/* Notification Types with Modern Colors */
.notification.success {
    background: linear-gradient(to right, rgba(240, 253, 244, 0.95), rgba(240, 253, 244, 0.85));
    border-left-color: #10B981;
}

.notification.success .notification-icon-box {
    background-color: rgba(16, 185, 129, 0.12);
    color: #10B981;
}

.notification.success .notification-progress-bar {
    background: #10B981;
}

.notification.success .notification-action button {
    background-color: rgba(16, 185, 129, 0.12);
    color: #10B981;
}

.notification.success .notification-action button:hover {
    background-color: rgba(16, 185, 129, 0.2);
}

.notification.error {
    background: linear-gradient(to right, rgba(254, 242, 242, 0.95), rgba(254, 242, 242, 0.85));
    border-left-color: #EF4444;
}

.notification.error .notification-icon-box {
    background-color: rgba(239, 68, 68, 0.12);
    color: #EF4444;
}

.notification.error .notification-progress-bar {
    background: #EF4444;
}

.notification.error .notification-action button {
    background-color: rgba(239, 68, 68, 0.12);
    color: #EF4444;
}

.notification.error .notification-action button:hover {
    background-color: rgba(239, 68, 68, 0.2);
}

.notification.warning {
    background: linear-gradient(to right, rgba(255, 251, 235, 0.95), rgba(255, 251, 235, 0.85));
    border-left-color: #F59E0B;
}

.notification.warning .notification-icon-box {
    background-color: rgba(245, 158, 11, 0.12);
    color: #F59E0B;
}

.notification.warning .notification-progress-bar {
    background: #F59E0B;
}

.notification.warning .notification-action button {
    background-color: rgba(245, 158, 11, 0.12);
    color: #F59E0B;
}

.notification.warning .notification-action button:hover {
    background-color: rgba(245, 158, 11, 0.2);
}

.notification.info {
    background: linear-gradient(to right, rgba(239, 246, 255, 0.95), rgba(239, 246, 255, 0.85));
    border-left-color: #3B82F6;
}

.notification.info .notification-icon-box {
    background-color: rgba(59, 130, 246, 0.12);
    color: #3B82F6;
}

.notification.info .notification-progress-bar {
    background: #3B82F6;
}

.notification.info .notification-action button {
    background-color: rgba(59, 130, 246, 0.12);
    color: #3B82F6;
}

.notification.info .notification-action button:hover {
    background-color: rgba(59, 130, 246, 0.2);
}

/* Pause Progress on Hover */
.notification.paused .notification-progress-bar {
    animation-play-state: paused;
}

/* Progress Bar Animation */
@keyframes progress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* New Pop-in Animation */
@keyframes pop-in {
    0% {
        transform: scale(0);
    }
    70% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* New Fade Slide Up Animation */
@keyframes fade-slide-up {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* New Fade Slide Down Animation */
@keyframes fade-slide-down {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsiveness */
@media screen and (max-width: 480px) {
    .notification-container {
        top: 16px;
        right: 16px;
        left: 16px;
    }
    
    .notification {
        min-width: unset;
        width: 100%;
        padding: 14px;
        border-radius: 10px;
    }

    .notification-content {
        gap: 10px;
    }
    
    .notification-icon-box {
        width: 32px;
        height: 32px;
    }

    .notification-title {
        font-size: 14px;
    }

    .notification-message {
        font-size: 13px;
    }
    
    .notification-action button {
        padding: 5px 10px;
        font-size: 12px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .notification {
        background-color: #1F2937;
        box-shadow: 
            0 10px 15px -3px rgba(0, 0, 0, 0.3),
            0 4px 6px -2px rgba(0, 0, 0, 0.2),
            0 0 0 1px rgba(255, 255, 255, 0.05);
    }
    
    .notification-title {
        color: #F9FAFB;
    }
    
    .notification-message {
        color: #D1D5DB;
    }
    
    .notification-close {
        color: #9CA3AF;
    }
    
    .notification-close:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #F9FAFB;
    }
    
    .notification.success {
        background: linear-gradient(to right, rgba(6, 78, 59, 0.95), rgba(6, 78, 59, 0.85));
    }
    
    .notification.error {
        background: linear-gradient(to right, rgba(127, 29, 29, 0.95), rgba(127, 29, 29, 0.85));
    }
    
    .notification.warning {
        background: linear-gradient(to right, rgba(120, 53, 15, 0.95), rgba(120, 53, 15, 0.85));
    }
    
    .notification.info {
        background: linear-gradient(to right, rgba(30, 58, 138, 0.95), rgba(30, 58, 138, 0.85));
    }
}




button.loading {
    position: relative;
    color: transparent !important; /* Ensure text is hidden regardless of other styles */
}

button.loading:disabled {
    color: transparent !important;
    border-color: #6c757d !important;
}

button.loading * {
    visibility: hidden; /* Hide all child elements when loading */
}

button.loading::after {
    content: "";
    position: absolute;
    width: 1.25rem;
    height: 1.25rem;
    top: calc(50% - 0.625rem);
    left: calc(50% - 0.625rem);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-top-color: white;
    border-radius: 50%;
    animation: button-loading-spinner 1s ease infinite;
    visibility: visible; /* Ensure spinner is visible */
}



div.loading {
    position: relative;
    color: transparent !important; /* Ensure text is hidden regardless of other styles */
}

div.loading::after {
    content: "";
    position: absolute;
    width: 3.25rem;
    height: 3.25rem;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 3px solid rgba(255, 255, 255, 0.5);
    border-top-color: #000;
    border-radius: 50%;
    animation: button-loading-spinner 1s ease infinite;
    visibility: visible; /* Ensure spinner is visible */
}


@keyframes button-loading-spinner {
    from {
        transform: rotate(0turn);
    }
    to {
        transform: rotate(1turn);
    }
}



/* Skeleton Loader Animation Styles */
.skeleton-loader {
    width: 100%;
}

.skeleton-item {
    margin-bottom: 10px;
}

.skeleton-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #e0e0e0;
    animation: pulse 1.5s infinite ease-in-out;
}

.skeleton-text {
    height: 16px;
    width: 70%;
    border-radius: 4px;
    background-color: #e0e0e0;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.6;
    }
}

/* Additional Skeleton Loader Styles for Form Elements */
.skeleton-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    width: 100%;
    align-items: center;
}

.skeleton-box {
    background-color: #e0e0e0;
    border-radius: 6px;
    animation: pulse 1.5s infinite ease-in-out;
}

/* Style specifically for form field skeletons */
.skeleton-box[style*="height: 40px"] {
    border-radius: 6px;
}

/* Style for button skeleton */
.skeleton-box[style*="width: 15%"] {
    border-radius: 10px;
    background-color: #e5e5e5;
}

/* For skeleton animation on dark backgrounds */
.dark-mode .skeleton-box {
    background-color: rgba(255, 255, 255, 0.1);
}