.skeleton-btn {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  border: none;
  border-radius: 8px;
  cursor: default;
  /* not interactive */
  font-weight: bold;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  text-decoration: none;
  width: 112px;
  height: 40px;
  box-sizing: border-box;

  /* Shimmer effect */
  background: linear-gradient(90deg,
      rgba(0, 27, 46, 0.08) 0%,
      rgba(0, 27, 46, 0.15) 50%,
      rgba(0, 27, 46, 0.08) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite ease-in-out;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}


/* Skeleton card base – inherits glass-card dimensions, no hover */
.skeleton-card {
  position: relative;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 20px;
  box-shadow: 0 8px 32px 0 rgba(28, 20, 39, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-width: 350px;
  width: 100%;
  height: 620px;
  /* match glass-card height */
  direction: rtl;
  text-align: right;
  pointer-events: none;
  /* not interactive */
}

/* The shimmer effect */
.skeleton-block {
  background: linear-gradient(90deg,
      rgba(0, 27, 46, 0.06) 0%,
      rgba(0, 27, 46, 0.12) 40%,
      rgba(0, 27, 46, 0.06) 80%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite ease-in-out;
  border-radius: 8px;
}

/* Skeleton image placeholder */
.skeleton-img {
  width: 100%;
  height: 220px;
  /* matches card-img */
  background-color: rgba(0, 27, 46, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  animation: shimmer 1.8s infinite ease-in-out;
}

/* Ribbon skeleton */
.skeleton-ribbon {
  position: absolute;
  top: 15px;
  left: -5px;
  width: 80px;
  height: 26px;
  border-radius: 0 20px 20px 0;
  background: linear-gradient(90deg,
      rgba(0, 27, 46, 0.08) 0%,
      rgba(0, 27, 46, 0.15) 40%,
      rgba(0, 27, 46, 0.08) 80%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite ease-in-out;
}

/* Title placeholder */
.skeleton-title {
  height: 1.5rem;
  width: 70%;
  margin-bottom: 0.8rem;
}

/* Summary lines */
.skeleton-summary {
  height: 0.9rem;
  width: 100%;
  margin-bottom: 0.6rem;
}

.skeleton-summary.short {
  width: 60%;
}

/* Reward banner placeholder */
.skeleton-reward {
  height: 2.8rem;
  width: 100%;
  margin: 1rem 0;
  border-radius: 12px;
}

/* Meta info lines */
.skeleton-meta {
  height: 1rem;
  width: 80%;
  margin-bottom: 0.5rem;
}

/* Button placeholder */
.skeleton-btn {
  height: 2.8rem;
  width: 100%;
  border-radius: 12px;
  margin-top: auto;
  /* push to bottom of content */
}



.skeleton-text-display {
  width: 140px;
  height: 40px;
  border-radius: 20px;
  padding: 0.4rem 1rem;
  box-sizing: border-box;

  /* Shimmer effect */
  background: linear-gradient(90deg,
      rgba(0, 27, 46, 0.05) 0%,
      rgba(0, 27, 46, 0.12) 40%,
      rgba(0, 27, 46, 0.05) 80%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite ease-in-out;

  /* Keep the same border-radius as the original */
  border: none;
  pointer-events: none;
}


/* Skeleton wrapper – hides real content until loaded */
.ad-detail-container.loading .ad-info,
.ad-detail-container.loading .image-gallery {
  display: none;
}

.ad-detail-container.loading .detail-skeleton {
  display: grid;
}

/* Skeleton grid inside container */
.detail-skeleton {
  display: none;
  /* hidden by default */
  grid-template-columns: 1fr 1.3fr;
  gap: 2rem;
  width: 100%;
}

/* Image gallery skeleton */
.skeleton-gallery {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.skeleton-main-img {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 20px;
  background: linear-gradient(90deg,
      rgba(0, 27, 46, 0.06) 0%,
      rgba(0, 27, 46, 0.12) 40%,
      rgba(0, 27, 46, 0.06) 80%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite ease-in-out;
}

.skeleton-thumbnails {
  display: flex;
  gap: 0.8rem;
}

.skeleton-thumb {
  width: 70px;
  height: 70px;
  border-radius: 12px;
  background: linear-gradient(90deg,
      rgba(0, 27, 46, 0.06) 0%,
      rgba(0, 27, 46, 0.12) 40%,
      rgba(0, 27, 46, 0.06) 80%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite ease-in-out;
}

/* Info side skeletons */
.skeleton-info {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.skeleton-ribbon {
  width: 100px;
  height: 30px;
  border-radius: 0 20px 20px 0;
  background: linear-gradient(90deg,
      rgba(0, 27, 46, 0.08) 0%,
      rgba(0, 27, 46, 0.15) 40%,
      rgba(0, 27, 46, 0.08) 80%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite ease-in-out;
}

.skeleton-title {
  width: 80%;
  height: 2rem;
  border-radius: 8px;
  background: linear-gradient(90deg,
      rgba(0, 27, 46, 0.06) 0%,
      rgba(0, 27, 46, 0.12) 40%,
      rgba(0, 27, 46, 0.06) 80%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite ease-in-out;
}

.skeleton-text {
  width: 100%;
  height: 1rem;
  border-radius: 8px;
  background: linear-gradient(90deg,
      rgba(0, 27, 46, 0.06) 0%,
      rgba(0, 27, 46, 0.12) 40%,
      rgba(0, 27, 46, 0.06) 80%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite ease-in-out;
}

.skeleton-text.short {
  width: 60%;
}

.skeleton-reward {
  width: 100%;
  height: 3rem;
  border-radius: 12px;
  background: linear-gradient(90deg,
      rgba(248, 228, 98, 0.2) 0%,
      rgba(248, 228, 98, 0.35) 40%,
      rgba(248, 228, 98, 0.2) 80%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite ease-in-out;
}

.skeleton-meta {
  width: 80%;
  height: 1.2rem;
  border-radius: 8px;
  background: linear-gradient(90deg,
      rgba(0, 27, 46, 0.06) 0%,
      rgba(0, 27, 46, 0.12) 40%,
      rgba(0, 27, 46, 0.06) 80%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite ease-in-out;
}

.skeleton-btn {
  width: 150px;
  height: 2.8rem;
  border-radius: 12px;
  background: linear-gradient(90deg,
      rgba(248, 228, 98, 0.3) 0%,
      rgba(248, 228, 98, 0.5) 40%,
      rgba(248, 228, 98, 0.3) 80%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite ease-in-out;
}

/* Shimmer keyframe (same as before) */
@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Responsive: stack on mobile */
@media (max-width: 768px) {
  .detail-skeleton {
    grid-template-columns: 1fr;
  }
}

/* Skeleton blocks */
.skeleton-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(90deg,
      rgba(0, 27, 46, 0.08) 0%,
      rgba(0, 27, 46, 0.15) 40%,
      rgba(0, 27, 46, 0.08) 80%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite ease-in-out;
  margin: 0 auto 0.8rem;
}

.skeleton-name {
  width: 120px;
  height: 1.2rem;
  border-radius: 8px;
  margin: 0 auto 0.5rem;
  background: linear-gradient(90deg,
      rgba(0, 27, 46, 0.06) 0%,
      rgba(0, 27, 46, 0.12) 40%,
      rgba(0, 27, 46, 0.06) 80%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite ease-in-out;
}

.skeleton-phone {
  width: 100px;
  height: 0.9rem;
  border-radius: 8px;
  margin: 0 auto;
  background: linear-gradient(90deg,
      rgba(0, 27, 46, 0.06) 0%,
      rgba(0, 27, 46, 0.12) 40%,
      rgba(0, 27, 46, 0.06) 80%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite ease-in-out;
}

.skeleton-nav-btn {
  width: 100%;
  height: 44px;
  border-radius: 12px;
  margin-bottom: 0.5rem;
  background: linear-gradient(90deg,
      rgba(0, 27, 46, 0.06) 0%,
      rgba(0, 27, 46, 0.12) 40%,
      rgba(0, 27, 46, 0.06) 80%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite ease-in-out;
}

/* Hide real content initially */
.user-profile-brief.loading,
.dash-nav-buttons.loading {
  display: none;
}

/* Skeleton containers */
.profile-skeleton,
.nav-buttons-skeleton {
  display: none;
}

.profile-skeleton.active,
.nav-buttons-skeleton.active {
  display: flex;
  flex-direction: column;
  align-items: center;
}


/* Settings form skeleton */
.settings-skeleton {
  display: none;
  flex-direction: column;
  gap: 1.5rem;
}

.settings-skeleton.active {
  display: flex;
}

.skeleton-form-row {
  display: flex;
  gap: 10px;
}

.skeleton-input {
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(90deg,
      rgba(0, 27, 46, 0.06) 0%,
      rgba(0, 27, 46, 0.12) 40%,
      rgba(0, 27, 46, 0.06) 80%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite ease-in-out;
  flex: 1;
}

.skeleton-input.small {
  max-width: 100px;
  flex: none;
}

.skeleton-input.disabled {
  opacity: 0.6;
}

.skeleton-label {
  width: 80px;
  height: 0.85rem;
  border-radius: 6px;
  margin-bottom: 0.4rem;
  background: linear-gradient(90deg,
      rgba(0, 27, 46, 0.05) 0%,
      rgba(0, 27, 46, 0.1) 40%,
      rgba(0, 27, 46, 0.05) 80%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite ease-in-out;
}

.skeleton-save-btn {
  width: 150px;
  height: 44px;
  border-radius: 8px;
  align-self: flex-start;
  margin-top: 0.5rem;
  background: linear-gradient(90deg,
      rgba(248, 228, 98, 0.3) 0%,
      rgba(248, 228, 98, 0.5) 40%,
      rgba(248, 228, 98, 0.3) 80%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite ease-in-out;
}

/* Hide real form while loading */
.settings-form.loading {
  display: none;
}

/* ========================================= */
/* Skeleton Loading Animations               */
/* ========================================= */

/* The base breathing animation */
@keyframes skeletonPulse {
  0% {
    background-color: rgba(0, 27, 46, 0.05);
  }

  50% {
    background-color: rgba(0, 27, 46, 0.15);
  }

  100% {
    background-color: rgba(0, 27, 46, 0.05);
  }
}

/* Light breathing animation for received messages (since they are white in your UI) */
@keyframes skeletonPulseLight {
  0% {
    background-color: rgba(255, 255, 255, 0.4);
  }

  50% {
    background-color: rgba(255, 255, 255, 0.8);
  }

  100% {
    background-color: rgba(255, 255, 255, 0.4);
  }
}

/* Apply base animation */
.skeleton-box {
  animation: skeletonPulse 1.5s infinite ease-in-out;
}

/* Specific component shaping */
.skeleton-avatar-sm {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.skeleton-msg {
  border-radius: 16px;
}

/* Match the exact border-radius logic of your real messages */
.skeleton-msg.received {
  border-bottom-right-radius: 4px;
  animation: skeletonPulse 1.5s infinite ease-in-out;
  border: 1px solid rgba(0, 27, 46, 0.02);
}

.skeleton-msg.sent {
  border-bottom-left-radius: 4px;
}



/* ========================================= */
/* Light Theme Skeleton Loading Animation */
/* ========================================= */

/* Main Card Wrapper */
.ad-skel-card {
    display: flex;
    flex-direction: row; 
    background: #ffffff; /* Solid white background matching your new cards */
    border-radius: 12px;
    padding: 0;
    margin-bottom: 1rem;
    overflow: hidden;
    position: relative;
    pointer-events: none; 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03); /* Soft shadow */
    height: 140px; /* Fix height to prevent layout jumping */
}

/* Base style for all skeleton shapes */
.ad-skel-box {
    background: #e5e7eb; /* Soft gray placeholder */
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

/* The Bright Shimmer Gradient */
.ad-skel-box::after {
    content: "";
    position: absolute;
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    transform: translateX(-100%);
    animation: ad-shimmer 1.5s infinite;
}

@keyframes ad-shimmer {
    100% { transform: translateX(100%); }
}

/* 1. Image Placeholder (Right side) */
.ad-skel-img {
    width: 140px;
    min-width: 140px;
    height: 100%;
    border-radius: 0; /* Sharp corners on the inside, matches the image wrapper */
}

/* 2. Top-Left Badge Placeholder */
.ad-skel-badge {
    position: absolute;
    top: 0;
    left: 0;
    width: 80px;
    height: 28px;
    border-radius: 12px 0 12px 0; /* Matches the ribbon curve */
    z-index: 2;
}

/* 3. Text Content Area (Left side) */
.ad-skel-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 0.75rem;
}

.ad-skel-title { width: 50%; height: 18px; border-radius: 6px; }
.ad-skel-subtitle { width: 30%; height: 12px; border-radius: 4px; }

/* Meta Info Placeholder (Pushed to bottom) */
.ad-skel-meta-wrapper {
    display: flex;
    gap: 1rem;
    margin-top: auto; 
}

.ad-skel-meta { width: 70px; height: 12px; border-radius: 4px; }



/* ========================================= */
/* Category Dropdown Skeleton State */
/* ========================================= */

.category-dropdown.is-loading {
    position: relative;
    overflow: hidden;
    pointer-events: none; /* Prevents clicking while loading */
    background: #f3f4f6; /* Soft gray base */
    border-color: transparent;
}

/* The sweeping shimmer gradient */
.category-dropdown.is-loading::after {
    content: "";
    position: absolute;
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    transform: translateX(-100%);
    /* Reuses the animation you created for the ad cards! */
    animation: ad-shimmer 1.5s infinite; 
    border-radius: 50px;
}

/* Fade out the text and hide the chevron while loading */
.category-dropdown.is-loading .clean-select {
    color: #9ca3af; 
}

.category-dropdown.is-loading .dropdown-chevron {
    opacity: 0.3;
}