* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, sans-serif;
  background: #14161a;
  color: #e8e8e8;
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  background: #1c1f26;
  padding: 20px 12px;
  flex-shrink: 0;
  border-right: 1px solid #2a2e37;
}

.sidebar h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8a8f9a;
  margin: 0 8px 16px;
}

.menu-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: #cfd3da;
  padding: 12px 14px;
  margin-bottom: 4px;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s;
}

.menu-btn:hover {
  background: #262a33;
}

.menu-btn.active {
  background: #3a5bd9;
  color: #fff;
}

.content {
  flex: 1;
  padding: 24px 32px;
  overflow-y: auto;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-header h1 {
  font-size: 22px;
  margin: 0;
}

.panel-header button {
  background: #2a2e37;
  color: #e8e8e8;
  border: 1px solid #3a3f4a;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.panel-header button:hover {
  background: #3a3f4a;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.grid img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 8px;
  background: #1c1f26;
  display: block;
}

/* Large layout used for the Random Images panel - 2 column grid, centered */
.grid-large {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 1320px;
  margin: 0 auto;
}

.grid-large img {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: contain;
  border-radius: 10px;
  background: #1c1f26;
  display: block;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

/* Stack to a single column on narrower windows */
@media (max-width: 900px) {
  .grid-large {
    grid-template-columns: 1fr;
  }
}

.text-content {
  white-space: pre-wrap;
  line-height: 1.6;
  color: #cfd3da;
  max-width: 700px;
}

.empty-message {
  color: #8a8f9a;
  font-size: 14px;
}
