/* ===================================
   SKELETON LOADING - CSS GLOBAL
   Carregado em todas as páginas para
   suportar navegação AJAX de tickets
   =================================== */

/* Animação de shimmer */
@keyframes skeleton-shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

/* Base de todos os elementos skeleton */
.skeleton-bone {
    background: linear-gradient(
        90deg,
        var(--skeleton-base, rgba(200, 200, 200, 0.2)) 25%,
        var(--skeleton-shine, rgba(200, 200, 200, 0.4)) 50%,
        var(--skeleton-base, rgba(200, 200, 200, 0.2)) 75%
    );
    background-size: 1000px 100%;
    animation: skeleton-shimmer 1.8s ease-in-out infinite;
    border-radius: 6px;
}

/* Variantes de tema */
[data-theme="dark"] .skeleton-bone {
    --skeleton-base: rgba(55, 65, 81, 0.3);
    --skeleton-shine: rgba(75, 85, 99, 0.5);
}

/* ===================================
   BARRA DE PROGRESSO NO TOPO
   =================================== */
.ajax-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 50%, #3b82f6 100%);
    background-size: 200% 100%;
    z-index: 9999;
    transition: width 0.4s ease;
    animation: progress-gradient 1.5s ease infinite;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

@keyframes progress-gradient {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* ===================================
   CONTAINER DO SKELETON LOADER
   =================================== */
.skeleton-ticket-loader {
    width: 95%;
    max-width: 95%;
    margin: 0 auto;
    padding: 2.5rem 0;
    animation: fadeInSkeleton 0.2s ease-out;
}

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

/* ===================================
   SKELETON - HEADER DO TICKET
   =================================== */
.skeleton-ticket-header {
    background: var(--bg-card, white);
    border-radius: 12px;
    padding: 24px 40px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color, #e5e7eb);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

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

.skeleton-ticket-header .skeleton-row:last-child {
    margin-bottom: 0;
}

[data-theme="dark"] .skeleton-ticket-header {
    background: var(--bg-card, #1f2937);
    border-color: var(--border-color, #374151);
}

/* ===================================
   SKELETON - GRID DE CONTEÚDO
   =================================== */
.skeleton-ticket-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .skeleton-ticket-grid {
        grid-template-columns: 1fr;
    }
}

/* ===================================
   SKELETON - CARDS GENÉRICOS
   =================================== */
.skeleton-card {
    background: var(--bg-card, white);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border-color, #e5e7eb);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    margin-bottom: 20px;
}

[data-theme="dark"] .skeleton-card {
    background: var(--bg-card, #1f2937);
    border-color: var(--border-color, #374151);
}

.skeleton-card-title {
    height: 20px;
    width: 40%;
    margin-bottom: 20px;
}

/* ===================================
   SKELETON - LINHAS DE TEXTO
   =================================== */
.skeleton-text-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-text-line {
    height: 14px;
    border-radius: 4px;
}

.skeleton-text-line:nth-child(1) { width: 95%; }
.skeleton-text-line:nth-child(2) { width: 88%; }
.skeleton-text-line:nth-child(3) { width: 72%; }
.skeleton-text-line:nth-child(4) { width: 80%; }
.skeleton-text-line:nth-child(5) { width: 60%; }

/* ===================================
   SKELETON - ANEXOS
   =================================== */
.skeleton-attachments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.skeleton-attachment {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 8px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #e5e7eb);
    background: var(--bg-surface, #f9fafb);
}

[data-theme="dark"] .skeleton-attachment {
    background: rgba(55, 65, 81, 0.2);
    border-color: var(--border-color, #374151);
}

.skeleton-attachment-icon {
    width: 36px;
    height: 36px;
    border-radius: 6px;
}

.skeleton-attachment-name {
    width: 80%;
    height: 12px;
    border-radius: 3px;
}

/* ===================================
   SKELETON - MENSAGENS
   =================================== */
.skeleton-message {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.skeleton-message:last-child {
    border-bottom: none;
}

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

.skeleton-message-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

/* ===================================
   SKELETON - SIDEBAR INFO
   =================================== */
.skeleton-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.skeleton-info-row:last-child {
    border-bottom: none;
}

/* ===================================
   TRANSIÇÃO DE CONTEÚDO
   =================================== */
.ajax-content-enter {
    animation: contentEnter 0.3s ease-out forwards;
}

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

.ajax-content-exit {
    animation: contentExit 0.15s ease-in forwards;
}

@keyframes contentExit {
    from { opacity: 1; }
    to { opacity: 0; }
}
