/* Loading Skeleton Animations */

/* Base skeleton class */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

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

/* Text skeleton */
.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    width: 100%;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-text.medium {
    width: 80%;
}

/* Title skeleton */
.skeleton-title {
    height: 20px;
    margin-bottom: 12px;
    width: 40%;
}

/* Block skeleton */
.skeleton-block {
    height: 80px;
    margin-bottom: 10px;
}

/* Circle skeleton (for icons/avatars) */
.skeleton-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* Button skeleton */
.skeleton-button {
    height: 36px;
    width: 100px;
    border-radius: 5px;
}

/* Subsystem skeleton */
.skeleton-subsystem {
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 5px;
}

.skeleton-subsystem .skeleton-title {
    margin-bottom: 10px;
}

.skeleton-subsystem .skeleton-data {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.skeleton-subsystem .skeleton-label {
    height: 14px;
    width: 120px;
}

.skeleton-subsystem .skeleton-value {
    height: 14px;
    width: 80px;
}

/* Data panel skeleton */
.skeleton-data-panel {
    padding: 20px;
}

.skeleton-data-panel .skeleton-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.skeleton-data-panel .skeleton-icon {
    width: 50px;
    height: 50px;
    border-radius: 8px;
}

.skeleton-data-panel .skeleton-info {
    flex: 1;
}

/* Timeline skeleton */
.skeleton-timeline {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
}

.skeleton-timeline .skeleton-step {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.skeleton-timeline .skeleton-line {
    flex: 1;
    height: 4px;
    border-radius: 2px;
}

/* Graph skeleton */
.skeleton-graph {
    height: 200px;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.skeleton-graph::after {
    content: '';
    position: absolute;
    bottom: 30px;
    left: 50px;
    right: 20px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
}

/* Table skeleton */
.skeleton-table {
    width: 100%;
}

.skeleton-table .skeleton-row {
    display: flex;
    gap: 15px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.skeleton-table .skeleton-cell {
    height: 16px;
    flex: 1;
}

.skeleton-table .skeleton-cell:first-child {
    flex: 2;
}

/* Chat skeleton */
.skeleton-chat-message {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.skeleton-chat-message .skeleton-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-chat-message .skeleton-bubble {
    flex: 1;
    max-width: 70%;
}

.skeleton-chat-message .skeleton-bubble .skeleton-text {
    margin-bottom: 5px;
}

.skeleton-chat-message.outgoing {
    flex-direction: row-reverse;
}

/* Keyboard focus styles */
.keyboard-focused {
    outline: 2px solid var(--medium-light-color, #4a90d9);
    outline-offset: 2px;
}

/* Keyboard help dialog */
.keyboard-help {
    padding: 10px;
}

.keyboard-help h3 {
    margin-bottom: 15px;
    font-size: 18px;
}

.keyboard-help table {
    width: 100%;
    border-collapse: collapse;
}

.keyboard-help td {
    padding: 8px 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.keyboard-help td:first-child {
    width: 100px;
}

.keyboard-help kbd {
    display: inline-block;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
}

/* Utility class to hide skeleton when content loads */
.skeleton-loaded .skeleton {
    display: none;
}

/* Pulse animation variant */
.skeleton-pulse {
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
    0%, 100% {
        opacity: 0.4;
    }
    50% {
        opacity: 0.8;
    }
}
