@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;500;700&display=swap');

:root {
  --bg-color: #f8fafc;
  --nav-bg: rgba(255, 255, 255, 0.7);
  --nav-border: rgba(0, 0, 0, 0.08);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --accent-color: #3b82f6;
  --accent-hover: #2563eb;
  --dropdown-bg: rgba(255, 255, 255, 0.95);
  --transition-speed: 0.3s;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', sans-serif;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-color);
  background-image: linear-gradient(-45deg, #e0f2fe, #f1f5f9, #bae6fd);
  background-size: 400% 400%;
  animation: gradientAnimation 15s ease infinite;
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
}

@keyframes gradientAnimation {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

#app {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#uicontainer,
.uicontainer-overlay {
  position: absolute;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  pointer-events: none;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #60a5fa, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.controls {
  display: flex;
  gap: 1rem;
  pointer-events: auto;
}

button {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-color);
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

button:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

button:active {
  transform: translateY(0);
}


.d-none {
  display: none !important;
}


/* --- Improved Control Layouts --- */
.side-controls-left,
.side-controls-right {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 0.8rem;
  z-index: 10;
  pointer-events: none;
  background: none;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}

.side-controls-left {
  left: 5rem;
}

.side-controls-right {
  right: 5rem;
}

.bottom-controls {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  z-index: 10;
  pointer-events: none;
  width: 100%;
}

.side-controls-left .column,
.side-controls-right .column {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: auto;
}

.bottom-controls .row {
  display: flex;
  gap: 0.5rem;
  pointer-events: auto;
  justify-content: center;
}

/* --- Existing classes refine --- */
/* Button Shaping for 4x4 Controllers */
.side-controls-left button,
.side-controls-right button,
.bottom-controls button {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

/* Color Map Implementation */

/* Left Sidebar: Green / Orange */
.side-controls-left .column:first-child button {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: #15803d;
}

.side-controls-left .column:first-child button:hover {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.5);
}

.side-controls-left .column:last-child button {
  background: rgba(249, 115, 22, 0.1);
  border-color: rgba(249, 115, 22, 0.3);
  color: #c2410c;
}

.side-controls-left .column:last-child button:hover {
  background: rgba(249, 115, 22, 0.2);
  border-color: rgba(249, 115, 22, 0.5);
}

/* Right Sidebar: Blue / Red */
.side-controls-right .column:first-child button {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
  color: #1d4ed8;
}

.side-controls-right .column:first-child button:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.5);
}

.side-controls-right .column:last-child button {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #b91c1c;
}

.side-controls-right .column:last-child button:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
}

/* Bottom Controls: White / Yellow */
.bottom-controls .row:first-child button {
  background: rgba(255, 255, 255, 0.4);
  border-color: rgba(255, 255, 255, 0.6);
  color: #1e3a5f;
}

.bottom-controls .row:first-child button:hover {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(255, 255, 255, 0.8);
}

.bottom-controls .row:last-child button {
  background: rgba(234, 179, 8, 0.15);
  border-color: rgba(234, 179, 8, 0.3);
  color: #a16207;
}

.bottom-controls .row:last-child button:hover {
  background: rgba(234, 179, 8, 0.25);
  border-color: rgba(234, 179, 8, 0.5);
}

.slice-controls-4x4 {
  background: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

#home-view,
#coming-soon-view {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 70px);
  margin-top: 70px;
  width: 100vw;
}

#coming-soon-view h1 {
  font-size: 2.5rem;
  text-align: center;
}

#coming-soon-view h1 span:last-child {
  font-size: 1.5rem;
  font-weight: 300;
  color: #94a3b8;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 3rem;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--nav-border);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  z-index: 1000;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  text-decoration: none;
}

.nav-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(59, 130, 246, 0.35));
  transition: transform 0.35s ease;
}

.nav-brand:hover .nav-logo-img {
  transform: rotate(15deg) scale(1.08);
}

.nav-brand-text {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, #60a5fa, #a855f7);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 1px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2.5rem;
  margin: 0;
  padding: 0;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 1.05rem;
  padding: 0.5rem 0;
  transition: color var(--transition-speed) ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  position: relative;
}

/* Micro-interaction: Animated underline on hover */
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-color);
  transition: width var(--transition-speed) ease;
  border-radius: 2px;
}

.nav-item:not(.dropdown) .nav-link:hover {
  color: var(--accent-hover);
}

.nav-item:not(.dropdown) .nav-link:hover::after {
  width: 100%;
}

/* Dropdown Menu styling */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 15px);
  /* start a bit lower */
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--dropdown-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--nav-border);
  border-radius: 12px;
  padding: 0.75rem;
  list-style: none;
  min-width: 280px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all var(--transition-speed) cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  z-index: 1001;
}

/* Add bridge to keep hover state active when moving from link to dropdown */
.dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 25px;
  /* bridge area */
}

.dropdown:hover .nav-link i {
  color: var(--accent-hover);
  transform: rotate(180deg);
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.dropdown-link {
  color: var(--text-secondary);
  text-decoration: none;
  display: block;
  padding: 0.85rem 1.25rem;
  border-radius: 8px;
  transition: all var(--transition-speed) ease;
  font-size: 0.95rem;
  font-weight: 400;
}

.dropdown-link:hover,
.dropdown-link.active {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
  transform: translateX(6px);
}

.palette-container {
  position: absolute;
  top: 90px;
  right: 1.5rem;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.25);
  padding: 1rem 2rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.palette-container h2 {
  font-size: 1.2rem;
  font-weight: 500;
  color: #1e3a5f;
}

.color-palette {
  display: flex;
  gap: 1rem;
  pointer-events: auto;
}

.swatch {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.2s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.swatch:hover {
  transform: scale(1.1);
}

.swatch.selected {
  border-color: #fff;
  transform: scale(1.15);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
}

.paint-footer {
  position: absolute;
  bottom: 2rem;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 3rem;
  z-index: 10;
  pointer-events: auto;
}

.action-btn {
  background: rgba(255, 255, 255, 0.3);
  color: #1e3a5f;
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 0.8rem 1.5rem;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transition: all 0.25s ease;
  white-space: nowrap;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

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

.action-btn.primary {
  background: rgba(255, 255, 255, 0.35);
}

.cube-rotators {
  display: flex;
  gap: 0.5rem;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.icon-btn {
  background: rgba(255, 255, 255, 0.3);
  color: #1e3a5f;
  border: 1px solid rgba(255, 255, 255, 0.5);
  width: 45px;
  height: 45px;
  font-size: 1.5rem;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transition: all 0.25s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.solver-status {
  color: #1e3a5f;
  font-weight: bold;
}

.action-instruction {
  position: absolute;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: rgba(255, 255, 255, 0.3);
  color: #1e3a5f;
  padding: 0.8rem 2.5rem;
  border-radius: 16px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.playback-footer {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  z-index: 20;
  width: max-content;
}

.notation-instruction {
  position: absolute;
  top: 90px;
  right: 1.5rem;
  z-index: 10;
  background: rgba(255, 255, 255, 0.25);
  color: #1e3a5f;
  padding: 0.6rem 1.2rem;
  border-radius: 12px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  white-space: nowrap;
}

.notation-instruction h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
}

.art-badge {
  position: absolute;
  top: 90px;
  left: 2rem;
  z-index: 10;
  background: rgba(255, 255, 255, 0.25);
  color: #1e3a5f;
  padding: 0.8rem 1.5rem;
  border-radius: 14px;
  font-weight: 700;
  font-size: 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.exit-btn {
  left: auto !important;
  right: 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.exit-btn:hover {
  background: rgba(220, 38, 38, 0.15) !important;
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.3);
  transform: translateY(-2px);
}



.action-instruction p {
  font-size: 1.2rem;
  color: #2c5282;
  font-weight: 500;
  margin: 0;
}

.side-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #1e3a5f;
  font-size: 1.4rem;
  font-weight: 600;
  cursor: pointer;
  padding: 1rem 1.5rem;
  border-radius: 14px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transition: all 0.25s ease;
}

.side-nav:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.side-nav:active {
  transform: translateY(-50%) scale(0.95);
}

.left-nav {
  left: 2rem;
}

.right-nav {
  right: 2rem;
}

.cube-solved-msg {
  position: fixed;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  color: #16a34a;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 2px;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 0.75rem 2.5rem;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(22, 163, 74, 0.15);
  pointer-events: none;
  white-space: nowrap;
}

.side-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.error-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.error-popup {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  padding: 2rem 2.5rem;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
  animation: popIn 0.3s ease;
  text-align: center;
}

@keyframes popIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.error-popup h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #b91c1c;
  margin-bottom: 0.25rem;
}

.error-popup .error-subtitle {
  font-size: 0.95rem;
  color: #1e3a5f;
  margin-bottom: 1rem;
  font-weight: 500;
}

.error-popup ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem 0;
  text-align: left;
}

.error-popup ul li {
  font-size: 0.95rem;
  color: #1e3a5f;
  padding: 0.4rem 0.75rem;
  margin-bottom: 0.35rem;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  border-left: 3px solid #e53e3e;
}

.error-popup .error-footer {
  font-size: 0.9rem;
  color: #4a5568;
  margin-bottom: 1.25rem;
  font-style: italic;
}

.error-popup-btn {
  background: rgba(255, 255, 255, 0.4) !important;
  color: #1e3a5f !important;
  border: 1px solid rgba(255, 255, 255, 0.6) !important;
  padding: 0.6rem 2.5rem !important;
  border-radius: 12px !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  cursor: pointer;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

.error-popup-btn:hover {
  background: rgba(255, 255, 255, 0.55) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12) !important;
}

/* Old dropdown removed */

/* --- Cube Arts Section (Merged) --- */
/* --- Cube Arts Section --- */
#cube-arts-view {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10;
  overflow-y: auto;
  padding: 6rem 2rem 4rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cube-arts-header {
  margin-bottom: 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  padding: 1.5rem 2.5rem;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04);
  width: 100%;
  max-width: 1400px;
}

.header-info h1 {
  font-size: 3.2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #2563eb, #9333ea);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -1.5px;
}

.cube-arts-description {
  font-size: 1.1rem;
  color: #64748b;
  font-weight: 500;
}

.header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1.2rem;
}

.search-box {
  position: relative;
  width: 350px;
}

.search-box i {
  position: absolute;
  left: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 1.1rem;
}

.search-box input {
  width: 100%;
  padding: 0.9rem 1rem 0.9rem 3.2rem;
  background: rgba(255, 255, 255, 0.8);
  border: 1.5px solid rgba(226, 232, 240, 0.8);
  border-radius: 14px;
  font-family: inherit;
  font-size: 1rem;
  color: #1e293b;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.search-box input:focus {
  outline: none;
  background: #ffffff;
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1), 0 4px 12px rgba(0, 0, 0, 0.05);
}

.art-stats {
  display: flex;
  gap: 1rem;
}

.stat-item {
  background: rgba(255, 255, 255, 0.6);
  padding: 0.6rem 1.2rem;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.8);
  min-width: 90px;
}

.stat-value {
  font-size: 1.2rem;
  font-weight: 800;
  color: #2563eb;
  line-height: 1;
  margin-bottom: 2px;
}

.stat-label {
  font-size: 0.75rem;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.cube-arts-content {
  display: flex;
  gap: 3rem;
  width: 100%;
  max-width: 1400px;
  align-items: flex-start;
}

/* Sidebar Styling */
.cube-arts-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 24px;
  padding: 1.5rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 5px;

  max-height: calc(100vh - 120px);
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04);
}

/* Custom scrollbar for sidebar */
.cube-arts-sidebar::-webkit-scrollbar {
  width: 5px;
  height: 10px;
}

.cube-arts-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.cube-arts-sidebar::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
}

.cube-arts-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.1);
}

.sidebar-section {
  margin-bottom: 2rem;
}

.sidebar-section:last-child {
  margin-bottom: 12rem;
}

.sidebar-section h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
  margin-bottom: 1rem;
  padding-left: 0.5rem;
  font-weight: 600;
}

.sidebar-item {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  cursor: pointer;
  color: #475569;
  font-size: 1rem;
  transition: all 0.2s ease;
  margin-bottom: 0.25rem;
  border: 1px solid transparent;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-item-count {
  background: rgba(0, 0, 0, 0.05);
  color: #64748b;
  padding: 0.15rem 0.6rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.sidebar-item:hover .sidebar-item-count {
  background: rgba(255, 255, 255, 0.8);
  color: #0f172a;
}

.sidebar-item.active .sidebar-item-count {
  background: #2563eb;
  color: #ffffff;
}

.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.6);
  color: #0f172a;
  transform: translateX(4px);
}

.sidebar-item.active {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
  border-color: rgba(59, 130, 246, 0.3);
  font-weight: 700;
}

/* Grid and Cards */
.cube-arts-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}



.cube-art-card {
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 24px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.cube-art-card:hover {
  transform: translateY(-10px) scale(1.02);
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.cube-art-img-wrapper {
  height: 250px;
  overflow: hidden;

}

.cube-art-img {
  border-radius: 30px;
  width: 100%;
  height: 100%;
  object-fit: cover;

  padding: 1rem;
  transition: transform 0.4s ease;
}

.cube-art-card:hover .cube-art-img {
  transform: scale(1.35);
}

.cube-art-body {
  padding: 1.2rem;
  background: transparent;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.cube-art-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1e3a5f;
  padding-left: 0.35rem;
  margin-bottom: 0.5rem;
}

.cube-art-id {
  font-size: 1rem;
  font-weight: 600;
  color: #64748b;
  padding-left: 0.35rem;
  margin-bottom: 0.75rem;
}

.cube-art-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: auto;
}

.art-solution-instruction {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  z-index: 10;
  background: rgba(255, 255, 255, 0.25);
  color: #1e3a5f;
  padding: 0.6rem 1.2rem;
  border-radius: 12px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  white-space: nowrap;
}

.art-solution-instruction h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
}

.meta-badge {
  background: rgba(190, 214, 254, 0.08);
  color: #999999;
  padding: 0.35rem 0.8rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid rgba(59, 130, 246, 0.15);
}

.cube-art-card:hover .meta-badge {
  background: rgba(59, 130, 246, 0.15);
  color: #1d4ed8;
}

@media (max-width: 1024px) {
  .cube-arts-content {
    flex-direction: column;
  }

  .cube-arts-sidebar {
    width: 100%;
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
  }

  .sidebar-section {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
  }
}

/* Playback Overlay Adjustments */
#cube-arts-player-view {
  pointer-events: none;
}

#cube-arts-player-view button {
  pointer-events: auto;
}



#modal-cube-container canvas {
  width: 100% !important;
  height: 100% !important;
  outline: none;
}

.no-results {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 2rem;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 24px;
  border: 1px dashed rgba(255, 255, 255, 0.45);
  color: #64748b;
  animation: fadeIn 0.4s ease;
}

.no-results i {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  opacity: 0.5;
  color: var(--accent-color);
}

.no-results h3 {
  font-size: 1.5rem;
  color: #1e3a5f;
  margin-bottom: 1rem;
}

.no-results p {
  font-size: 1.1rem;
  max-width: 400px;
  margin: 0 auto;
}

/* Pattern Model Modal Specifics */
.pattern-modal {
  max-width: 800px !important;
  width: 90% !important;
  height: 80vh !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 1.5rem !important;
}

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

.pattern-modal h3 {
  color: #1e3a5f !important;
  margin: 0 !important;
}

.pattern-modal #modal-cube-container {
  flex: 1;
  width: 100%;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  cursor: grab;
}

.pattern-modal .modal-footer {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #4a5568;
  font-style: italic;
}

/* --- 4x4 Solver Loading Overlay --- */
.loading-popup {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 24px;
  padding: 3rem;
  width: 90%;
  max-width: 450px;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.loading-popup h3 {
  font-size: 1.8rem;
  color: #1e293b;
  font-weight: 700;
  margin: 0;
}

.loading-subtitle {
  font-size: 1rem;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
}

/* Scanner Animation */
.scanner-container {
  position: relative;
  width: 120px;
  height: 120px;
  background: rgba(15, 23, 42, 0.05);
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid rgba(96, 165, 250, 0.2);
}

.cube-wireframe {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60%;
  height: 60%;
  border: 2px solid #60a5fa;
  border-radius: 4px;
  animation: cubeRotate 4s infinite linear;
}

.cube-wireframe::before,
.cube-wireframe::after {
  content: '';
  position: absolute;
  border: 1.5px solid rgba(96, 165, 250, 0.6);
  width: 100%;
  height: 100%;
}

.cube-wireframe::before {
  transform: translate(10px, 10px);
}

.cube-wireframe::after {
  transform: translate(-10px, -10px);
}

@keyframes cubeRotate {
  0% {
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
  }

  50% {
    transform: translate(-50%, -50%) rotate(180deg) scale(1.1);
  }

  100% {
    transform: translate(-50%, -50%) rotate(360deg) scale(1);
  }
}

.scanner-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(to right, transparent, #60a5fa, transparent);
  box-shadow: 0 0 15px #60a5fa;
  z-index: 5;
  animation: scanMove 2s infinite ease-in-out;
}

@keyframes scanMove {
  0% {
    top: 0;
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  90% {
    opacity: 1;
  }

  100% {
    top: 100%;
    opacity: 0;
  }
}

/* Loading Bar */
.loading-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 999px;
  overflow: hidden;
}

.loading-bar {
  width: 30%;
  height: 100%;
  background: linear-gradient(to right, #60a5fa, #c084fc);
  border-radius: 999px;
  animation: loadingBarPulse 2s infinite ease-in-out;
}

@keyframes loadingBarPulse {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(350%);
  }
}

.cancel-btn {
  margin-top: 0.5rem;
  background: rgba(239, 68, 68, 0.1) !important;
  color: #ef4444 !important;
  border: 1px solid rgba(239, 68, 68, 0.2) !important;
}

.cancel-btn:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}