/* Custom Animations and Utilities */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes progress-fill {
    from {
        width: 0%;
    }
}

.animate-fade-in {
    animation: fade-in 0.5s ease-out forwards;
}

.animate-pulse-slow {
    animation: pulse-slow 2s ease-in-out infinite;
}

.animate-slide-in {
    animation: slide-in 0.3s ease-out forwards;
}

/* Progress Bar Animation */
.progress-bar {
    transition: width 1s ease-out;
}

/* Timeline hover effects */
.timeline-item {
    transition: all 0.2s ease;
}

/* AI Badge Pulse */
.ai-badge {
    animation: pulse-slow 2s ease-in-out infinite;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Glassmorphism utilities */
.glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Smooth transitions for interactive elements */
button, a {
    transition: all 0.2s ease;
}

/* Focus styles for accessibility */
button:focus-visible,
input:focus-visible {
    outline: 2px solid #14b8a6;
    outline-offset: 2px;
}

/* Card hover lift effect */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Circular progress animation */
circle {
    transition: stroke-dashoffset 1s ease-in-out;
    transform-origin: 50% 50%;
}

/* Loading state for buttons */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
}

/* Print styles for medical records */
@media print {
    header, aside, .no-print {
        display: none !important;
    }
    
    main {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .shadow-soft, .shadow-elevated {
        box-shadow: none !important;
        border: 1px solid #e2e8f0 !important;
    }
}