/* Custom Animations & Global Responsive Type */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

@media (min-width: 1024px) {
    html {
        font-size: 18px;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleCheck {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Staggered Animation Classes */
.animate-fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
    /* Start hidden */
}

/* Delay Utils */
.delay-0 {
    animation-delay: 0ms;
}

.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Checkbox Animation */
.checkbox-animate:checked+div {
    animation: scaleCheck 0.2s ease-out forwards;
}

/* Card Hover Effects */
.unit-card {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.unit-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.unit-card-img {
    transition: transform 0.5s ease;
}

.unit-card:hover .unit-card-img {
    transform: scale(1.08);
}

/* Comparison Panel Slide */
.panel-enter {
    transform: translate(-50%, -50%) scale(1) !important;
    opacity: 1 !important;
}

.backdrop-enter {
    opacity: 1 !important;
}

/* Filter Specifics */
.filter-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    -webkit-appearance: none;
    appearance: none;
}

/* --- Unit Comparison Full Implementation --- */
#compare-bar {
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#compare-bar.translate-y-0 {
    transform: translateY(0);
    opacity: 1;
}

#compare-modal #compare-backdrop {
    transition: opacity 0.3s ease;
    opacity: 0;
}

#compare-modal:not(.hidden) #compare-backdrop {
    opacity: 1;
}

#compare-modal #compare-panel {
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#compare-modal:not(.hidden) #compare-panel {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Sticky Column for Comparison Table */
.overflow-x-auto.scrollbar-thin {
    scrollbar-width: thin;
}

#compare-content td.sticky,
#compare-content th.sticky {
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.02);
}

[dir="rtl"] #compare-content td.sticky,
[dir="rtl"] #compare-content th.sticky {
    left: auto !important;
    right: 0 !important;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.02);
}

@media (max-width: 640px) {
    #compare-modal #compare-panel {
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: auto !important;
        width: 100vw !important;
        max-width: 100vw !important;
        border-radius: 0 0 24px 24px !important;
        /* Rounded corners at bottom */
        transform: translateY(-100%) !important;
        /* Start hidden above */
    }

    #compare-modal:not(.hidden) #compare-panel {
        transform: translateY(0) !important;
        left: 0 !important;
    }
}

.compare-checkbox {
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.compare-checkbox:checked {
    transform: scale(1.1);
}

#compare-avatars div {
    transition: all 0.3s ease;
}

#compare-avatars div:hover {
    transform: translateY(-4px) scale(1.1);
    z-index: 10;
}

#compare-content table {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}