/* Skeleton shimmer — preloader is shown normally and hidden by each page's JS */

.skeleton {
    background: #E2E8F0;
    background: linear-gradient(110deg, #E2E8F0 8%, #F1F5F9 18%, #E2E8F0 33%);
    background-size: 200% 100%;
    animation: shimmerWave 1.4s infinite linear;
    border-radius: 8px;
    display: inline-block;
}

:root.dark-theme .skeleton,
body.theme-dark .skeleton,
.dark-theme .skeleton {
    background: #1E293B;
    background: linear-gradient(110deg, #1E293B 8%, #334155 18%, #1E293B 33%);
    background-size: 200% 100%;
}

@keyframes shimmerWave {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Bus Card Skeleton */
.skeleton-bus-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    animation: fadeIn 0.3s ease;
}

.skeleton-header-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.skeleton-avatar {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    flex-shrink: 0;
}

.skeleton-info-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-title {
    width: 60%;
    height: 16px;
    border-radius: 6px;
}

.skeleton-subtitle {
    width: 40%;
    height: 12px;
    border-radius: 4px;
}

.skeleton-badge {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    width: 64px;
    height: 20px;
    border-radius: 20px;
    margin-left: auto;
}

.skeleton-details-box {
    background: var(--surface);
    border-radius: 12px;
    padding: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.skeleton-line {
    width: 80%;
    height: 12px;
    border-radius: 4px;
}

.skeleton-btn-row {
    display: flex;
    gap: 8px;
}

.skeleton-btn {
    flex: 1;
    height: 40px;
    border-radius: 11px;
}

/* Fade in smooth content reveal */
.content-fade-in {
    animation: contentFadeIn 0.35s ease forwards;
}

@keyframes contentFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}


/* Schedule Card Skeleton */
.skeleton-schedule-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 16px);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
    border-left: 3.5px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 12px;
    box-sizing: border-box;
}

.skeleton-sched-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.skeleton-sched-route {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.skeleton-sched-icon {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    flex-shrink: 0;
}

.skeleton-sched-title {
    height: 16px;
    border-radius: 6px;
}

.skeleton-sched-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.skeleton-sched-badge {
    width: 48px;
    height: 20px;
    border-radius: 100px;
    flex-shrink: 0 !important;
}

.skeleton-sched-dep-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px dashed var(--border);
    padding-top: 10px;
}

.skeleton-sched-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    background: var(--surface);
    border-radius: 8px;
}

.skeleton-sched-time {
    width: 65px;
    height: 14px;
    border-radius: 4px;
}

.skeleton-sched-bus {
    width: 65px;
    height: 22px;
    border-radius: 100px;
}

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
    .skeleton {
        animation: none !important;
        background: #E2E8F0 !important;
    }
    :root.dark-theme .skeleton,
    body.theme-dark .skeleton,
    .dark-theme .skeleton {
        background: #1E293B !important;
    }
}

/* Mobile breakpoints hierarchy (Section 1 standard) */
@media (max-width: 480px) {
    .skeleton-schedule-card {
        padding: 12px 14px !important;
        border-radius: 14px !important;
    }
    .skeleton-sched-row {
        padding: 5px 7px !important;
    }
}
@media (max-width: 360px) {
    .skeleton-schedule-card {
        padding: 10px 12px !important;
    }
}