/**
 * Loading States & Animations
 * Modern loading indicators for better UX
 */

/* ========================================
   1. MINIMAL & CLEAN BUTTON LOADING STATES
   ======================================== */

/* Clean minimal loading button */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
    cursor: not-allowed;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin-left: -9px;
    margin-top: -9px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: clean-spinner 0.8s linear infinite;
}

/* Button loading with text - minimal */
.btn-loading-text {
    position: relative;
    pointer-events: none;
    cursor: not-allowed;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.btn-loading-text::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 15px;
    top: 50%;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: clean-spinner 0.8s linear infinite;
}

/* Keeping gradient-shift for backward compatibility */
@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ========================================
   2. MINIMAL & CLEAN FORM LOADING OVERLAY
   ======================================== */

.form-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: inherit;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.form-loading-overlay .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 123, 255, 0.1);
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: clean-spinner 0.8s linear infinite;
}

.form-loading-overlay .loading-text {
    margin-top: 16px;
    font-size: 14px;
    color: #5a6c7d;
    font-weight: 500;
    text-align: center;
    max-width: 280px;
    line-height: 1.4;
    letter-spacing: 0.2px;
}

.form-loading-overlay .loading-subtext {
    margin-top: 6px;
    font-size: 12px;
    color: #8896a4;
    font-weight: 400;
    text-align: center;
    opacity: 0.7;
}

/* Clean minimal spinner animation */
@keyframes clean-spinner {
    0% { 
        transform: rotate(0deg);
    }
    100% { 
        transform: rotate(360deg);
    }
}

@keyframes modern-spinner {
    0% { 
        transform: rotate(0deg) scale(1);
        border-top-color: #667eea;
        border-right-color: #764ba2;
    }
    25% {
        transform: rotate(90deg) scale(1.05);
        border-top-color: #764ba2;
        border-right-color: #f093fb;
    }
    50% {
        transform: rotate(180deg) scale(1.1);
        border-top-color: #f093fb;
        border-right-color: #f5576c;
    }
    75% {
        transform: rotate(270deg) scale(1.05);
        border-top-color: #f5576c;
        border-right-color: #667eea;
    }
    100% { 
        transform: rotate(360deg) scale(1);
        border-top-color: #667eea;
        border-right-color: #764ba2;
    }
}

@keyframes pulse-text {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ========================================
   3. MODERN SPINNER VARIATIONS
   ======================================== */

/* Dots spinner */
.spinner-dots {
    display: inline-flex;
    gap: 8px;
}

.spinner-dots span {
    width: 8px;
    height: 8px;
    background: currentColor;
    border-radius: 50%;
    animation: bounce-dots 1.4s infinite ease-in-out both;
}

.spinner-dots span:nth-child(1) { animation-delay: -0.32s; }
.spinner-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce-dots {
    0%, 80%, 100% { 
        transform: scale(0);
        opacity: 0.5;
    }
    40% { 
        transform: scale(1);
        opacity: 1;
    }
}

/* Pulse spinner */
.spinner-pulse {
    width: 40px;
    height: 40px;
    background-color: #007bff;
    border-radius: 50%;
    animation: pulse-scale 1.2s infinite ease-in-out;
}

@keyframes pulse-scale {
    0%, 100% {
        transform: scale(0);
        opacity: 1;
    }
    50% {
        transform: scale(1);
        opacity: 0.3;
    }
}

/* Dual ring spinner */
.spinner-dual-ring {
    width: 40px;
    height: 40px;
}

.spinner-dual-ring::after {
    content: " ";
    display: block;
    width: 32px;
    height: 32px;
    margin: 4px;
    border-radius: 50%;
    border: 3px solid #007bff;
    border-color: #007bff transparent #007bff transparent;
    animation: dual-ring 1.2s linear infinite;
}

@keyframes dual-ring {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   4. ENHANCED SKELETON LOADERS
   ======================================== */

.skeleton {
    background: linear-gradient(90deg, 
        rgba(240, 240, 240, 0.8) 25%, 
        rgba(220, 220, 220, 0.9) 50%, 
        rgba(240, 240, 240, 0.8) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.8s ease-in-out infinite;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.skeleton::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.6) 50%, 
        transparent 100%
    );
    animation: skeleton-wave 2s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
    0% { 
        background-position: -200% 0;
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
    100% { 
        background-position: 200% 0;
        opacity: 0.8;
    }
}

@keyframes skeleton-wave {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 12px;
    border-radius: 8px;
    animation-delay: 0.1s;
}

.skeleton-text:nth-child(2) { animation-delay: 0.2s; }
.skeleton-text:nth-child(3) { animation-delay: 0.3s; }
.skeleton-text:nth-child(4) { animation-delay: 0.4s; }

.skeleton-text:last-child {
    width: 75%;
    animation-delay: 0.5s;
}

.skeleton-heading {
    height: 28px;
    width: 65%;
    margin-bottom: 16px;
    border-radius: 8px;
    animation-delay: 0.1s;
}

.skeleton-image {
    width: 100%;
    height: 200px;
    border-radius: 12px;
    margin-bottom: 16px;
    animation-delay: 0.2s;
}

.skeleton-card {
    padding: 24px;
    border: 1px solid rgba(229, 231, 235, 0.8);
    border-radius: 12px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.9) 100%);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    animation-delay: 0.1s;
    position: relative;
    overflow: hidden;
}

.skeleton-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.05) 0%, 
        rgba(118, 75, 162, 0.05) 100%
    );
    animation: skeleton-card-glow 3s ease-in-out infinite;
}

@keyframes skeleton-card-glow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* Enhanced skeleton variations */
.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-bottom: 12px;
    animation-delay: 0.2s;
}

.skeleton-button {
    height: 40px;
    width: 120px;
    border-radius: 20px;
    margin-top: 16px;
    animation-delay: 0.4s;
}

.skeleton-badge {
    height: 24px;
    width: 60px;
    border-radius: 12px;
    display: inline-block;
    margin-right: 8px;
    animation-delay: 0.3s;
}

/* ========================================
   5. PROGRESS INDICATORS
   ======================================== */

.progress-bar-linear {
    width: 100%;
    height: 4px;
    background: #f0f0f0;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.progress-bar-linear::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 30%;
    background: #007bff;
    animation: progress-slide 1.5s ease-in-out infinite;
}

@keyframes progress-slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}

/* Circular progress */
.progress-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: conic-gradient(#007bff var(--progress, 0%), #f0f0f0 0%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.progress-circle::before {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
}

.progress-circle span {
    position: relative;
    z-index: 1;
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

/* ========================================
   6. PAGE LOADER
   ======================================== */

#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

#page-loader .loader-content {
    text-align: center;
}

#page-loader .loader-logo {
    max-width: 200px;
    margin-bottom: 24px;
    animation: fade-in-up 0.6s ease-out;
}

#page-loader .loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

#page-loader .loader-text {
    font-size: 16px;
    color: #666;
    font-weight: 500;
    animation: pulse-opacity 1.5s ease-in-out infinite;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-opacity {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ========================================
   7. INLINE LOADERS
   ======================================== */

.inline-loader {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.inline-loader .spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ========================================
   8. FORM FIELD LOADING STATES
   ======================================== */

.field-loading {
    position: relative;
}

.field-loading::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ========================================
   9. OVERLAY LOADERS
   ======================================== */

.overlay-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.overlay-loader .loader-box {
    background: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 90%;
    animation: scale-in 0.3s ease-out;
}

@keyframes scale-in {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.overlay-loader .loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

.overlay-loader .loader-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.overlay-loader .loader-message {
    font-size: 14px;
    color: #666;
}

/* ========================================
   10. SUCCESS/ERROR ANIMATIONS
   ======================================== */

.success-checkmark {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: block;
    stroke-width: 3;
    stroke: #10b981;
    stroke-miterlimit: 10;
    margin: 0 auto 16px;
    animation: scale-in 0.3s ease-out;
}

.success-checkmark circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 3;
    stroke: #10b981;
    fill: none;
    animation: stroke-draw 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.success-checkmark path {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke-draw 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.4s forwards;
}

@keyframes stroke-draw {
    100% {
        stroke-dashoffset: 0;
    }
}

/* Error X mark */
.error-xmark {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    animation: scale-in 0.3s ease-out;
}

.error-xmark::before,
.error-xmark::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 3px;
    background: #ef4444;
}

.error-xmark::before {
    transform: rotate(45deg);
}

.error-xmark::after {
    transform: rotate(-45deg);
}

/* ========================================
   11. LOADING DOTS
   ======================================== */

.loading-dots {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: currentColor;
    border-radius: 50%;
    animation: dot-flashing 1s infinite linear alternate;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dot-flashing {
    0% {
        opacity: 0.2;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========================================
   12. PROGRESS BAR
   ======================================== */

.progress-bar-container {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin: 16px 0;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    border-radius: 2px;
    transition: width 0.3s ease;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

/* ========================================
   13. MODAL LOADING STATE
   ======================================== */

.modal-loading {
    position: relative;
    pointer-events: none;
}

.modal-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   14. CARD/SECTION LOADING
   ======================================== */

.card-loading {
    position: relative;
    overflow: hidden;
}

.card-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: shimmer-slide 1.5s infinite;
    z-index: 1;
}

@keyframes shimmer-slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ========================================
   15. DISABLED STATE
   ======================================== */

.loading-disabled {
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
}

/* ========================================
   16. LOADING TEXT ANIMATIONS
   ======================================== */

.loading-text-animated {
    position: relative;
    overflow: hidden;
}

.loading-text-animated::after {
    content: '...';
    position: absolute;
    animation: loading-dots-text 1.5s infinite;
}

@keyframes loading-dots-text {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
    100% { content: ''; }
}

/* ========================================
   17. SUBMISSION SUCCESS/ERROR STATES
   ======================================== */

.submission-feedback {
    padding: 20px;
    border-radius: 8px;
    margin: 16px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slide-down 0.3s ease-out;
}

@keyframes slide-down {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.submission-feedback.success {
    background: #d1fae5;
    border: 1px solid #10b981;
    color: #065f46;
}

.submission-feedback.error {
    background: #fee2e2;
    border: 1px solid #ef4444;
    color: #991b1b;
}

.submission-feedback.info {
    background: #dbeafe;
    border: 1px solid #3b82f6;
    color: #1e40af;
}

.submission-feedback .icon {
    font-size: 24px;
    flex-shrink: 0;
}

/* ========================================
   18. LOADING BACKDROP
   ======================================== */

.loading-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(2px);
}

.loading-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   19. BUTTON STATES
   ======================================== */

.btn-submitting {
    position: relative;
    color: transparent !important;
}

.btn-submitting::after {
    content: 'Submitting';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-submitting::before {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
}

/* ========================================
   20. ENHANCED TOAST NOTIFICATIONS
   ======================================== */

.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 320px;
    max-width: 500px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
    backdrop-filter: blur(12px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 25px rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    padding: 20px 24px;
    z-index: 10000;
    animation: toast-slide-in 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: translateX(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-notification:hover {
    transform: translateX(-4px) scale(1.02);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.2), 0 12px 35px rgba(0, 0, 0, 0.15);
}

@keyframes toast-slide-in {
    0% {
        opacity: 0;
        transform: translateX(120px) scale(0.8);
    }
    50% {
        transform: translateX(-10px) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.toast-notification.toast-success {
    border-left: 5px solid #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(255, 255, 255, 0.95) 100%);
}

.toast-notification.toast-success::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, transparent 100%);
    border-radius: inherit;
    animation: toast-success-glow 3s ease-in-out infinite;
}

.toast-notification.toast-error {
    border-left: 5px solid #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, rgba(255, 255, 255, 0.95) 100%);
}

.toast-notification.toast-error::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, transparent 100%);
    border-radius: inherit;
    animation: toast-error-pulse 2s ease-in-out infinite;
}

.toast-notification.toast-info {
    border-left: 5px solid #3b82f6;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(255, 255, 255, 0.95) 100%);
}

.toast-notification.toast-warning {
    border-left: 5px solid #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, rgba(255, 255, 255, 0.95) 100%);
}

.toast-notification .toast-icon {
    font-size: 28px;
    flex-shrink: 0;
    margin-top: 2px;
    animation: toast-icon-bounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast-notification .toast-content {
    flex: 1;
    min-width: 0;
}

.toast-notification .toast-title {
    font-weight: 700;
    margin-bottom: 6px;
    color: #1f2937;
    font-size: 16px;
    line-height: 1.4;
}

.toast-notification .toast-message {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
    word-wrap: break-word;
}

.toast-notification .toast-close {
    cursor: pointer;
    padding: 8px;
    font-size: 18px;
    color: #9ca3af;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    flex-shrink: 0;
    margin-top: -4px;
}

.toast-notification .toast-close:hover {
    color: #4b5563;
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.1);
}

/* Toast animations */
@keyframes toast-success-glow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

@keyframes toast-error-pulse {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.5; }
}

@keyframes toast-icon-bounce {
    0% { transform: scale(0.3) rotate(-10deg); }
    50% { transform: scale(1.1) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* ========================================
   21. MICRO-INTERACTIONS
   ======================================== */

.fade-in {
    animation: fade-in 0.3s ease-out;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.scale-in {
    animation: scale-in-animation 0.3s ease-out;
}

@keyframes scale-in-animation {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.slide-up {
    animation: slide-up 0.3s ease-out;
}

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

/* ========================================
   22. PULSE EFFECT FOR ACTIVE ELEMENTS
   ======================================== */

.pulse-active {
    animation: pulse-active 2s infinite;
}

@keyframes pulse-active {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(0, 123, 255, 0);
    }
}

/* ========================================
   23. LOADING STATE UTILITIES
   ======================================== */

.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.pointer-events-none { pointer-events: none; }
.cursor-wait { cursor: wait; }
.cursor-progress { cursor: progress; }

/* ========================================
   24. ENHANCED RESPONSIVE DESIGN
   ======================================== */

/* Mobile First Approach */
@media (max-width: 480px) {
    /* Toast notifications - mobile optimized */
    .toast-notification {
        min-width: auto;
        max-width: calc(100vw - 32px);
        width: calc(100vw - 32px);
        top: 16px;
        right: 16px;
        left: 16px;
        padding: 16px 20px;
        border-radius: 12px;
        font-size: 14px;
    }
    
    .toast-notification .toast-icon {
        font-size: 24px;
    }
    
    .toast-notification .toast-title {
        font-size: 15px;
        margin-bottom: 4px;
    }
    
    .toast-notification .toast-message {
        font-size: 13px;
    }
    
    /* Form loading overlay - mobile */
    .form-loading-overlay {
        padding: 16px;
    }
    
    .form-loading-overlay .spinner {
        width: 36px;
        height: 36px;
        border-width: 2.5px;
    }
    
    .form-loading-overlay .loading-text {
        font-size: 13px;
        margin-top: 14px;
    }
    
    /* Button loading - mobile */
    .btn-loading::after {
        width: 16px;
        height: 16px;
        margin-left: -8px;
        margin-top: -8px;
        border-width: 2px;
    }
    
    .btn-loading-text::before {
        width: 14px;
        height: 14px;
        left: 12px;
        margin-top: -7px;
        border-width: 2px;
    }
    
    /* Skeleton loaders - mobile */
    .skeleton-text {
        height: 14px;
        margin-bottom: 10px;
    }
    
    .skeleton-heading {
        height: 24px;
        width: 70%;
    }
    
    .skeleton-image {
        height: 150px;
    }
    
    .skeleton-card {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    /* Overlay loader - mobile */
    .overlay-loader .loader-box {
        padding: 20px;
        margin: 16px;
        max-width: calc(100vw - 32px);
    }
    
    .overlay-loader .loader-spinner {
        width: 40px;
        height: 40px;
    }
    
    .overlay-loader .loader-title {
        font-size: 16px;
    }
    
    .overlay-loader .loader-message {
        font-size: 14px;
    }
    
    /* Page loader - mobile */
    #page-loader .loader-logo {
        max-width: 120px;
    }
    
    #page-loader .loader-spinner {
        width: 40px;
        height: 40px;
    }
    
    #page-loader .loader-text {
        font-size: 14px;
    }
}

/* Tablet adjustments */
@media (min-width: 481px) and (max-width: 768px) {
    .toast-notification {
        min-width: 280px;
        max-width: calc(100vw - 40px);
        top: 16px;
        right: 20px;
    }
    
    .form-loading-overlay .spinner {
        width: 38px;
        height: 38px;
    }
    
    .form-loading-overlay .loading-text {
        font-size: 14px;
        margin-top: 15px;
    }
    
    .skeleton-card {
        padding: 20px;
    }
    
    .overlay-loader .loader-box {
        padding: 24px;
        max-width: 400px;
    }
}

/* Desktop enhancements */
@media (min-width: 769px) {
    .toast-notification {
        min-width: 350px;
    }
    
    .toast-notification:hover {
        transform: translateX(-8px) scale(1.03);
    }
    
    .form-loading-overlay .spinner {
        width: 40px;
        height: 40px;
    }
    
    .form-loading-overlay .loading-text {
        font-size: 14px;
        margin-top: 16px;
    }
    
    .skeleton-card {
        padding: 28px;
    }
}

/* Large screens */
@media (min-width: 1200px) {
    .toast-notification {
        min-width: 400px;
        max-width: 600px;
    }
    
    .overlay-loader .loader-box {
        padding: 32px;
        max-width: 500px;
    }
}

/* Ultra-wide screens */
@media (min-width: 1920px) {
    .toast-notification {
        right: calc((100vw - 1920px) / 2 + 20px);
    }
}

/* ========================================
   25. ACCESSIBILITY
   ======================================== */

.loading[aria-busy="true"] {
    cursor: wait;
}

.sr-only-loading {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ========================================
   26. PREFERS-REDUCED-MOTION
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .loading-backdrop {
        backdrop-filter: none;
    }
}

