/* ================================================
   LOMRA MAIL - Skeleton Loading Styles
   ================================================ */

/* Base skeleton animation */
@keyframes skeleton-loading {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 0px,
    var(--bg-secondary) 40px,
    var(--bg-tertiary) 80px
  );
  background-size: 200px 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

/* Skeleton email item */
.skeleton-email-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.skeleton-checkbox {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-sm);
}

.skeleton-star {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.skeleton-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.skeleton-sender {
  width: 120px;
  height: 16px;
}

.skeleton-time {
  width: 60px;
  height: 14px;
}

.skeleton-subject {
  width: 80%;
  height: 16px;
}

.skeleton-preview {
  width: 100%;
  height: 14px;
}

.skeleton-preview-short {
  width: 60%;
  height: 14px;
}

/* Skeleton email view */
.skeleton-email-view {
  padding: 24px;
}

.skeleton-email-header {
  margin-bottom: 24px;
}

.skeleton-title {
  width: 70%;
  height: 28px;
  margin-bottom: 16px;
}

.skeleton-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.skeleton-meta-text {
  flex: 1;
}

.skeleton-name {
  width: 150px;
  height: 18px;
  margin-bottom: 6px;
}

.skeleton-email {
  width: 200px;
  height: 14px;
}

.skeleton-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.skeleton-line {
  height: 16px;
}

.skeleton-line-full {
  width: 100%;
}

.skeleton-line-long {
  width: 90%;
}

.skeleton-line-medium {
  width: 75%;
}

.skeleton-line-short {
  width: 50%;
}

/* Skeleton sidebar counts */
.skeleton-badge {
  width: 24px;
  height: 20px;
  border-radius: 10px;
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.loading-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  margin-top: 16px;
  color: var(--text-secondary);
  font-size: 14px;
}

/* Pulse animation for buttons */
.btn-loading {
  position: relative;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-left: -10px;
  margin-top: -10px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Empty state with skeleton */
.skeleton-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.skeleton-empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin-bottom: 16px;
}

.skeleton-empty-text {
  width: 200px;
  height: 20px;
  margin-bottom: 8px;
}

.skeleton-empty-subtext {
  width: 280px;
  height: 16px;
}
