/* Tumbling Cube Widget - Enhanced Styles with Theme Support */

.tumbling-cube-widget {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  gap: 15px;
  min-width: 150px;
  width: 380px;
  margin-left: 50%;
  position: relative;
  left: -180px;
  top: 20px;
}

.tumbling-cube-widget__text {
  color: #fff;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-size: 20px;
  font-weight: 400;
  text-align: center;
  line-height: 1.4;
  max-width: 360px;
}

.tumbling-cube-widget__button {
  position: relative;
  width: 60px;
  height:60px;
  background: var(--theme-color, #ffd700);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 18px;
  font-weight: 600;
  color: #000;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 20px var(--theme-shadow, rgba(255, 215, 0, 0.3));
}

.tumbling-cube-widget__button::before {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border: 3px solid var(--theme-color, #ffd700);
  border-radius: 50%;
  pointer-events: none;
}

.tumbling-cube-widget__button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 30px var(--theme-shadow, rgba(255, 215, 0, 0.5));
}

.tumbling-cube-widget__button:active {
  transform: scale(0.98);
}

.tumbling-cube-widget__button:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--theme-shadow, rgba(255, 215, 0, 0.3));
}

/* Modal Overlay Styles */
.tumbling-cube-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 999999;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}

.tumbling-cube-modal--active {
  display: flex;
}

.tumbling-cube-modal__content {
  position: relative;
  width: 500px;
  height: 640px;
  max-width: 90vw;
  max-height: 90vh;
  background: #000;
  
  /* POPUP BOUNDARY STYLING - Colors set dynamically by JS */
  border: 3px solid #ffd700;
  border-radius: 12px;
  box-shadow: 
    0 0 40px rgba(255, 215, 0, 0.4),
    0 0 80px rgba(255, 215, 0, 0.2),
    inset 0 0 60px rgba(255, 215, 0, 0.05);
  padding: 0;
  
  /* Subtle animation on appear */
  animation: modalAppear 0.3s ease-out;
  
  /* Flexbox layout for title and animation */
  display: flex;
  flex-direction: column;
}

.tumbling-cube-countdown {
	font-weight: 500;
	text-align: center;
	font-size: 11px;
	position: relative;
	bottom: 5px;
  /* Color controlled by countdownTextColor parameter */
}

@keyframes modalAppear {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}


@media (min-width: 768px) {
		
	.tumbling-cube-modal__title {
	  height: 40px;
	  display: flex;
	  align-items: center;
	  justify-content: center;
	  background: linear-gradient(180deg, rgba(255, 215, 0, 0.1) 0%, rgba(0, 0, 0, 0) 100%);
	  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
	  border-radius: 9px 9px 0 0;
	  flex-shrink: 0;
	}
	

	.tumbling-cube-modal__title-text {
	  color: #ffd700;
	  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
	  font-size: 22px;
	  font-weight: 600;
	  text-align: center;
	  letter-spacing: 0.5px;
	  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
	}
}
@media (max-width: 767px) {

		
	.tumbling-cube-modal__title {
	  height: 40px;
	  display: flex;
	  align-items: center;
	  justify-content: center;
	  background: linear-gradient(180deg, rgba(255, 215, 0, 0.1) 0%, rgba(0, 0, 0, 0) 100%);
	  border-bottom: 1px solid transparent;
	  border-radius: 9px 9px 0 0;
	  flex-shrink: 0;
	}


	.tumbling-cube-modal__title-text {
	  color: #ffd700;
	  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
	  font-size: 22px;
	  font-weight: 600;
	  text-align: center;
	  letter-spacing: 0.5px;
	  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
	  position:absolute;
	  top:-70px;
	}

}


.tumbling-cube-modal__exit {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  background: var(--theme-color, #ffd700);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #000;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 20px var(--theme-shadow, rgba(255, 215, 0, 0.4));
}

.tumbling-cube-modal__exit::before {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border: 3px solid var(--theme-color, #ffd700);
  border-radius: 50%;
  pointer-events: none;
}

.tumbling-cube-modal__exit:hover {
  transform: translateX(-50%) scale(1.05);
  box-shadow: 0 6px 30px var(--theme-shadow, rgba(255, 215, 0, 0.6));
}

.tumbling-cube-modal__exit:active {
  transform: translateX(-50%) scale(0.98);
}

.tumbling-cube-animation {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
}

.tumbling-cube-animation__canvas,
.tumbling-cube-animation__labels {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
}

.tumbling-cube-animation__list {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 5;
  pointer-events: none;
}

.tumbling-cube-label {
  color: #fff;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
  transition: color 0.5s ease;
}

.tumbling-cube-popped-item {
  color: #ffd700;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  margin: 3px 0;
  opacity: 0;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
  text-align: center;
  padding: 0 10px;
}

/* Mobile Responsive */
@media (max-width: 600px) {
  .tumbling-cube-modal__content {
    height: auto;
    max-height: 90vh;
    border-width: 2px;
    border-radius: 8px;
    box-shadow: 
      0 0 30px rgba(255, 215, 0, 0.4),
      0 0 60px rgba(255, 215, 0, 0.2),
      inset 0 0 40px rgba(255, 215, 0, 0.05);
  }
  
  .tumbling-cube-modal__title {
    height: 36px;
    border-radius: 6px 6px 0 0;
  }
  
  .tumbling-cube-modal__title-text {
    font-size: 22px;
  }
  
  .tumbling-cube-modal__exit {
    bottom: -88px;
    width: 70px;
    height: 70px;
    font-size: 13px;
  }
  
  .tumbling-cube-modal__exit::before {
    border-width: 2px;
  }
  
  .tumbling-cube-animation {
    min-height: 300px;
  }

  .tumbling-cube-popped-item {
    font-size: 11px;
    margin: 2px 0;
  }

  .tumbling-cube-label {
    font-size: 10px;
  }
}