.example-container {
  margin: 20px 0;
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #f9f9f9;
}

.demo-controls {
  margin-bottom: 15px;
}

.demo-controls label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

.demo-controls select {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}

.grid-demo {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  padding: 20px;
  background: white;
  border: 2px solid #007cbe;
  border-radius: 6px;
  justify-items: stretch;
  transition: all 0.3s ease;
}

.grid-item {
  background: #007cbe;
  color: white;
  padding: 15px;
  text-align: center;
  border-radius: 4px;
  font-weight: bold;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.code-example {
  margin: 15px 0;
  background: #f4f4f4;
  border-left: 4px solid #007cbe;
  padding: 15px;
  border-radius: 4px;
}

.code-example pre {
  margin: 0;
  background: none;
  font-size: 14px;
  line-height: 1.4;
}

.visual-example {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  padding: 20px;
  background: white;
  border: 2px solid #28a745;
  border-radius: 6px;
  margin: 15px 0;
}

.stretch-example {
  justify-items: stretch;
}

.start-example {
  justify-items: start;
}

.end-example {
  justify-items: end;
}

.center-example {
  justify-items: center;
}

.override-example {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  padding: 20px;
  background: white;
  border: 2px solid #dc3545;
  border-radius: 6px;
  margin: 15px 0;
  justify-items: center;
}

.override-example .special {
  justify-self: start;
  background: #dc3545;
}

.card-demo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 20px 0;
  justify-items: stretch;
}

.card {
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
}

.card h4 {
  margin: 0 0 10px 0;
  color: #333;
}

.card p {
  flex-grow: 1;
  margin: 0 0 15px 0;
  color: #666;
  line-height: 1.5;
}

.card-button {
  background: #007cbe;
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  align-self: flex-start;
}

.card-button:hover {
  background: #005a8a;
}

.nav-demo {
  margin: 20px 0;
}

.grid-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 15px;
  background: #333;
  border-radius: 6px;
  justify-items: center;
}

.nav-item {
  color: white;
  text-decoration: none;
  padding: 10px 15px;
  border-radius: 4px;
  transition: background 0.3s ease;
  font-weight: bold;
}

.nav-item:hover {
  background: #555;
}

@media (max-width: 768px) {
  .grid-demo {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .visual-example {
    grid-template-columns: 1fr;
  }
  
  .override-example {
    grid-template-columns: 1fr;
  }
  
  .grid-nav {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .grid-demo {
    grid-template-columns: 1fr;
  }
  
  .grid-nav {
    grid-template-columns: 1fr;
  }
}