body {
  background-color: #282c34;
  color: white;
  font-family: sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
  box-sizing: border-box;
}

.header {
  text-align: center;
  margin-bottom: 20px;
}

.header h1 {
  color: #61dafb;
  margin-bottom: 10px;
}

.header p {
  color: #ccc;
  margin-bottom: 20px;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.control-button {
  background-color: #61dafb;
  color: #282c34;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition:
    background-color 0.2s,
    transform 0.1s;
}

.control-select {
  background-color: #3a3f4b;
  color: white;
  border: 1px solid #61dafb;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

.control-button:hover {
  background-color: #4fa8d1;
}

.control-button:active {
  transform: scale(0.95);
}

/* Parent-left layout (default) */
.demo-layout.parent-left {
  display: flex;
  flex-direction: row;
  gap: 30px;
  max-width: 1000px;
  margin: 0 auto;
}

/* Parent-right layout */
.demo-layout.parent-right {
  display: flex;
  flex-direction: row-reverse;
  gap: 30px;
  max-width: 1000px;
  margin: 0 auto;
}

/* Categories sidebar */
.categories {
  width: 200px;
  flex-shrink: 0;
}

.categories h2 {
  color: #61dafb;
  margin-top: 0;
  margin-bottom: 15px;
  text-align: center;
}

.category-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.category-item {
  padding: 10px;
  background-color: #3a3f4b;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: bold;
}

.category-item.focus-engine-active {
  background-color: #61dafb;
  color: #20232a;
  border-color: #ffdd57;
  box-shadow: 0 0 15px rgba(255, 221, 87, 0.7);
  transform: scale(1.05);
}

/* Category groups in grid container */
.category-group {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  width: 100%;
  margin-bottom: 15px;
  display: none; /* Hide by default */
}

.category-group[data-category-active] {
  display: flex;
}

/* Original container styles */
.container {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 20px;
  padding: 20px;
  flex-grow: 1;
  border: 2px solid #61dafb;
  border-radius: 10px;
  background-color: #20232a;
}

/* Base style for focusable elements */
.focusable {
  background-color: #61dafb;
  color: #20232a;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  cursor: pointer;
  transition:
    transform 0.1s ease,
    box-shadow 0.1s ease,
    border-color 0.1s ease;
  outline: none;
  border: 3px solid transparent;
  box-sizing: border-box;
  font-weight: bold;
  text-align: center;
  padding: 5px;
}

/* Classes for different sizes */
.item-small {
  width: 80px;
  height: 50px;
}
.item-medium {
  width: 120px;
  height: 70px;
}
.item-large {
  width: 150px;
  height: 90px;
}
.item-wide {
  width: 260px;
  height: 60px;
}
.item-tall {
  width: 100px;
  height: 140px;
}

/* Style for focused element */
.focusable.focus-engine-active {
  border-color: #ffdd57;
  box-shadow: 0 0 15px rgba(255, 221, 87, 0.7);
  transform: scale(1.05);
  z-index: 10;
  position: relative;
}

.footer {
  margin-top: 30px;
  width: 100%;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.log-panel {
  background-color: #20232a;
  border: 2px solid #61dafb;
  border-radius: 8px;
  padding: 15px;
}

.log-panel h3 {
  color: #61dafb;
  margin-top: 0;
  margin-bottom: 10px;
  text-align: center;
}

.log-content {
  height: 150px;
  overflow-y: auto;
  background-color: #1a1d24;
  padding: 10px;
  border-radius: 4px;
  font-family: monospace;
  color: #ddd;
}

/* TV Remote Control Styles */
.remote-control-wrapper {
  display: flex;
  justify-content: center;
  margin: 30px 0;
}

.remote-control {
  background-color: #333844;
  border-radius: 15px;
  padding: 20px;
  width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  border: 2px solid #4a4f5c;
}

.remote-header {
  font-weight: bold;
  color: #61dafb;
  margin-bottom: 5px;
}

.remote-nav-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.remote-nav-row {
  display: flex;
  gap: 10px;
  width: 100%;
  justify-content: center;
}

.remote-btn {
  border: none;
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  outline: none;
}

.remote-btn:active {
  transform: scale(0.95);
  box-shadow: 0 0 8px rgba(97, 218, 251, 0.7);
}

.remote-nav-btn {
  background-color: #4a4f5c;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remote-ok-btn {
  background-color: #61dafb;
  color: #20232a;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 16px;
}

.remote-action-btn {
  background-color: #e74c3c;
  padding: 8px 20px;
  border-radius: 5px;
  font-size: 14px;
  margin-top: 5px;
}

.remote-nav-btn:hover,
.remote-ok-btn:hover {
  background-color: #5ab9d6;
  box-shadow: 0 0 10px rgba(97, 218, 251, 0.5);
}

.remote-action-btn:hover {
  background-color: #c0392b;
}

/* Responsiveness (example) */
@media (max-width: 900px) {
  .demo-layout.parent-left,
  .demo-layout.parent-right {
    max-width: 100%;
  }

  .categories {
    width: 180px;
  }

  .category-list {
    gap: 8px;
  }

  .category-item {
    padding: 8px;
  }

  .container,
  .grid-container {
    gap: 15px;
    padding: 15px;
  }

  .remote-control {
    width: 180px;
    padding: 15px;
  }
}

@media (max-width: 750px) {
  .container,
  .grid-container {
    gap: 12px;
    padding: 12px;
  }

  .controls {
    flex-wrap: wrap;
  }

  .control-button,
  .control-select {
    font-size: 14px;
    padding: 6px 12px;
  }

  .remote-control {
    width: 160px;
    padding: 12px;
  }

  .remote-nav-btn {
    width: 35px;
    height: 35px;
    font-size: 16px;
  }

  .remote-ok-btn {
    width: 45px;
    height: 45px;
  }
}

@media (max-width: 600px) {
  .demo-layout.parent-left,
  .demo-layout.parent-right {
    flex-direction: column;
  }

  .categories {
    width: 100%;
    margin-bottom: 15px;
  }

  .category-list {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .category-item {
    width: calc(33.33% - 8px);
  }

  .container,
  .grid-container {
    gap: 10px;
    padding: 10px;
  }

  .item-small {
    width: 70px;
    height: 45px;
  }

  .item-medium {
    width: 100px;
    height: 60px;
  }

  .item-large {
    width: 130px;
    height: 80px;
  }

  .item-wide {
    width: 200px;
    height: 50px;
  }

  .item-tall {
    width: 90px;
    height: 120px;
  }

  .remote-control-wrapper {
    margin: 20px 0;
  }

  .remote-control {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    width: auto;
    padding: 10px;
    gap: 10px;
  }

  .remote-header {
    width: 100%;
    text-align: center;
    margin-bottom: 0;
  }

  .remote-action-btn {
    margin-top: 0;
  }
}

@media (max-width: 450px) {
  .container,
  .grid-container {
    padding: 8px;
    gap: 8px;
  }

  .category-item {
    width: calc(50% - 4px);
  }

  .item-small {
    width: 60px;
    height: 40px;
    font-size: 12px;
  }

  .item-medium {
    width: 80px;
    height: 50px;
    font-size: 12px;
  }

  .item-large {
    width: 100px;
    height: 65px;
  }

  .item-wide {
    width: calc(100% - 16px);
    height: 45px;
  }

  .item-tall {
    width: 80px;
    height: 100px;
  }

  .remote-nav-btn {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  .remote-ok-btn {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }

  .remote-action-btn {
    padding: 6px 15px;
    font-size: 12px;
  }
}
