/**
 * DIESELNET - Skeleton Loaders
 * Loading states pentru better UX
 */

/* ============================================ */
/* BASE SKELETON                               */
/* ============================================ */

.skeleton {
    background: linear-gradient(90deg,
            #f1f5f9 0%,
            #e2e8f0 50%,
            #f1f5f9 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* ============================================ */
/* SKELETON VARIANTS                           */
/* ============================================ */

/* Text Skeleton */
.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton-text.large {
    height: 24px;
}

.skeleton-text.small {
    height: 12px;
}

.skeleton-text.title {
    height: 32px;
    width: 60%;
    margin-bottom: 16px;
}

/* Avatar Skeleton */
.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-avatar.small {
    width: 32px;
    height: 32px;
}

.skeleton-avatar.large {
    width: 64px;
    height: 64px;
}

/* Image Skeleton */
.skeleton-image {
    width: 100%;
    height: 200px;
    border-radius: 12px;
}

.skeleton-image.square {
    aspect-ratio: 1;
    height: auto;
}

.skeleton-image.wide {
    height: 150px;
}

/* Button Skeleton */
.skeleton-button {
    height: 40px;
    width: 120px;
    border-radius: 8px;
}

.skeleton-button.large {
    height: 48px;
    width: 150px;
}

/* ============================================ */
/* SKELETON CARDS                              */
/* ============================================ */

.skeleton-card {
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.skeleton-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.skeleton-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-card-footer {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

/* ============================================ */
/* SKELETON LAYOUTS                            */
/* ============================================ */

/* List Skeleton */
.skeleton-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.skeleton-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.skeleton-list-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Grid Skeleton */
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

/* Table Skeleton */
.skeleton-table {
    width: 100%;
    border-collapse: collapse;
}

.skeleton-table-row {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.skeleton-table-cell {
    flex: 1;
}

/* ============================================ */
/* SPECIFIC COMPONENTS                         */
/* ============================================ */

/* Service Card Skeleton */
.skeleton-service-card {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.skeleton-service-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    margin-bottom: 16px;
}

/* Dashboard Card Skeleton */
.skeleton-dashboard-card {
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 16px;
}

.skeleton-dashboard-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
}

.skeleton-dashboard-content {
    flex: 1;
}

/* Chart Skeleton */
.skeleton-chart {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.skeleton-chart-header {
    margin-bottom: 20px;
}

.skeleton-chart-body {
    height: 300px;
    background: linear-gradient(90deg,
            #f1f5f9 0%,
            #e2e8f0 50%,
            #f1f5f9 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
    position: relative;
}

.skeleton-chart-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 100%;
    padding: 20px;
}

.skeleton-chart-bar {
    width: 30px;
    background: rgba(6, 182, 212, 0.2);
    border-radius: 4px 4px 0 0;
}

/* Timeline Skeleton */
.skeleton-timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 40px;
}

.skeleton-timeline-dot {
    position: absolute;
    left: 20px;
    top: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.skeleton-timeline-content {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* ============================================ */
/* PULSE ANIMATION (Alternative)               */
/* ============================================ */

.skeleton-pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ============================================ */
/* DARK MODE                                   */
/* ============================================ */

body.dark-mode .skeleton {
    background: linear-gradient(90deg,
            #1e293b 0%,
            #334155 50%,
            #1e293b 100%);
    background-size: 200% 100%;
}

body.dark-mode .skeleton-card,
body.dark-mode .skeleton-list-item,
body.dark-mode .skeleton-service-card,
body.dark-mode .skeleton-dashboard-card,
body.dark-mode .skeleton-chart,
body.dark-mode .skeleton-timeline-content {
    background: #1e293b;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

body.dark-mode .skeleton-card-footer,
body.dark-mode .skeleton-table-row {
    border-color: #334155;
}

/* ============================================ */
/* RESPONSIVE                                  */
/* ============================================ */

@media (max-width: 768px) {
    .skeleton-grid {
        grid-template-columns: 1fr;
    }

    .skeleton-dashboard-card {
        flex-direction: column;
        text-align: center;
    }

    .skeleton-chart-body {
        height: 200px;
    }
}

/* ============================================ */
/* UTILITY CLASSES                             */
/* ============================================ */

.skeleton-w-full {
    width: 100%;
}

.skeleton-w-75 {
    width: 75%;
}

.skeleton-w-50 {
    width: 50%;
}

.skeleton-w-25 {
    width: 25%;
}

.skeleton-h-4 {
    height: 16px;
}

.skeleton-h-6 {
    height: 24px;
}

.skeleton-h-8 {
    height: 32px;
}

.skeleton-h-12 {
    height: 48px;
}

.skeleton-rounded {
    border-radius: 8px;
}

.skeleton-rounded-full {
    border-radius: 9999px;
}

/* Hide content when loading */
.loading .content {
    display: none;
}

.loading .skeleton {
    display: block;
}

.content {
    display: block;
}

.skeleton {
    display: none;
}

.loading .skeleton {
    display: block;
}