/* ============================================================
   RAFFLES HISTORY STYLING - Enhanced Design
   ============================================================ */

/* History Section Container */
.rf-history {
  background: none;
  border-radius: 1.5rem;
  padding: 2.5rem 1.5rem;
  margin: 3rem auto;
  max-width: 62rem;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.rf-history::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 30%, rgba(255, 215, 0, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255, 68, 68, 0.08) 0%, transparent 50%);
  pointer-events: none;
  z-index: 1;
}

.rf-history * {
  position: relative;
  z-index: 2;
}

/* History Title */
.rf-history .rf-subtitle {
  text-align: center !important;
  color: #fff;
  font-size: 2.5rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.15rem;
  margin-bottom: 2.5rem;
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FF6B6B 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 2rem rgba(255, 215, 0, 0.3);
  animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
  0% {
    filter: drop-shadow(0 0 1rem rgba(255, 215, 0, 0.5));
  }
  100% {
    filter: drop-shadow(0 0 2rem rgba(255, 215, 0, 0.8));
  }
}

/* History Grid */
.rf-grid--history {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

/* History Cards */
.rf-card--history {
  background: linear-gradient(135deg, 
    rgba(255,106,61,0.1) 0%, 
    rgba(255,211,107,0.05) 50%, 
    rgba(255,61,184,0.1) 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1rem;
  padding: 1.5rem;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.3);
}

.rf-card--history::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255, 215, 0, 0.1) 50%, 
    transparent 100%);
  transition: left 0.6s ease;
  z-index: 1;
}

.rf-card--history:hover::before {
  left: 100%;
}

.rf-card--history:hover {
  transform: translateY(-0.5rem) scale(1.02);
  border-color: rgba(255, 138, 0, 0.5);
  box-shadow: 
    0 1rem 2rem rgba(0, 0, 0, 0.3),
    0 0 2rem rgba(255, 138, 0, 0.2);
}

.rf-card--history * {
  position: relative;
  z-index: 2;
}

/* History Badge */
.rf-badge--muted {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% {
    box-shadow: 0 0 0.5rem rgba(102, 126, 234, 0.3);
  }
  50% {
    box-shadow: 0 0 1rem rgba(102, 126, 234, 0.6);
  }
}

/* History Title */
.rf-title--history {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.3;
  transition: color 0.3s ease;
}

.rf-card--history:hover .rf-title--history {
  color: #ff8a00;
}

/* Winners Section */
.rf-winners {
  margin: 1.5rem 0;
}

.rf-winners-title {
  color: #ff8a00;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
}

.rf-winner-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.rf-winner-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.rf-winner-item:hover {
  background: rgba(255, 138, 0, 0.1);
  padding-left: 0.5rem;
  border-radius: 0.5rem;
}

.rf-winner-name {
  color: #fff;
  font-weight: 500;
  flex: 1;
}

.rf-winner-prize {
  color: #ff8a00;
  font-size: 0.875rem;
  font-weight: 600;
  background: rgba(255, 138, 0, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 0.5rem;
}

/* Result Pills */
.rf-result {
  margin-top: 1rem;
}

.rf-pill {
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
  display: inline-block;
  transition: all 0.3s ease;
}

.rf-pill-ok {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: #000;
  font-weight: 700;
  animation: goldenGlow 2s ease-in-out infinite alternate;
}

.rf-pill-warn {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: #000;
  font-weight: 700;
  animation: goldenPulse 3s ease-in-out infinite;
}

@keyframes goldenGlow {
  0% {
    box-shadow: 0 0 0.5rem rgba(255, 215, 0, 0.4);
  }
  100% {
    box-shadow: 0 0 1rem rgba(255, 215, 0, 0.8);
  }
}

@keyframes goldenPulse {
  0%, 100% {
    box-shadow: 0 0 0.5rem rgba(255, 215, 0, 0.3);
  }
  50% {
    box-shadow: 0 0 1rem rgba(255, 215, 0, 0.7);
  }
}

/* More Details */
.rf-more {
  margin-top: 1rem;
}

.rf-more summary {
  color: #ff8a00;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
  list-style: none;
}

.rf-more summary:hover {
  background: rgba(255, 138, 0, 0.1);
  color: #ff8a00;
}

.rf-more summary::marker {
  display: none;
}

.rf-more summary::before {
  content: "ÔûÂ";
  margin-right: 0.5rem;
  transition: transform 0.3s ease;
}

.rf-more[open] summary::before {
  transform: rotate(90deg);
}

/* Responsive Design */
@media (max-width: 768px) {
  .rf-history {
    padding: 1.5rem 1rem;
    margin: 2rem 0;
  }
  
  .rf-history .rf-subtitle {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
  }
  
  .rf-grid--history {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .rf-card--history {
    padding: 1rem;
  }
  
  .rf-card--history:hover {
    transform: translateY(-0.25rem) scale(1.01);
  }
  
  .rf-title--history {
    font-size: 1.125rem;
  }
}

@media (max-width: 480px) {
  .rf-history {
    padding: 1rem 0.75rem;
    border-radius: 1rem;
  }
  
  .rf-history .rf-subtitle {
    font-size: 1.5rem;
  }
  
  .rf-winner-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .rf-winner-prize {
    align-self: flex-end;
  }
}

/* Loading Animation */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.rf-card--history.loading {
  background: linear-gradient(90deg, 
    rgba(255, 255, 255, 0.05) 25%, 
    rgba(255, 255, 255, 0.1) 50%, 
    rgba(255, 255, 255, 0.05) 75%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}
