/**
 * SAW LMS - PWA Styles
 */

/* ================================
   INSTALL BUTTON
   ================================ */
.saw-pwa-install {
    position: fixed;
    bottom: var(--saw-space-4);
    right: var(--saw-space-4);
    display: flex;
    align-items: center;
    gap: var(--saw-space-2);
    padding: var(--saw-space-3) var(--saw-space-4);
    background: var(--saw-primary);
    color: var(--saw-white);
    border: none;
    border-radius: var(--saw-radius-full);
    font-size: var(--saw-text-sm);
    font-weight: var(--saw-font-medium);
    cursor: pointer;
    box-shadow: var(--saw-shadow-lg);
    z-index: var(--saw-z-fixed);
    animation: slideUp 0.3s var(--saw-ease-out);
}

.saw-pwa-install svg {
    width: 20px;
    height: 20px;
}

.saw-pwa-install:hover {
    transform: translateY(-2px);
    box-shadow: var(--saw-shadow-xl);
}

/* ================================
   UPDATE NOTIFICATION
   ================================ */
.saw-pwa-update {
    position: fixed;
    bottom: var(--saw-space-4);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: var(--saw-space-3);
    padding: var(--saw-space-3) var(--saw-space-4);
    background: var(--saw-gray-900);
    color: var(--saw-white);
    border-radius: var(--saw-radius-lg);
    font-size: var(--saw-text-sm);
    box-shadow: var(--saw-shadow-xl);
    z-index: var(--saw-z-fixed);
    animation: slideUp 0.3s var(--saw-ease-out);
}

.saw-pwa-update button {
    padding: var(--saw-space-2) var(--saw-space-3);
    background: var(--saw-primary);
    color: var(--saw-white);
    border: none;
    border-radius: var(--saw-radius);
    font-size: var(--saw-text-sm);
    font-weight: var(--saw-font-medium);
    cursor: pointer;
}

/* ================================
   OFFLINE INDICATOR
   ================================ */
.saw-offline-indicator {
    position: fixed;
    top: var(--saw-space-4);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: var(--saw-space-2);
    padding: var(--saw-space-2) var(--saw-space-4);
    background: var(--saw-warning);
    color: var(--saw-white);
    border-radius: var(--saw-radius-full);
    font-size: var(--saw-text-sm);
    font-weight: var(--saw-font-medium);
    z-index: var(--saw-z-fixed);
    animation: slideDown 0.3s var(--saw-ease-out);
}

.saw-offline-indicator svg {
    width: 16px;
    height: 16px;
}

/* ================================
   UI ANIMATIONS
   ================================ */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Animation utilities */
.saw-animate-fade-in {
    animation: fadeIn var(--saw-duration-fast) var(--saw-ease-out);
}

.saw-animate-scale-in {
    animation: scaleIn var(--saw-duration-fast) var(--saw-ease-out);
}

.saw-animate-slide-up {
    animation: slideUp var(--saw-duration-fast) var(--saw-ease-out);
}

.saw-animate-pulse {
    animation: pulse 2s infinite;
}

.saw-animate-spin {
    animation: spin 1s linear infinite;
}

/* Page transitions */
.saw-page-enter {
    animation: fadeIn var(--saw-duration-default) var(--saw-ease-out);
}

/* Card hover effects */
.saw-card-hover {
    transition: transform var(--saw-duration-fast) var(--saw-ease-out),
        box-shadow var(--saw-duration-fast) var(--saw-ease-out);
}

.saw-card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--saw-shadow-lg);
}

/* Button hover effects */
.saw-btn {
    transition: all var(--saw-duration-fast) var(--saw-ease-out);
}

.saw-btn:active {
    transform: scale(0.98);
}

/* Loading spinner */
.saw-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--saw-border);
    border-top-color: var(--saw-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.saw-spinner--lg {
    width: 40px;
    height: 40px;
    border-width: 3px;
}

/* Skeleton loading */
.saw-skeleton {
    background: linear-gradient(90deg,
            var(--saw-bg-alt) 25%,
            var(--saw-gray-200) 50%,
            var(--saw-bg-alt) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--saw-radius);
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Focus ring */
.saw-focus-ring:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--saw-primary-subtle);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}