/* Reset and base styles */
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, 
    #d1d1d3 0%, 
    #b8b8ba 15%, 
    #9e9ea0 30%, 
    #848486 45%, 
    #6a6a6c 60%, 
    #505052 75%, 
    #363638 90%, 
    #1c1c1e 100%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: #333;
}

/* Modal Overlay Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    transform: scale(0.9) translateY(-20px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e0e0e0;
  background: #f8f9fa;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.4rem;
  color: #333;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: #666;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: #e0e0e0;
  color: #333;
}

.modal-body {
  padding: 24px;
  max-height: calc(90vh - 100px);
  overflow-y: auto;
}

.modal-cubes {
  display: flex;
  flex-direction: row;
  gap: 20px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.modal-cube-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 15px;
  border-radius: 8px;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  transition: all 0.2s ease;
}

.modal-cube-item:hover {
  background: #e9ecef;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modal-cube-item .move-display {
  text-align: center;
}

.modal-cube-item .move-symbol {
  font-size: 1.5rem;
  font-weight: bold;
  color: #333;
  background: white;
  padding: 8px 16px;
  border-radius: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.modal-cube-item .twisty-player {
  width: 150px;
  height: 150px;
  min-height: 150px;
}

/* Sidebar Navigation */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1000;
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.sidebar.collapsed {
  transform: translateX(-100%);
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h3 {
  color: white;
  margin: 0;
  font-size: 1.2rem;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 5px;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-menu li {
  margin: 0;
}

.nav-link {
  display: block;
  padding: 15px 20px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-left-color: rgba(255, 255, 255, 0.5);
}

.nav-link.active {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border-left-color: #4CAF50;
}

.nav-section {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-section-title {
  display: block;
  padding: 15px 20px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.nav-section-title:hover {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

.nav-section-title.expanded {
  color: white;
  border-left-color: #2196F3;
}

.nav-submenu {
  list-style: none;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.3);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.nav-submenu.expanded {
  max-height: 300px;
}

.nav-submenu .nav-link {
  padding-left: 40px;
  font-size: 0.9rem;
}

/* Main Content */
.main-content {
  margin-left: 280px;
  transition: margin-left 0.3s ease;
}

.sidebar.collapsed + .main-content {
  margin-left: 0;
}

.tutorial-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.welcome-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.cube-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 20px;
  width: 100%;
  margin: 20px 0;
}

.cube-container .twisty-player {
  flex: 1;
  max-width: 400px;
  margin: 0;
}

.twisty-player {
  width: 100%;
  max-width: 500px;
  height: 50vw;
  max-height: 500px;
  min-height: 300px;
  margin: 0 auto;
  display: block;
  background: none;
}

/* Move display styles */
.move-display {
  text-align: center;
  margin: 10px 0;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.move-symbol {
  font-size: 3rem;
  font-weight: bold;
  color: #333;
  background: rgba(255, 255, 255, 0.9);
  padding: 10px 20px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  min-width: 80px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.move-symbol:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* Clickable component styles */
.cube-component.clickable {
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 15px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid transparent;
}

.cube-component.clickable:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}



/* Breakdown sections */
.face-turns-breakdown,
.wide-turns-breakdown,
.slice-turns-breakdown,
.rotations-breakdown {
  margin: 40px 0;
  padding: 30px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.moves-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 30px 0;
}

@media (max-width: 768px) {
  .moves-grid {
    grid-template-columns: 1fr;
  }
}

.main-moves .moves-grid {
  grid-template-columns: repeat(2, 1fr);
  max-width: 800px;
  margin: 30px auto;
}

.move-definitions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 30px 0;
}

.move-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.move-detail {
  background: rgba(255, 255, 255, 0.9);
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.move-detail h3 {
  color: #333;
  margin-bottom: 10px;
  font-size: 1.4rem;
}

.move-detail p {
  color: #555;
  margin-bottom: 15px;
  line-height: 1.6;
}

.move-detail ul {
  color: #666;
  line-height: 1.8;
}

.move-detail li {
  margin-bottom: 5px;
}

/* Header */
h1 {
  text-align: center;
  color: white;
  font-size: 2.5rem;
  margin-bottom: 2rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

h2 {
  color: white;
  font-size: 1.8rem;
  margin-bottom: 1rem;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

h3 {
  color: #333;
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    transform: translateX(-100%);
  }

  .sidebar.collapsed {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .sidebar-toggle {
    display: block;
  }

  .tutorial-container {
    padding: 10px;
  }

  .cube-container {
    flex-direction: column;
  }

  .moves-grid {
    grid-template-columns: 1fr;
  }

  .move-definitions-grid {
    grid-template-columns: 1fr;
  }

  .move-details {
    grid-template-columns: 1fr;
  }
  
  /* Modal responsive styles */
  .modal-content {
    max-width: 95vw;
    max-height: 95vh;
    margin: 10px;
  }
  
  .modal-header {
    padding: 15px 20px;
  }
  
  .modal-header h3 {
    font-size: 1.2rem;
  }
  
  .modal-body {
    padding: 15px;
  }
  
  .modal-cubes {
    flex-direction: column;
    gap: 15px;
  }
  
  .modal-cube-item {
    padding: 10px;
  }
  
  .modal-cube-item .twisty-player {
    width: 120px;
    height: 120px;
    min-height: 120px;
  }
}

@media (min-width: 769px) {
  .sidebar-toggle {
    display: none;
  }
  
  .sidebar {
    transform: translateX(0);
  }
}

/* Move Button Styles */
.move-button {
  display: inline-block;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 20px;
  padding: 4px 12px;
  margin: 0 2px;
  font-size: 0.9em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  text-decoration: none;
  line-height: 1.4;
}

.move-button:hover {
  background-color: #45a049;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

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

.move-button-prime {
  background-color: #00BCD4;
}

.move-button-prime:hover {
  background-color: #0097A7;
}

/* Move Definition Modal Styles */
.move-variants-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  justify-content: center;
}

.move-variant-tab {
  background: #f0f0f0;
  border: 2px solid #ddd;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: bold;
  color: #666;
}

.move-variant-tab:hover {
  background: #e0e0e0;
  border-color: #ccc;
}

.move-variant-tab.active {
  /* background: linear-gradient(135deg, #4CAF50, #45a049); */
  /* border-color: #4CAF50; */
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.move-variant-tab.active[data-move*="'"] {
  /* background: linear-gradient(135deg, #00BCD4, #0097A7); */
  /* border-color: #00BCD4; */
}

.move-variant-tab.active[data-move*="2"] {
  /* background: linear-gradient(135deg, #F44336, #D32F2F); */
  /* border-color: #F44336; */
}

.move-definition-content {
  display: flex;
  gap: 30px;
  align-items: flex-start;
}

.move-cube-demo {
  flex: 0 0 auto;
}

.move-cube-demo .twisty-player {
  width: 200px;
  height: 200px;
  min-height: 200px;
}

.move-description {
  flex: 1;
  min-width: 0;
}

.move-description h4 {
  color: #333;
  margin: 0 0 15px 0;
  font-size: 1.3rem;
}

.move-description p {
  color: #555;
  line-height: 1.6;
  margin-bottom: 20px;
}

.move-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.move-detail-item {
  background: #f8f9fa;
  padding: 10px 15px;
  border-radius: 8px;
  border-left: 4px solid #4CAF50;
}

.move-detail-item strong {
  color: #333;
  margin-right: 8px;
}

/* Main move modal styles */
.main-move-demo {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.main-move-demo .twisty-player {
  width: 300px;
  height: 300px;
  min-height: 300px;
}

.main-move-description {
  text-align: center;
}

.main-move-description h4 {
  color: #333;
  margin: 0 0 15px 0;
  font-size: 1.4rem;
}

.main-move-description p {
  color: #555;
  margin-bottom: 20px;
  line-height: 1.6;
}

.move-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Responsive design for move definition modal */
@media (max-width: 768px) {
  .move-definition-content {
    flex-direction: column;
    gap: 20px;
  }
  
  .move-cube-demo .twisty-player {
    width: 150px;
    height: 150px;
    min-height: 150px;
  }
  
  .move-button {
    font-size: 0.8em;
    padding: 3px 10px;
  }
  
  .move-variants-tabs {
    flex-direction: column;
    gap: 8px;
  }
  
  .move-variant-tab {
    padding: 6px 12px;
    font-size: 0.9em;
  }
}

/* Cross Section Styles */
.cross {
  margin: 40px 0;
  padding: 30px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.tip {
  margin-bottom: 30px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  border-left: 4px solid #4CAF50;
}

.cross-fundamentals {
  margin-bottom: 30px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
}

.cross-fundamentals ul {
  margin: 15px 0;
  padding-left: 20px;
}

.cross-fundamentals li {
  margin-bottom: 8px;
  line-height: 1.6;
}

.cross-technique {
  margin-bottom: 40px;
  padding: 25px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cross-technique h3 {
  color: white;
  margin-bottom: 15px;
  font-size: 1.5rem;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.cross-technique h4 {
  color: #e0e0e0;
  margin: 20px 0 10px 0;
  font-size: 1.2rem;
}

.cross-technique h5 {
  color: #ccc;
  margin: 15px 0 8px 0;
  font-size: 1.1rem;
}

.cross-technique p {
  color: #ddd;
  line-height: 1.6;
  margin-bottom: 15px;
}

.cross-technique ul {
  color: #ddd;
  line-height: 1.6;
  margin: 15px 0;
  padding-left: 20px;
}

.cross-technique li {
  margin-bottom: 6px;
}

.technique-example {
  margin: 20px 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.technique-steps {
  margin: 20px 0;
}

.technique-subsection {
  margin: 25px 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  border-left: 3px solid #2196F3;
}

.example-cases {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.case {
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.planning-tips {
  margin: 20px 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  border-left: 3px solid #FF9800;
}

.planning-example {
  margin: 20px 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.color-neutral-benefits {
  margin: 20px 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  border-left: 3px solid #9C27B0;
}

.color-examples {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.color-example {
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cross-patterns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.pattern {
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.practice-scrambles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.scramble {
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cross-tips {
  margin-top: 30px;
  padding: 25px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cross-tips h3 {
  color: white;
  margin-bottom: 15px;
  font-size: 1.5rem;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.cross-tips ul {
  color: #ddd;
  line-height: 1.6;
  margin: 15px 0;
  padding-left: 20px;
}

.cross-tips li {
  margin-bottom: 8px;
}

.cube-demo {
  margin: 15px 0;
  display: flex;
  justify-content: center;
}

/* Responsive design for cross section */
@media (max-width: 768px) {
  .cross {
    padding: 20px;
    margin: 20px 0;
  }
  
  .cross-technique {
    padding: 15px;
    margin-bottom: 25px;
  }
  
  .example-cases,
  .color-examples,
  .cross-patterns,
  .practice-scrambles {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .case,
  .color-example,
  .pattern,
  .scramble {
    padding: 12px;
  }
  
  .cross-technique h3 {
    font-size: 1.3rem;
  }
  
  .cross-technique h4 {
    font-size: 1.1rem;
  }
}

.cross-cases-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  margin: 2rem 0;
}

.top-edges-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 2rem 0;
}

.bad-edges-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 2rem 0;
}

.f2l-cases-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  margin: 2rem 0;
}

@media (max-width: 700px) {
  .cross-cases-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.cross-case {
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.cross-case h5 {
  color: #e0e0e0;
  margin: 0 0 15px 0;
  font-size: 1rem;
  line-height: 1.4;
}

.cross-case .cube-demo {
  margin: 10px 0;
}

/* Responsive design for cross cases */
@media (max-width: 768px) {
  .cross-cases-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .cross-case {
    padding: 12px;
  }
  
  .cross-case h5 {
    font-size: 0.9rem;
  }
}

.toggle-2d-btn {
  background: rgba(255,255,255,0.5);
  color: #222;
  border: none;
  border-radius: 8px;
  padding: 4px 14px;
  font-size: 0.95em;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  opacity: 0.7;
}
.toggle-2d-btn:hover {
  background: rgba(255,255,255,0.8);
  opacity: 1;
}
.toggle-2d-btn.active {
  background: #4CAF50;
  color: #fff;
  opacity: 1;
}

.toggle-2d-btn.inactive {
  opacity: 0.4;
}

.side-by-side-cubes {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.side-by-side-cubes .move-cube-demo {
  flex: 0 0 auto;
}
@media (max-width: 700px) {
  .side-by-side-cubes {
    flex-direction: column;
    gap: 12px;
    align-items: center;
  }
}

