/* =============================================
   RUBIK'S CUBE TUTORIAL - ENHANCED STYLES
   Modern, interactive, and engaging design
   ============================================= */

/* =============================================
   VARIABLES & BASE STYLES - ENHANCED
   ============================================= */
:root {
  /* Modern Color Palette with better contrast and vibrancy */
  --white: #ffffff;
  --black: #1a1a1a;
  --primary: #4361ee;
  --primary-dark: #3a56d4;
  --primary-light: #4cc9f0;
  --secondary: #4cc9f0;
  --secondary-dark: #43b0d9;
  --accent: #f8961e;
  --accent-dark: #e6891b;
  --text-primary: #2b2d42;
  --text-secondary: #5f6368;
  --text-light: #8d99ae;
  --bg-primary: #f8f9fa;
  --bg-secondary: #ffffff;
  --bg-accent: #f0f7ff;
  --bg-accent-2: #e8f4fd;
  --border-color: #e0e6eb;
  --border-color-light: #f0f2f5;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-fast: all 0.2s ease;
  --border-radius-sm: 6px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  --border-radius-xl: 24px;

  /* Cube Colors - Standard Rubik's Cube with enhanced vibrancy */
  --cube-white: #ffffff;
  --cube-yellow: #ffd60a;
  --cube-red: #ff1e00;
  --cube-blue: #2a6fdb;
  --cube-green: #00a651;
  --cube-orange: #ff6d00;

  /* Animation variables */
  --animation-duration: 0.4s;
}

/* Dark Mode Variables - Enhanced */
:root {
  --dark-bg-primary: #121212;
  --dark-bg-secondary: #1e1e1e;
  --dark-bg-accent: #252526;
  --dark-bg-accent-2: #2d2d2d;
  --dark-text-primary: #e0e0e0;
  --dark-text-secondary: #a0a0a0;
  --dark-text-light: #707070;
  --dark-border-color: #333333;
  --dark-border-color-light: #444444;
  --dark-primary: #5887ff;
  --dark-secondary: #4cc9f0;
  --dark-accent: #f8961e;
}

body.dark-mode {
  --bg-primary: var(--dark-bg-primary);
  --bg-secondary: var(--dark-bg-secondary);
  --bg-accent: var(--dark-bg-accent);
  --bg-accent-2: var(--dark-bg-accent-2);
  --text-primary: var(--dark-text-primary);
  --text-secondary: var(--dark-text-secondary);
  --text-light: var(--dark-text-light);
  --border-color: var(--dark-border-color);
  --border-color-light: var(--dark-border-color-light);
  --primary: var(--dark-primary);
  --secondary: var(--dark-secondary);
  --accent: var(--dark-accent);
}

/* Reset and Base Styles - Enhanced */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

::selection {
  background: var(--primary);
  color: var(--white);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-accent);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Add fonts for better typography */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&display=swap');

/* =============================================
   LAYOUT COMPONENTS - ENHANCED
   ============================================= */
/* Header - Modern and engaging */
header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  padding: 2.5rem 0 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="40" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="60" cy="80" r="1.5" fill="rgba(255,255,255,0.1)"/></svg>');
  pointer-events: none;
}

header h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 2;
}

header h1::after {
  content: '🎲';
  margin-left: 0.5rem;
  animation: pulse 2s infinite;
}

header p {
  font-size: 1.2rem;
  opacity: 0.95;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Progress Indicator - Enhanced */
.progress-indicator {
  margin-top: 1.5rem;
  padding: 0 1rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.progress-indicator span {
  display: block;
  text-align: center;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--white);
}

.progress-bar {
  height: 10px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  margin-top: 0.5rem;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--white), var(--secondary));
  border-radius: var(--border-radius-sm);
  transition: width 0.4s ease;
}

/* User Statistics - Enhanced */
.user-stats {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
  padding: 0 1rem;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
  padding: 0.8rem 1.2rem;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
  min-width: 100px;
  transition: var(--transition);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.stat-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  background-color: rgba(255, 255, 255, 0.15);
}

.stat-icon {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 0.3rem;
}

.stat-value {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--white);
  display: block;
}

.stat-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Settings Bar - Enhanced */
.settings-bar {
  background-color: var(--bg-secondary);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.settings-left, .settings-right {
  display: flex;
  gap: 0.5rem;
}

.setting-btn {
  background: none;
  border: none;
  padding: 0.5rem;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-primary);
}

.setting-btn:hover {
  background-color: var(--bg-accent);
  transform: translateY(-1px);
}

.setting-icon {
  font-size: 1.2rem;
}

.language-text {
  font-weight: 600;
  color: var(--primary);
}

/* Navigation - Modern and interactive */
nav {
  background-color: var(--bg-secondary);
  padding: 0;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

nav ul {
  display: flex;
  justify-content: center;
  list-style: none;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  gap: 0.25rem;
}

nav li {
  margin: 0;
  position: relative;
}

nav a {
  color: var(--text-primary);
  text-decoration: none;
  padding: 0.8rem 1.2rem;
  border-radius: var(--border-radius-sm);
  transition: var(--transition-fast);
  font-weight: 500;
  display: block;
  position: relative;
  overflow: hidden;
}

nav a:hover {
  background-color: var(--primary);
  color: var(--white);
  transform: translateY(-1px);
}

nav a.active {
  background-color: var(--primary);
  color: var(--white);
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

nav a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  background-color: var(--accent);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

/* Main Content Layout - Enhanced */
main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
  flex: 1;
}

/* Container for better spacing control */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Section Styling - Modern cards with depth */
section {
  background-color: var(--bg-secondary);
  border-radius: var(--border-radius-md);
  padding: 2.5rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color-light);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

section:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

section h2 {
  color: var(--primary);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--primary);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  position: relative;
}

section h2::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 50px;
  height: 3px;
  background: var(--accent);
  border-radius: 3px;
}

section h3 {
  color: var(--primary-dark);
  margin: 2rem 0 1rem 0;
  font-size: 1.4rem;
  font-weight: 600;
  position: relative;
  padding-left: 1rem;
}

section h3::before {
  content: '▶';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-size: 0.8rem;
}

section h4 {
  color: var(--primary);
  margin: 1.5rem 0 1rem 0;
  font-size: 1.2rem;
  font-weight: 600;
  position: relative;
  padding-left: 1rem;
}

section h4::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 1.2rem;
}

/* =============================================
   TYPOGRAPHY - ENHANCED
   ============================================= */
/* Typography - Enhanced readability and hierarchy */
h3 {
  color: var(--primary-dark);
  margin: 2rem 0 1rem 0;
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.4;
}

h4 {
  color: var(--primary);
  margin: 1.5rem 0 1rem 0;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.4;
}

p {
  margin-bottom: 1.2rem;
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

ul, ol {
  margin: 1.2rem 0;
  padding-left: 1.8rem;
}

ul {
  list-style-type: disc;
}

ol {
  list-style-type: decimal;
}

ul li, ol li {
  margin-bottom: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

ul li::marker, ol li::marker {
  color: var(--primary);
}

strong {
  color: var(--text-primary);
  font-weight: 600;
}

em {
  color: var(--primary);
  font-style: italic;
}

/* =============================================
   SPECIAL COMPONENTS - ENHANCED
   ============================================= */
/* Algorithm Boxes - Enhanced with better visual hierarchy */
.algorithm {
  background: linear-gradient(135deg, var(--bg-accent), var(--bg-accent-2));
  border-left: 4px solid var(--primary);
  border-radius: var(--border-radius-md);
  padding: 1.5rem;
  margin: 1.5rem 0;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 1.05rem;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.algorithm:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.algorithm::before {
  content: '⚙️';
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.2rem;
  opacity: 0.3;
}

.algorithm strong {
  color: var(--primary-dark);
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.algorithm .move-highlight {
  background-color: rgba(67, 97, 238, 0.15);
  padding: 0.2rem 0.4rem;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  color: var(--primary);
  border: 1px solid rgba(67, 97, 238, 0.3);
}

/* Mnemonic Boxes - Enhanced with better visual appeal */
.mnemonic {
  background: linear-gradient(135deg, rgba(76, 201, 240, 0.1), rgba(76, 201, 240, 0.05));
  border-left: 4px solid var(--secondary);
  border-radius: var(--border-radius-md);
  padding: 1.5rem;
  margin: 1.5rem 0;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  font-style: italic;
}

.mnemonic:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.mnemonic::before {
  content: '💡';
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.2rem;
  opacity: 0.3;
}

.mnemonic strong {
  color: var(--secondary-dark);
  font-style: normal;
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

/* Visual Step Boxes - Enhanced with better visual hierarchy */
.visual-step {
  background: linear-gradient(135deg, var(--bg-accent), var(--bg-accent-2));
  border-left: 4px solid var(--accent);
  border-radius: var(--border-radius-md);
  padding: 2rem;
  margin: 2rem 0;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.visual-step:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.visual-step::before {
  content: '🎯';
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  opacity: 0.2;
}

.visual-step h4 {
  color: var(--accent);
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
  font-weight: 600;
  position: relative;
  padding-left: 1.5rem;
}

.visual-step h4::before {
  content: '🎯';
  position: absolute;
  left: 0;
  top: 0;
  font-size: 1.2rem;
}

/* Cube Diagram Container - Enhanced with better visual appeal */
.cube-diagram {
  text-align: center;
  margin: 2.5rem 0;
  padding: 2rem;
  background: linear-gradient(135deg, var(--bg-accent), var(--bg-accent-2));
  border-radius: var(--border-radius-lg);
  position: relative;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.cube-diagram:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.cube-diagram::before {
  content: '🎲';
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  opacity: 0.2;
}

.cube-diagram h3, .cube-diagram h4 {
  color: var(--primary);
  margin-bottom: 1.2rem;
  font-size: 1.3rem;
  font-weight: 600;
}

.cube-diagram p {
  margin-top: 0.75rem;
  font-size: 1rem;
  color: var(--text-secondary);
  font-style: italic;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* Cube Face Styling - Enhanced with 3D effect */
.cube-face {
  display: inline-block;
  width: 100px;
  height: 100px;
  margin: 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background-color: var(--bg-secondary);
  box-shadow: var(--shadow-md);
  position: relative;
  transition: var(--transition);
}

.cube-face:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.cube-sticker {
  width: 30px;
  height: 30px;
  display: inline-block;
  margin: 2px;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: var(--transition-fast);
  position: relative;
  z-index: 1;
}

.cube-sticker:hover {
  transform: scale(1.1);
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 3D Cube Enhancements - Enhanced with better 3D effect */
.cube-3d-face {
  width: 120px;
  height: 120px;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: var(--bg-secondary);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  margin: 1rem auto;
}

.cube-3d-face:hover {
  transform: rotateY(20deg) rotateX(15deg) scale(1.02);
}

.cube-sticker-3d {
  width: 32px;
  height: 32px;
  display: inline-block;
  margin: 2px;
  border-radius: 4px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.1);
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  z-index: 1;
}

.cube-sticker-3d:hover {
  transform: scale(1.15) translateZ(5px);
  z-index: 10;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

/* Center sticker enhancement */
.center-sticker {
  border: 2px solid var(--border-color);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

/* Interactive Cube - Enhanced with 3D effect */
.interactive-cube {
  width: 180px;
  height: 180px;
  margin: 2rem auto;
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--white);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: var(--transition);
}

.interactive-cube::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: shine 3s infinite;
}

.interactive-cube:hover {
  transform: rotateY(15deg) rotateX(10deg) scale(1.05);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

@keyframes shine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Tooltip Styling - Enhanced with modern design */
.tooltip {
  position: relative;
  display: inline-block;
  cursor: help;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 220px;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  text-align: center;
  border-radius: var(--border-radius-md);
  padding: 12px 16px;
  position: absolute;
  z-index: 1000;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color-light);
}

.tooltip .tooltiptext::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -8px;
  border-width: 8px;
  border-style: solid;
  border-color: var(--bg-secondary) transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(-5px);
}

/* =============================================
   BUTTONS & NAVIGATION - ENHANCED
   ============================================= */
/* Buttons - Enhanced with modern animations and effects */
.btn {
  display: inline-block;
  padding: 0.9rem 2rem;
  background-color: var(--primary);
  color: var(--white);
  text-decoration: none;
  border-radius: var(--border-radius-md);
  transition: var(--transition);
  font-weight: 600;
  text-align: center;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  transform: translateY(0);
  z-index: 1;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transform: translateX(-100%);
  transition: var(--transition-fast);
  z-index: -1;
}

.btn:hover {
  background-color: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.btn:hover::before {
  transform: translateX(100%);
}

.btn:active {
  transform: translateY(1px);
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background-color: var(--secondary);
}

.btn-secondary:hover {
  background-color: var(--secondary-dark);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary:active {
  transform: translateY(1px);
}

.btn-large {
  font-size: 1.1rem;
  padding: 1rem 2.2rem;
  box-shadow: var(--shadow-lg);
}

.btn-large:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.step-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  gap: 1rem;
  flex-wrap: wrap;
}

/* =============================================
   FOOTER - ENHANCED
   ============================================= */
footer {
  background-color: var(--black);
  color: var(--white);
  text-align: center;
  padding: 2rem 0;
  margin-top: 2rem;
  position: relative;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

footer p {
  font-size: 0.95rem;
  opacity: 0.9;
  position: relative;
  z-index: 2;
}

/* =============================================
   CUBE COMPONENTS - ENHANCED
   ============================================= */
/* Cube Grid Layout - Enhanced */
.cube-grid {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin: 2rem 0;
}

.cube-item {
  text-align: center;
  transition: var(--transition);
}

.cube-item:hover {
  transform: translateY(-3px);
}

/* Cube Face Colors - Enhanced */
.cube-face-white {
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
  border: 2px solid var(--border-color);
}

.cube-face-red {
  background: linear-gradient(135deg, #ffebee, #ffcdd2);
  border: 2px solid var(--border-color);
}

.cube-face-yellow {
  background: linear-gradient(135deg, #fffde7, #fff9c4);
  border: 2px solid var(--border-color);
}

.cube-face-green {
  background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
  border: 2px solid var(--border-color);
}

.cube-face-blue {
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
  border: 2px solid var(--border-color);
}

.cube-face-orange {
  background: linear-gradient(135deg, #fff3e0, #ffe0b2);
  border: 2px solid var(--border-color);
}

/* Cube Grid 3x3 - Enhanced */
.cube-grid-3x3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 10px;
  background-color: var(--bg-secondary);
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-sm);
}

/* Center Sticker - Enhanced */
.center-sticker {
  border: 2px solid var(--border-color);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

/* Interactive Cube Container - Enhanced */
.interactive-cube-container {
  text-align: center;
  margin: 2rem 0;
}

.interactive-cube-container h4 {
  color: var(--primary);
  margin-bottom: 1rem;
  font-weight: 600;
}

/* Notation Grid - Enhanced */
.notation-grid {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
  margin: 2rem 0;
}

.notation-item {
  text-align: center;
  transition: var(--transition);
}

.notation-item:hover {
  transform: translateY(-3px);
}

.notation-face {
  background-color: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.notation-face:hover {
  transform: rotate(15deg);
  box-shadow: var(--shadow-md);
}

.notation-letter {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary);
}

/* Direction Indicators - Enhanced */
.direction-clockwise {
  color: var(--secondary);
  margin-right: 0.2rem;
}

.direction-counter {
  color: var(--accent);
  margin-right: 0.2rem;
}

/* CTA Container - Enhanced */
.cta-container {
  text-align: center;
  margin: 3rem 0;
  padding: 1.5rem;
  background-color: var(--bg-accent);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-md);
}

/* Diagram Description - Enhanced */
.diagram-description {
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background-color: var(--bg-accent);
  border-radius: var(--border-radius-sm);
  border-left: 3px solid var(--primary);
}

/* Enhanced Visualization - Enhanced */
.enhanced-visualization {
  background-color: rgba(76, 201, 240, 0.05);
  border-left: 4px solid var(--secondary);
  border-radius: var(--border-radius-md);
  padding: 1.5rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
}

.cube-structure-explanation {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}

.structure-diagram {
  text-align: center;
  flex: 1;
  min-width: 120px;
  transition: var(--transition);
}

.structure-diagram:hover {
  transform: translateY(-3px);
}

.cube-part {
  width: 60px;
  height: 60px;
  margin: 0 auto 0.5rem;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--border-color);
  transition: var(--transition);
}

.cube-part:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.center-piece {
  background-color: var(--primary);
  color: white;
}

.edge-piece {
  background-color: var(--secondary);
  color: white;
}

.corner-piece {
  background-color: var(--accent);
  color: white;
}

.structure-note {
  text-align: center;
  font-weight: 600;
  color: var(--primary);
  margin-top: 1.5rem;
  padding: 0.8rem;
  background-color: var(--bg-accent);
  border-radius: var(--border-radius-sm);
  border-left: 3px solid var(--primary);
}

/* =============================================
   STEP VISUALIZATION - ENHANCED
   ============================================= */
/* Step Visualization Styles */
.step-visualization {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin: 2rem 0;
  padding: 1.5rem;
  background-color: var(--bg-accent);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
}

.step-card {
  background-color: var(--bg-secondary);
  border-radius: var(--border-radius-md);
  padding: 1.2rem;
  text-align: center;
  min-width: 120px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border: 2px solid var(--border-color-light);
  position: relative;
  overflow: hidden;
}

.step-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.step-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.step-number {
  background-color: var(--primary);
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin: 0 auto 0.75rem;
  box-shadow: var(--shadow-sm);
}

.step-icon {
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
  color: var(--primary);
}

.step-arrow {
  font-size: 1.5rem;
  color: var(--primary);
  font-weight: bold;
}

/* =============================================
   CUBE SIMULATOR - ENHANCED
   ============================================= */
/* Cube Simulator Modal - Enhanced */
.cube-simulator-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cube-simulator-modal.active {
  opacity: 1;
  pointer-events: all;
}

.cube-simulator-content {
  background-color: var(--bg-secondary);
  padding: 2.5rem;
  border-radius: var(--border-radius-lg);
  max-width: 900px;
  width: 95%;
  max-height: 95vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color-light);
}

.cube-simulator-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cube-simulator-close:hover {
  background-color: var(--bg-accent);
  color: var(--primary);
  transform: scale(1.1);
}

.cube-simulator-title {
  text-align: center;
  color: var(--primary);
  margin-bottom: 2rem;
  font-size: 1.8rem;
  font-weight: 700;
}

.cube-simulator-title::after {
  content: '🎲';
  margin-left: 0.5rem;
}

/* 3D Cube Simulator - Enhanced */
.cube-simulator {
  width: 350px;
  height: 350px;
  margin: 0 auto;
  position: relative;
  transform-style: preserve-3d;
  perspective: 1200px;
  transition: transform 0.5s ease;
}

.cube-simulator:hover {
  transform: rotateY(15deg) rotateX(10deg);
}

.cube-simulator-face {
  position: absolute;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
  border: 2px solid #333;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform 0.3s ease;
  border-radius: var(--border-radius-sm);
}

.cube-simulator-face:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

/* Cube Simulator Controls - Enhanced */
.cube-simulator-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.simulator-btn {
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.simulator-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.simulator-btn:active {
  transform: translateY(1px);
}

#scramble-cube {
  background-color: var(--accent);
  color: white;
}

#solve-cube {
  background-color: var(--secondary);
  color: white;
}

#reset-cube {
  background-color: var(--text-light);
  color: var(--text-primary);
}

/* Simulator Instructions - Enhanced */
.simulator-instructions {
  background-color: var(--bg-accent);
  border-radius: var(--border-radius-md);
  padding: 1.5rem;
  margin-top: 2rem;
  border-left: 4px solid var(--primary);
}

.simulator-instructions h3 {
  color: var(--primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* =============================================
   TIMER & SPEEDCUBING - ENHANCED
   ============================================= */
/* Timer Display - Enhanced */
.timer-display {
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--primary);
  background-color: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: var(--border-radius-md);
  text-align: center;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-md);
  border: 2px solid var(--border-color-light);
}

.timer-display.timer-pulse {
  animation: pulse 1s infinite;
}

/* Timer Controls - Enhanced */
.timer-controls {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.timer-btn {
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.timer-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.timer-btn:active {
  transform: translateY(1px);
}

.timer-btn.start {
  background-color: var(--secondary);
  color: white;
}

.timer-btn.stop {
  background-color: var(--accent);
  color: white;
}

.timer-btn.reset {
  background-color: var(--text-light);
  color: var(--text-primary);
}

/* =============================================
   ACHIEVEMENTS - ENHANCED
   ============================================= */
/* Achievement System Styles - Enhanced */
.achievement-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  background-color: var(--bg-secondary);
  border-radius: var(--border-radius-lg);
  border: 2px solid var(--border-color-light);
  margin: 0.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.achievement-badge::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
}

.achievement-badge:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.achievement-badge.locked {
  opacity: 0.7;
  filter: grayscale(50%);
}

.achievement-icon {
  font-size: 1.5rem;
}

.achievement-info {
  font-size: 0.95rem;
}

/* Achievement Notification - Enhanced */
.achievement-notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 1.2rem 1.8rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 1000;
  animation: slideIn 0.3s ease-out;
  max-width: 350px;
}

.achievement-notification .achievement-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.achievement-notification .achievement-icon {
  font-size: 2rem;
}

.achievement-notification strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 1.1rem;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* =============================================
   VIDEO TUTORIALS - ENHANCED
   ============================================= */
.video-tutorial {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  overflow: hidden;
  margin: 2rem 0;
  border-radius: var(--border-radius-md);
  background-color: #000;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.video-tutorial:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.video-tutorial iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: var(--border-radius-md);
}

.video-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary);
  margin: 1rem 0 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* =============================================
   NOTIFICATIONS - ENHANCED
   ============================================= */
.notification {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  animation: slideIn 0.3s ease-out;
  font-size: 0.95rem;
}

/* =============================================
   CUBE COLOR CLASSES - ENHANCED
   ============================================= */
.white { background-color: var(--cube-white); border: 1px solid #e0e0e0; }
.yellow { background-color: var(--cube-yellow); border: 1px solid #d4c000; }
.red { background-color: var(--cube-red); border: 1px solid #d00000; }
.blue { background-color: var(--cube-blue); border: 1px solid #0000c0; }
.green { background-color: var(--cube-green); border: 1px solid #00a000; }
.orange { background-color: var(--cube-orange); border: 1px solid #d06000; }

/* =============================================
   RESPONSIVE DESIGN - ENHANCED
   ============================================= */
@media (max-width: 1024px) {
  section {
    padding: 2rem;
  }

  .cube-grid {
    gap: 1.5rem;
  }

  .notation-grid {
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  header {
    padding: 2rem 0 1.5rem;
  }

  header h1 {
    font-size: 2rem;
  }

  header p {
    font-size: 1rem;
  }

  .user-stats {
    gap: 1rem;
  }

  .stat-item {
    min-width: 80px;
    padding: 0.6rem 1rem;
  }

  section {
    padding: 1.5rem;
    margin-bottom: 2rem;
  }

  .step-visualization {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .step-arrow {
    transform: rotate(90deg);
    margin: 0.5rem 0;
  }

  /* Mobile App-like Navigation */
  nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    border-top: 1px solid var(--border-color);
    border-bottom: none;
    padding: 0.5rem 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  }

  nav ul {
    flex-direction: row;
    justify-content: space-around;
    gap: 0;
  }

  nav li {
    flex: 1;
    text-align: center;
  }

  nav a {
    padding: 0.6rem 0.5rem;
    font-size: 0.85rem;
  }

  .step-navigation {
    flex-direction: column;
    gap: 0.75rem;
  }

  .btn {
    width: 100%;
    padding: 0.8rem;
  }

  .cube-simulator {
    width: 300px;
    height: 300px;
  }
}

@media (max-width: 600px) {
  .cube-grid {
    gap: 1rem;
  }

  .cube-3d-face {
    width: 90px;
    height: 90px;
  }

  .progress-indicator {
    font-size: 0.9rem;
  }

  .step-visualization {
    gap: 0.75rem;
    padding: 1rem;
  }

  .step-card {
    min-width: 100px;
    padding: 0.8rem;
  }

  .cube-simulator {
    width: 280px;
    height: 280px;
  }

  .cube-simulator-face {
    width: 80px;
    height: 80px;
  }
}

/* =============================================
   ANIMATIONS - ENHANCED
   ============================================= */
@keyframes ripple {
  to {
    transform: scale(2);
    opacity: 0;
  }
}

/* Ripple Effect - Enhanced */
.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
  z-index: 100;
}
