/* Animations and Transitions */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.animate {
    opacity: 0;
    transform: translateY(20px);
}

.animate.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.animate.scale-in {
    animation: scaleIn 0.6s ease forwards;
}

.animate.slide-in {
    animation: slideInRight 0.6s ease forwards;
}

/* Accessibility Improvements */
:focus {
    outline: 2px solid var(--primary-orange);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-orange);
    color: var(--white);
    padding: 8px 15px;
    transition: top 0.3s ease;
    z-index: 1003;
}

.skip-link:focus {
    top: 0;
}

[role="button"],
button {
    cursor: pointer;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading::before {
    content: '';
    width: 24px;
    height: 24px;
    border: 2px solid var(--primary-orange);
    border-top-color: transparent;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -12px 0 0 -12px;
    animation: spin 0.8s linear infinite;
    z-index: 1;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Tooltips */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-10px);
}
