/* ============================================================
   PROFESSIONAL ANIMATIONS & MICRO-INTERACTIONS
   ============================================================ */

/* ============================================================
   LOADING ANIMATIONS
   ============================================================ */

/* Spinner for general loading */
.spinner {
    border: 3px solid var(--bg-tertiary);
    border-top: 3px solid var(--inseit-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
}

.spinner-small {
    border: 2px solid var(--bg-tertiary);
    border-top: 2px solid var(--inseit-primary);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Upload animation */
.upload-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.6s linear infinite;
}

/* Pulse animation for processing states */
.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* ============================================================
   BUTTON RIPPLE EFFECT (Subtle Material Design)
   ============================================================ */

.btn-ripple {
    position: relative;
    overflow: hidden;
    transform: translate3d(0, 0, 0);
}

.btn-ripple:after {
    content: "";
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, #fff 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform 0.5s, opacity 1s;
}

.btn-ripple:active:after {
    transform: scale(0, 0);
    opacity: 0.3;
    transition: 0s;
}

/* ============================================================
   CARD HOVER EFFECTS
   ============================================================ */

.card-hover {
    transition: transform var(--transition-base),
                box-shadow var(--transition-base);
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.card-hover-subtle {
    transition: box-shadow var(--transition-base),
                border-color var(--transition-base);
}

.card-hover-subtle:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--inseit-accent);
}

/* ============================================================
   DROPDOWN ANIMATIONS
   ============================================================ */

.dropdown-enter {
    animation: dropdownSlideIn 0.2s ease-out;
    transform-origin: top;
}

@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scaleY(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scaleY(1);
    }
}

.dropdown-leave {
    animation: dropdownSlideOut 0.15s ease-in;
}

@keyframes dropdownSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scaleY(1);
    }
    to {
        opacity: 0;
        transform: translateY(-10px) scaleY(0.95);
    }
}

/* Rotate chevron icon */
.chevron-rotate {
    transition: transform var(--transition-base);
}

.chevron-rotate.open {
    transform: rotate(180deg);
}

/* ============================================================
   TAB SWITCHING ANIMATIONS
   ============================================================ */

.tab-content {
    animation: tabFadeIn 0.3s ease-out;
}

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

.tab-slide-enter {
    animation: tabSlideIn 0.25s ease-out;
}

@keyframes tabSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */

.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    min-width: 300px;
    max-width: 400px;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastSlideIn 0.3s ease-out;
    background: white;
    border-left: 4px solid;
}

.toast.success {
    border-left-color: #10b981;
}

.toast.error {
    border-left-color: #ef4444;
}

.toast.info {
    border-left-color: #3b82f6;
}

.toast.warning {
    border-left-color: #f59e0b;
}

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

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
    color: var(--text-primary);
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
}

.toast-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-tertiary);
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background var(--transition-fast);
}

.toast-close:hover {
    background: var(--bg-tertiary);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-leave {
    animation: toastSlideOut 0.2s ease-in forwards;
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

/* ============================================================
   FADE IN ANIMATIONS
   ============================================================ */

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in-up {
    animation: fadeInUp 0.4s ease-out;
}

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

/* ============================================================
   LOADING OVERLAY
   ============================================================ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    animation: fadeIn 0.2s ease-out;
}

.loading-content {
    background: white;
    padding: 32px 48px;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-lg);
}

.loading-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

/* ============================================================
   SMOOTH TRANSITIONS
   ============================================================ */

.transition-all {
    transition: all var(--transition-base);
}

.transition-colors {
    transition: color var(--transition-fast),
                background-color var(--transition-fast),
                border-color var(--transition-fast);
}

.transition-transform {
    transition: transform var(--transition-base);
}

.transition-opacity {
    transition: opacity var(--transition-base);
}

/* ============================================================
   SKELETON LOADERS (for future use)
   ============================================================ */

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 25%,
        var(--bg-secondary) 50%,
        var(--bg-tertiary) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ============================================================
   FOCUS STATES (Accessibility)
   ============================================================ */

.focus-ring:focus {
    outline: 2px solid var(--inseit-accent);
    outline-offset: 2px;
}

.focus-ring-inset:focus {
    outline: 2px solid var(--inseit-accent);
    outline-offset: -2px;
}

/* ============================================================
   SCALE ANIMATIONS
   ============================================================ */

.scale-on-hover {
    transition: transform var(--transition-fast);
}

.scale-on-hover:hover {
    transform: scale(1.05);
}

.scale-on-hover:active {
    transform: scale(0.98);
}
