/* Common styles for Virtual Labs experiments */

body {
  font-family: 'Poppins', sans-serif;
}

.gradient-bg {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.card {
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.btn {
  transition: all 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

input[type="range"] {
  height: 0.5rem;
  cursor: pointer;
}

/* Floating action buttons & panels */
.floating-button {
  position: fixed;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.floating-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.25);
}

.floating-button:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.floating-button.primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  bottom: 2rem;
  right: 2rem;
}

.floating-button.secondary {
  background: linear-gradient(135deg, #e879f9, #c084fc);
  color: white;
  bottom: 6.5rem;
  right: 2rem;
}

.floating-panel {
  position: fixed;
  max-width: 18rem;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  z-index: 99;
  bottom: 7rem;
  right: 2rem;
  transform-origin: bottom right;
  transform: scale(0);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 1.5rem;
}

.floating-panel.active {
  transform: scale(1);
  opacity: 1;
}

.floating-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.floating-panel-close {
  cursor: pointer;
  color: #6b7280;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-panel-content {
  max-height: calc(80vh - 3rem);
  overflow-y: auto;
}

.panel-title {
  font-weight: 600;
  font-size: 1.1rem;
  color: #1f2937;
  margin: 0;
}

/* Add to styles.css */
#solutionControls {
  transition: opacity 0.2s;
}/* 15 Tiles Puzzle specific styles */
.game-container {
  position: relative;
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  border-radius: 12px;
  padding: 16px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
  width: 100%;
}

.puzzle-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 8px;
  aspect-ratio: 1/1;
  max-width: 450px;
  margin: 0 auto;
}

.tile {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fff, #f3f4f6);
  border-radius: 8px;
  font-weight: 700;
  font-size: 1.5rem;
  color: #4b5563;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  user-select: none;
  transition: transform 0.2s, background-color 0.2s;
  aspect-ratio: 1/1;
  cursor: pointer;
  position: relative;
  border: 2px solid #e5e7eb;
}

.tile:hover {
  transform: scale(1.03);
  background: linear-gradient(135deg, #fff, #e5e7eb);
}

.tile.empty {
  background: transparent;
  box-shadow: none;
  border: 2px dashed #d1d5db;
  cursor: default;
}

.tile.empty:hover {
  transform: none;
}

.tile.movable {
  border-color: #93c5fd;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.2);
}

.tile.hint {
  border-color: #93c5fd;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.2);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(59, 130, 246, 0); }
  100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

.tile.correct {
  border-color: #86efac;
  color: #15803d;
}

.game-status {
  display: flex;
  justify-content: space-around;
  margin-top: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

.status-item {
  text-align: center;
}

.status-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  margin-top: 2px;
}

.move-history {
  overflow-y: auto;
  padding: 6px;
  background: white;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
  font-size: 0.75rem;
}

.move-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 4px;
  margin: 1px 0;
  background: #f9fafb;
  border-radius: 3px;
  font-size: 0.75rem;
}

.move-number {
  font-weight: 600;
  color: #4f46e5;
  min-width: 30px;
}

.move-description {
  flex: 1;
  margin-left: 8px;
  color: #374151;
}

.move-time {
  font-size: 0.75rem;
  color: #6b7280;
}

/* Animation effects */
.tile-moving {
  transition: all 0.3s ease;
}

/* Success animation */
.success-effect {
  animation: celebrate 2s ease-in-out;
}

@keyframes celebrate {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.05) rotate(1deg); }
  50% { transform: scale(1.1) rotate(-1deg); }
  75% { transform: scale(1.05) rotate(1deg); }
}

/* Responsive design */
@media (max-width: 768px) {
  .game-container {
    padding: 10px;
  }
  
  .puzzle-board {
    max-width: 360px;
  }
  
  .tile {
    font-size: 1.2rem;
  }
  
  .game-status {
    flex-direction: column;
    gap: 8px;
  }
  
  .status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .status-label {
    display: inline;
    font-size: 0.875rem;
  }
  
  .status-value {
    display: inline;
    font-size: 1.25rem;
    margin-top: 0;
  }
}

@media (max-width: 640px) {
  .puzzle-board {
    max-width: 300px;
  }
  
  .tile {
    font-size: 1rem;
  }
}