/* ===== SKELETON LOADING STYLES ===== */

/* Base skeleton animation */
@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Base skeleton class */
.skeleton {
    background: linear-gradient(90deg,
            #f0f0f0 25%,
            #e0e0e0 50%,
            #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

/* Dark mode support */
.dark .skeleton {
    background: linear-gradient(90deg #1a1a1a 25%,
            #2a2a2a 50%,
            #1a1a1a 75%);
}

/* Skeleton variants */
.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
    border-radius: 4px;
}

.skeleton-title {
    height: 1.5em;
    width: 60%;
    margin-bottom: 0.75em;
    border-radius: 6px;
}

.skeleton-subtitle {
    height: 1.2em;
    width: 40%;
    margin-bottom: 0.5em;
    border-radius: 4px;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-avatar-lg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
}

.skeleton-card {
    height: 300px;
    border-radius: 16px;
}

.skeleton-stat {
    height: 120px;
    border-radius: 12px;
}

.skeleton-stat-sm {
    height: 80px;
    border-radius: 12px;
}

.skeleton-button {
    height: 48px;
    width: 120px;
    border-radius: 12px;
}

.skeleton-input {
    height: 48px;
    border-radius: 12px;
}

.skeleton-image {
    width: 100%;
    padding-bottom: 66.67%;
    /* 3:2 aspect ratio */
    border-radius: 12px;
}

.skeleton-image-square {
    width: 100%;
    padding-bottom: 100%;
    border-radius: 12px;
}

.skeleton-table-row {
    height: 60px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.skeleton-chart {
    height: 300px;
    border-radius: 12px;
}

.skeleton-calendar {
    height: 400px;
    border-radius: 16px;
}

/* Skeleton pulse (alternative animation) */
.skeleton-pulse {
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Fade out animation for skeleton */
.skeleton-fadeout {
    animation: skeleton-fadeout 300ms ease-out forwards;
}

@keyframes skeleton-fadeout {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

/* Container for skeleton groups */
.skeleton-container {
    padding: 1rem;
}

/* Specific component skeletons */

/* Car card skeleton */
.skeleton-car-card {
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Booking card skeleton */
.skeleton-booking-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Request row skeleton */
.skeleton-request-row {
    background: white;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #e5e7eb;
}

/* Agency card skeleton */
.skeleton-agency-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Grid layouts */
.skeleton-grid-1 {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.5rem;
}

.skeleton-grid-2 {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.5rem;
}

.skeleton-grid-3 {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.5rem;
}

.skeleton-grid-4 {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .skeleton-grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .skeleton-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .skeleton-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .skeleton-grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .skeleton-grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Accessibility */
.skeleton[aria-busy="true"] {
    cursor: wait;
}

/* RTL support */
[dir="rtl"] .skeleton {
    background: linear-gradient(-90deg,
            #f0f0f0 25%,
            #e0e0e0 50%,
            #f0f0f0 75%);
}

[dir="rtl"] .dark .skeleton {
    background: linear-gradient(-90deg,
            #1a1a1a 25%,
            #2a2a2a 50%,
            #1a1a1a 75%);
}

/* Utility classes */
.skeleton-hidden {
    display: none;
}

.skeleton-visible {
    display: block;
}