/* Material Design-inspired dark palette */
:root {
  --background: #121212;
  --panel: #1E1E1E;
  --accent: #BB86FC;
  --highlight: #03DAC6;
  --text: #E0E0E0;
  --error: #CF6679;
  --success: #03DAC6;
  --shadow: 0 4px 8px rgba(0,0,0,0.5);
}

body {
  background: var(--background);
  color: var(--text);
  font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
  margin: 0;
  min-height: 100vh;
}

#app-container {
  display: flex;
  min-height: 100vh;
}

#sidebar {
  background: var(--panel);
  box-shadow: var(--shadow);
  width: 320px;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2rem;
}

#sidebar h2 {
  color: var(--accent);
  margin-bottom: 0.5rem;
}

#current-painting {
  background: linear-gradient(135deg, var(--highlight) 20%, var(--accent) 80%);
  border-radius: 0.75rem;
  padding: 1rem;
  min-height: 60px;
  box-shadow: var(--shadow);
  font-size: 1.2rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 1rem;
  color: var(--background);
}

#grok-thoughts {
  background: linear-gradient(90deg, var(--panel) 80%, var(--accent) 100%);
  border-radius: 0.75rem;
  padding: 1rem;
  min-height: 80px;
  box-shadow: var(--shadow);
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

#new-painting-btn {
  background: var(--accent);
  color: var(--text);
  border: none;
  border-radius: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.2s, box-shadow 0.2s;
}
#new-painting-btn:hover {
  background: var(--highlight);
  color: var(--background);
  box-shadow: 0 6px 16px rgba(3,218,198,0.3);
}

#main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 2rem 2rem 2rem 0;
  gap: 2rem;
}

#canvas-section {
  background: var(--panel);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 480px;
  margin-bottom: 2rem;
  position: relative;
}

/* p5.js canvas will be injected here, so style the canvas */
canvas {
  border-radius: 1rem;
  box-shadow: var(--shadow);
  background: #181818;
  display: block;
}

#gallery-section {
  background: var(--panel);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  padding: 1.5rem;
}
#gallery-section h2 {
  color: var(--highlight);
  margin-bottom: 1rem;
}

#gallery-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  overflow-x: auto;
  padding-bottom: 1rem;
}

.gallery-card {
  background: linear-gradient(135deg, #232323 70%, var(--panel) 100%);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  padding: 1rem;
  min-width: 220px;
  max-width: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  position: relative;
}

.gallery-card img {
  width: 100%;
  border-radius: 0.75rem;
  box-shadow: var(--shadow);
  background: #181818;
}

.vote-buttons {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.vote-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  transition: background 0.2s;
  color: var(--text);
}
.vote-btn.upvote {
  color: var(--success);
}
.vote-btn.downvote {
  color: var(--error);
}
.vote-btn:active {
  background: rgba(187,134,252,0.1);
}

.vote-count {
  font-size: 1.1rem;
  font-weight: bold;
  min-width: 2rem;
  text-align: center;
}

@media (max-width: 900px) {
  #app-container {
    flex-direction: column;
  }
  #sidebar {
    width: 100%;
    flex-direction: row;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
  }
  #main-content {
    padding: 1rem;
  }
}

::-webkit-scrollbar {
  width: 8px;
  background: #181818;
}
::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
} 