/* ============================================================
   SAGANORDIK SLOT MODULE - NORDISK SAGA FANTASY STYLE
   Tema: runer, lysfragmenter, nordlys-ikoner, natursymboler
   ============================================================ */

/* Slot Container - Mystisk Saga Style */
.saga-slot {
  background: linear-gradient(135deg, #1B2631 0%, #2E5BBA 50%, #4A90E2 100%);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  margin: var(--spacing-lg) auto;
  max-width: 400px;
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
  border: 2px solid var(--rune-glow);
  position: relative;
  overflow: hidden;
}

.saga-slot::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="nordic-runes" x="0" y="0" width="25" height="25" patternUnits="userSpaceOnUse"><text x="12.5" y="18" font-family="serif" font-size="14" fill="rgba(0,212,255,0.1)" text-anchor="middle">ᚱᚢᚾᛖ</text></pattern></defs><rect width="100" height="100" fill="url(%23nordic-runes)"/></svg>');
  opacity: 0.1;
  animation: runePattern 15s linear infinite;
}

@keyframes runePattern {
  0% { transform: translateX(0) translateY(0); }
  100% { transform: translateX(-25px) translateY(-25px); }
}

/* Slot Title - Saga Style */
.saga-slot__title {
  font-family: var(--font-saga);
  font-size: 1.4rem;
  color: var(--text-light);
  text-align: center;
  margin-bottom: var(--spacing-md);
  text-shadow: 0 0 20px var(--rune-glow);
  position: relative;
  z-index: 2;
  animation: titleGlow 3s infinite;
}

@keyframes titleGlow {
  0%, 100% { text-shadow: 0 0 20px rgba(0, 212, 255, 0.6); }
  50% { text-shadow: 0 0 30px rgba(80, 227, 194, 0.8); }
}

/* Slot Frame - Nordisk Border */
.saga-slot__frame {
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-md);
  padding: var(--spacing-sm);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  box-shadow: inset 0 0 20px rgba(0, 212, 255, 0.2);
  border: 3px solid var(--mystisk-ice);
  position: relative;
  z-index: 2;
}

.saga-slot__frame::before {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  background: linear-gradient(45deg, var(--rune-glow), var(--nordlys-teal), var(--nordlys-green), var(--rune-glow));
  border-radius: var(--radius-md);
  z-index: -1;
  animation: borderGlow 4s linear infinite;
}

@keyframes borderGlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Slot Reel - Mystisk Column */
.saga-slot__reel {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Slot Cell - Nordisk Symbol Container */
.saga-slot__cell {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #F8F9FA 0%, #E8F4FD 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  border: 2px solid var(--mystisk-ice);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
}

.saga-slot__cell::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, rgba(0, 212, 255, 0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.saga-slot__cell:hover::before {
  opacity: 1;
}

/* Nordisk Symbol Animations */
.saga-slot__cell[data-symbol="rune"] {
  animation: runeGlow 2s infinite;
}

.saga-slot__cell[data-symbol="light"] {
  animation: lightPulse 1.8s infinite;
}

.saga-slot__cell[data-symbol="aurora"] {
  animation: auroraShimmer 2.5s infinite;
}

.saga-slot__cell[data-symbol="nature"] {
  animation: natureBreathe 3s infinite;
}

.saga-slot__cell[data-symbol="crystal"] {
  animation: crystalSparkle 1.5s infinite;
}

.saga-slot__cell[data-symbol="frost"] {
  animation: frostGlimmer 2.2s infinite;
}

@keyframes runeGlow {
  0%, 100% { 
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
    transform: scale(1);
  }
  50% { 
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.6);
    transform: scale(1.05);
  }
}

@keyframes lightPulse {
  0%, 100% { 
    background: linear-gradient(135deg, #F8F9FA 0%, #E8F4FD 100%);
    transform: scale(1);
  }
  50% { 
    background: linear-gradient(135deg, #B3E5FC 0%, #4DD0E1 100%);
    transform: scale(1.08);
  }
}

@keyframes auroraShimmer {
  0%, 100% { 
    background: linear-gradient(135deg, #F8F9FA 0%, #E8F4FD 100%);
  }
  33% { 
    background: linear-gradient(135deg, #7ED321 0%, #50E3C2 100%);
  }
  66% { 
    background: linear-gradient(135deg, #4A90E2 0%, #2E5BBA 100%);
  }
}

@keyframes natureBreathe {
  0%, 100% { 
    transform: scale(1);
    filter: brightness(1);
  }
  50% { 
    transform: scale(1.03);
    filter: brightness(1.2);
  }
}

@keyframes crystalSparkle {
  0%, 100% { 
    transform: rotate(0deg) scale(1);
    box-shadow: 0 0 5px rgba(0, 212, 255, 0.3);
  }
  50% { 
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 0 15px rgba(80, 227, 194, 0.6);
  }
}

@keyframes frostGlimmer {
  0%, 100% { 
    background: linear-gradient(135deg, #F8F9FA 0%, #E8F4FD 100%);
    box-shadow: 0 0 8px rgba(178, 235, 242, 0.4);
  }
  50% { 
    background: linear-gradient(135deg, #AED6F1 0%, #85C1E9 100%);
    box-shadow: 0 0 16px rgba(178, 235, 242, 0.8);
  }
}

/* Spinning Animation - Mystisk Rotation */
.saga-slot__cell.spinning {
  animation: sagaSpin 0.8s ease-in-out;
}

@keyframes sagaSpin {
  0% { 
    transform: rotateY(0deg) scale(1);
    opacity: 1;
  }
  50% { 
    transform: rotateY(90deg) scale(0.8);
    opacity: 0.7;
    background: linear-gradient(135deg, var(--rune-glow) 0%, var(--nordlys-teal) 100%);
  }
  100% { 
    transform: rotateY(0deg) scale(1);
    opacity: 1;
  }
}

/* Slot Spin Button - Saga Style */
.saga-slot__spin {
  width: 100%;
  padding: var(--spacing-md);
  margin-top: var(--spacing-md);
  background: linear-gradient(135deg, var(--nordlys-green) 0%, var(--nordlys-teal) 100%);
  color: var(--text-light);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-saga);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 4px 15px rgba(126, 211, 33, 0.3);
  position: relative;
  z-index: 2;
  overflow: hidden;
}

.saga-slot__spin::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.6s;
}

.saga-slot__spin:hover::before {
  left: 100%;
}

.saga-slot__spin:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(126, 211, 33, 0.5);
  background: linear-gradient(135deg, var(--nordlys-teal) 0%, var(--nordlys-blue) 100%);
}

.saga-slot__spin:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(126, 211, 33, 0.4);
}

.saga-slot__spin:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  background: var(--mystisk-stone);
}

/* Slot Note - Mystisk Description */
.saga-slot__note {
  text-align: center;
  color: var(--mystisk-ice);
  font-size: 0.9rem;
  margin-top: var(--spacing-sm);
  font-style: italic;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 2;
}

/* Slot Status - Nordisk Feedback */
.saga-slot__status {
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-sm);
  padding: var(--spacing-sm);
  margin-top: var(--spacing-sm);
  text-align: center;
  font-weight: 600;
  color: var(--nordlys-deep);
  border: 2px solid var(--mystisk-ice);
  position: relative;
  z-index: 2;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.saga-slot__status.success {
  background: rgba(126, 211, 33, 0.1);
  border-color: var(--nordlys-green);
  color: var(--nordlys-green);
  animation: successGlow 2s;
}

.saga-slot__status.spinning {
  background: rgba(0, 212, 255, 0.1);
  border-color: var(--rune-glow);
  color: var(--rune-glow);
  animation: spinningPulse 1s infinite;
}

@keyframes successGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(126, 211, 33, 0.3); }
  50% { box-shadow: 0 0 20px rgba(126, 211, 33, 0.6); }
}

@keyframes spinningPulse {
  0%, 100% { 
    transform: scale(1);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
  }
  50% { 
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.6);
  }
}

/* Winning Combination Effects - Saga Magic */
.saga-slot__cell.winning {
  animation: winningCelebration 1.5s ease-in-out;
  z-index: 10;
}

@keyframes winningCelebration {
  0%, 100% { 
    transform: scale(1) rotate(0deg);
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
  }
  25% { 
    transform: scale(1.2) rotate(5deg);
    box-shadow: 0 0 25px rgba(241, 196, 15, 0.8);
  }
  50% { 
    transform: scale(1.3) rotate(-5deg);
    box-shadow: 0 0 30px rgba(241, 196, 15, 1);
  }
  75% { 
    transform: scale(1.2) rotate(3deg);
    box-shadow: 0 0 25px rgba(241, 196, 15, 0.8);
  }
}

/* Responsive Slot Design */
@media (max-width: 768px) {
  .saga-slot {
    max-width: 350px;
    padding: var(--spacing-md);
  }
  
  .saga-slot__cell {
    width: 70px;
    height: 70px;
    font-size: 2rem;
  }
  
  .saga-slot__title {
    font-size: 1.2rem;
  }
  
  .saga-slot__spin {
    padding: var(--spacing-sm);
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .saga-slot {
    max-width: 300px;
    padding: var(--spacing-sm);
  }
  
  .saga-slot__cell {
    width: 60px;
    height: 60px;
    font-size: 1.8rem;
  }
  
  .saga-slot__frame {
    gap: 3px;
  }
  
  .saga-slot__title {
    font-size: 1.1rem;
  }
  
  .saga-slot__spin {
    font-size: 0.95rem;
  }
}

@media (max-width: 360px) {
  .saga-slot__cell {
    width: 55px;
    height: 55px;
    font-size: 1.6rem;
  }
  
  .saga-slot__frame {
    gap: 2px;
  }
}

/* Special Nordisk Effects */
.saga-aurora-effect {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, 
    transparent 30%, 
    rgba(126, 211, 33, 0.2) 50%, 
    transparent 70%);
  animation: auroraWave 3s infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes auroraWave {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Rune Symbol Specific Styles */
.saga-slot__cell[data-symbol="rune"]::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, rgba(0, 212, 255, 0.1) 0%, transparent 60%);
  animation: runeAura 4s infinite;
}

@keyframes runeAura {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.1); }
}

/* Loading State */
.saga-slot.loading {
  opacity: 0.8;
  pointer-events: none;
}

.saga-slot.loading .saga-slot__frame {
  animation: loadingShimmer 1.5s infinite;
}

@keyframes loadingShimmer {
  0% { opacity: 0.8; }
  50% { opacity: 1; }
  100% { opacity: 0.8; }
}
