/* Skeleton Animation Base */
.skeleton {
    background: linear-gradient(-90deg, #e9ecef 0%, #dee2e6 50%, #e9ecef 100%) !important;
    background-size: 400% 400% !important;
    animation: skeleton-loading 2s ease-in-out infinite !important;
    border-radius: 4px;
    min-height: 1rem;
    display: block;
    position: relative;
    overflow: hidden;
}

.skeleton::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(-90deg, transparent 0%, rgba(255,255,255,0.6) 50%, transparent 100%);
    animation: skeleton-shimmer 2s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes skeleton-shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Dark theme support with lighter colors */
[data-bs-theme="dark"] .skeleton,
.dark .skeleton,
html[data-theme="dark"] .skeleton,
body.dark .skeleton {
    background: linear-gradient(-90deg, #4a4a4a 0%, #5a5a5a 50%, #4a4a4a 100%) !important;
    background-size: 400% 400% !important;
    animation: skeleton-loading 2s ease-in-out infinite !important;
}

[data-bs-theme="dark"] .skeleton::after,
.dark .skeleton::after,
html[data-theme="dark"] .skeleton::after,
body.dark .skeleton::after {
    background: linear-gradient(-90deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%);
}

/* Text Skeleton Variants */
.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
    display: block;
    width: 100%;
}

.skeleton-title {
    height: 2rem;
    width: 200px;
}

.skeleton-subtitle {
    height: 1rem;
    width: 320px;
}

.skeleton-account-label {
    height: 0.875rem;
    width: 150px;
}

.skeleton-account-name {
    height: 1.125rem;
    width: 200px;
}

.skeleton-small {
    height: 0.75rem;
    width: 120px;
}

.skeleton-medium {
    height: 1.25rem;
    width: 180px;
}

/* Widget Skeleton */
.skeleton-widget {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    min-height: 100px;
}

.skeleton-widget-full {
    min-height: 80px;
}

.skeleton-widget-half {
    min-height: 120px;
}

.skeleton-widget-header {
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #e9ecef;
}

.skeleton-widget-content {
    flex: 1;
}

/* Specific Component Skeletons */
.skeleton-button {
    height: 3rem;
    border-radius: 0.375rem;
    display: block;
    width: 100%;
}

.skeleton-metric {
    height: 4rem;
    border-radius: 0.375rem;
    display: block;
    width: 100%;
}

.skeleton-metric-value {
    height: 2rem;
    width: 80px;
}

.skeleton-selector {
    height: 2.5rem;
    border-radius: 0.375rem;
    display: block;
    width: 100%;
}

.skeleton-list-item {
    height: 1.5rem;
    border-radius: 0.25rem;
    display: block;
    width: 100%;
}

.skeleton-alert {
    height: 3rem;
    width: 250px;
    border-radius: 0.375rem;
    display: block;
}

.skeleton-circle {
    height: 2rem;
    width: 2rem;
    border-radius: 50%;
}

.skeleton-step-label {
    height: 0.875rem;
    width: 60px;
    margin-top: 0.25rem;
}

.skeleton-wizard-title {
    height: 1.5rem;
    width: 300px;
    margin: 0 auto;
}

.skeleton-wizard-subtitle {
    height: 1rem;
    width: 400px;
    margin: 0 auto;
}

.skeleton-option-box {
    height: 8rem;
    border-radius: 0.75rem;
    display: block;
    width: 100%;
}

.skeleton-order-id {
    height: 1rem;
    width: 80px;
}

.skeleton-date {
    height: 1rem;
    width: 90px;
}

.skeleton-status {
    height: 1rem;
    width: 70px;
}

.skeleton-price {
    height: 1rem;
    width: 100px;
}

.skeleton-image {
    height: 3rem;
    width: 3rem;
    border-radius: 0.375rem;
}

.skeleton-item-name {
    height: 1rem;
    width: 140px;
}

/* Widget backgrounds - light theme */
.skeleton-widget {
    background: #fff !important;
    border-color: #dee2e6 !important;
}

.skeleton-widget-header {
    border-bottom-color: #e9ecef !important;
}

/* Widget backgrounds - dark theme */
[data-bs-theme="dark"] .skeleton-widget,
.dark .skeleton-widget,
html[data-theme="dark"] .skeleton-widget,
body.dark .skeleton-widget {
    background: #2a2a2a !important;
    border-color: #404040 !important;
}

[data-bs-theme="dark"] .skeleton-widget-header,
.dark .skeleton-widget-header,
html[data-theme="dark"] .skeleton-widget-header,
body.dark .skeleton-widget-header {
    border-bottom-color: #404040 !important;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .skeleton-title {
        width: 150px;
    }
    
    .skeleton-subtitle {
        width: 250px;
    }
    
    .skeleton-alert {
        display: none !important;
    }
}

/* Staggered animation delays for more realistic loading */
.skeleton:nth-child(1) { animation-delay: 0s; }
.skeleton:nth-child(2) { animation-delay: 0.1s; }
.skeleton:nth-child(3) { animation-delay: 0.2s; }
.skeleton:nth-child(4) { animation-delay: 0.3s; }
.skeleton:nth-child(5) { animation-delay: 0.4s; }
.skeleton:nth-child(6) { animation-delay: 0.5s; }

/* Widget staggered delays */
.skeleton-widget:nth-child(1) .skeleton { animation-delay: 0s; }
.skeleton-widget:nth-child(2) .skeleton { animation-delay: 0.1s; }
.skeleton-widget:nth-child(3) .skeleton { animation-delay: 0.2s; }
.skeleton-widget:nth-child(4) .skeleton { animation-delay: 0.3s; }
.skeleton-widget:nth-child(5) .skeleton { animation-delay: 0.4s; }
.skeleton-widget:nth-child(6) .skeleton { animation-delay: 0.5s; }