/**
 * GDTG.VN - Global Toast & Utility Styles
 */

/* Toast Container */

.gdtg-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    pointer-events: none;
}

@media (max-width: 640px) {
    .gdtg-toast-container {
        bottom: 80px;
        /* Above mobile nav */
        right: 12px;
        left: 12px;
    }
}

/* Toast Item */

.gdtg-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 400px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
    font-size: 14px;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 640px) {
    .gdtg-toast {
        min-width: auto;
        max-width: none;
        width: 100%;
    }
}

.gdtg-toast-show {
    opacity: 1;
    transform: translateX(0);
}

.gdtg-toast-hide {
    opacity: 0;
    transform: translateX(100%);
}

/* Toast Types */

.gdtg-toast-success {
    border-left: 4px solid #10b981;
}

.gdtg-toast-success .gdtg-toast-icon {
    color: #10b981;
}

.gdtg-toast-error {
    border-left: 4px solid #ef4444;
}

.gdtg-toast-error .gdtg-toast-icon {
    color: #ef4444;
}

.gdtg-toast-warning {
    border-left: 4px solid #f59e0b;
}

.gdtg-toast-warning .gdtg-toast-icon {
    color: #f59e0b;
}

.gdtg-toast-info {
    border-left: 4px solid #3b82f6;
}

.gdtg-toast-info .gdtg-toast-icon {
    color: #3b82f6;
}

/* Toast Icon */

.gdtg-toast-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
}

.gdtg-toast-icon svg {
    width: 100%;
    height: 100%;
}

/* Toast Message */

.gdtg-toast-message {
    flex: 1;
    line-height: 1.4;
}

/* Toast Close */

.gdtg-toast-close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
}

.gdtg-toast-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Lazy Loading Images */

.gdtg-img-loading {
    opacity: 0.6;
    filter: blur(5px);
    transition: all 0.3s ease;
}

.gdtg-img-loaded {
    opacity: 1;
    filter: blur(0);
    animation: gdtgFadeIn 0.3s ease;
}

.gdtg-img-error {
    opacity: 0.5;
    background: #1e293b;
}

@keyframes gdtgFadeIn {
    from {
        opacity: 0.6;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Skeleton Loading */

.gdtg-skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: gdtgSkeletonShimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes gdtgSkeletonShimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Loading Spinner */

.gdtg-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(6, 182, 212, 0.2);
    border-top-color: #06b6d4;
    border-radius: 50%;
    animation: gdtgSpin 0.8s linear infinite;
}

@keyframes gdtgSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Light Theme Support */

body.light-theme .gdtg-toast {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    color: #1e293b;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

body.light-theme .gdtg-toast-close {
    background: rgba(0, 0, 0, 0.05);
    color: #64748b;
}

body.light-theme .gdtg-toast-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #1e293b;
}

body.light-theme .gdtg-skeleton {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
}