/* Roam2Stay - CloudBeds-Inspired Calendar Loading Screen */

:root {
  /* Brand Colors */
  --primary-black: #000000;
  --main-text: #1D1D1F;
  --secondary-text: #6B7280;
  --subtle-text: #9CA3AF;
  --main-background: #FFFFFF;  /* Pure white background */
  --card-background: #FFFFFF;
  
  /* CloudBeds Calendar Colors */
  --teal: #14B8A6;
  --blue: #3B82F6;
  --orange: #F97316;
  --yellow: #FBBF24;
  --gray: #9CA3AF;
  
  /* Calendar Grid */
  --block-width: 80px;
  --block-height: 12px;
  --block-spacing: 4px;
  --grid-gap: 8px;
  --animation-duration: 3s;
}

/* Loading container */
.minimal-loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--main-background);
  z-index: 99999;
  opacity: 1;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.minimal-loading.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* Loading animation container */
.loading-animation {
  margin-bottom: 56px;
  position: relative;
}

/* Calendar grid container */
.calendar-grid {
  display: flex;
  flex-direction: column;
  gap: var(--grid-gap);
  padding: 24px;
  background: rgba(249, 250, 251, 0.5);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}

.calendar-grid::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.8) 50%, 
    transparent 100%);
  transform: translateX(-100%);
  animation: shimmer 2.5s ease-in-out infinite;
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

/* Calendar row */
.calendar-row {
  display: flex;
  gap: var(--block-spacing);
  align-items: center;
}

/* Calendar block */
.calendar-block {
  width: var(--block-width);
  height: var(--block-height);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateX(-20px);
  animation: slideInFade var(--animation-duration) cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Block colors */
.calendar-block.teal { background-color: var(--teal); }
.calendar-block.blue { background-color: var(--blue); }
.calendar-block.orange { background-color: var(--orange); }
.calendar-block.yellow { background-color: var(--yellow); }
.calendar-block.gray { background-color: var(--gray); opacity: 0.3; }

/* Staggered animation delays for calendar blocks */
.calendar-row:nth-child(1) .calendar-block:nth-child(1) { animation-delay: 0s; }
.calendar-row:nth-child(1) .calendar-block:nth-child(2) { animation-delay: 0.1s; }
.calendar-row:nth-child(1) .calendar-block:nth-child(3) { animation-delay: 0.2s; }
.calendar-row:nth-child(1) .calendar-block:nth-child(4) { animation-delay: 0.3s; }

.calendar-row:nth-child(2) .calendar-block:nth-child(1) { animation-delay: 0.1s; }
.calendar-row:nth-child(2) .calendar-block:nth-child(2) { animation-delay: 0.2s; }
.calendar-row:nth-child(2) .calendar-block:nth-child(3) { animation-delay: 0.3s; }
.calendar-row:nth-child(2) .calendar-block:nth-child(4) { animation-delay: 0.4s; }

.calendar-row:nth-child(3) .calendar-block:nth-child(1) { animation-delay: 0.2s; }
.calendar-row:nth-child(3) .calendar-block:nth-child(2) { animation-delay: 0.3s; }
.calendar-row:nth-child(3) .calendar-block:nth-child(3) { animation-delay: 0.4s; }
.calendar-row:nth-child(3) .calendar-block:nth-child(4) { animation-delay: 0.5s; }

@keyframes slideInFade {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Block animations */
.calendar-block::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.3) 50%, 
    transparent 100%);
  transform: translateX(-100%);
  opacity: 0;
  animation: blockShimmer 3s ease-in-out infinite;
  animation-delay: var(--shimmer-delay, 0s);
}

.calendar-block.teal::after { animation-delay: 0s; }
.calendar-block.blue::after { animation-delay: 0.5s; }
.calendar-block.orange::after { animation-delay: 1s; }
.calendar-block.yellow::after { animation-delay: 1.5s; }

@keyframes blockShimmer {
  0%, 100% { 
    opacity: 0;
    transform: translateX(-100%);
  }
  50% {
    opacity: 1;
    transform: translateX(100%);
  }
}

/* Pulsing animation for specific blocks */
.calendar-block.pulse {
  animation: slideInFade var(--animation-duration) cubic-bezier(0.4, 0, 0.2, 1) forwards,
            pulse 2s ease-in-out infinite;
  animation-delay: var(--block-delay), 1s;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Brand mark container */
.brand-mark {
  text-align: center;
  opacity: 0;
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  animation-delay: 0.3s;
}

.brand-icon {
  width: 72px;
  height: 72px;
  margin-bottom: 20px;
  opacity: 0.9;
}

.brand-wordmark {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--main-text);
  margin: 0;
  letter-spacing: -0.5px;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(-8px);
  }
}

/* Responsive adjustments */
@media (max-width: 480px) {
  :root {
    --block-width: 60px;
    --block-height: 10px;
    --block-spacing: 3px;
    --grid-gap: 6px;
  }
  
  .calendar-grid {
    padding: 16px;
  }
  
  .brand-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 16px;
  }
  
  .brand-wordmark {
    font-size: 20px;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .calendar-block {
    opacity: 0.2;
  }
  
  .calendar-block.gray {
    opacity: 0.4;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .calendar-block {
    animation: none;
    opacity: 1;
    transform: none;
  }
  
  .calendar-block::after,
  .calendar-grid::before {
    animation: none;
    display: none;
  }
  
  .brand-mark {
    animation: none;
    opacity: 1;
  }
}

/* Dark mode preparation */
@media (prefers-color-scheme: dark) {
  :root {
    --main-background: #FFFFFF;  /* Keep white background */
    --primary-black: #000000;
    --main-text: #1D1D1F;
    /* Slightly muted colors for dark mode */
    --teal: #0D9488;
    --blue: #2563EB;
    --orange: #EA580C;
    --yellow: #F59E0B;
    --gray: #6B7280;
  }
}

/* Ensure loading shows immediately */
.minimal-loading {
  display: none;
}

.minimal-loading.show {
  display: flex;
}