

/* =====================================================
   BASE RESET
===================================================== */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background: #ffffff;
  color: #111827;
}

/* =====================================================
   TOOL CONTAINER
===================================================== */
.tool-container {
  max-width: 900px;
  margin: 20px auto;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.12);
  background: #fff;
}

/* =====================================================
   CONTROLS
===================================================== */
.top-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.top-controls input[type="text"],
.top-controls input[type="color"] {
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  outline: none;
}

.top-controls .btn,
.btn {
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  background: #4CAF50;
  color: #fff;
  cursor: pointer;
  transition: 0.2s ease;
}

.top-controls .btn:hover,
.btn:hover {
  background: #45a049;
}

/* =====================================================
   PALETTE SYSTEM (FIXED + UNIFIED)
===================================================== */
.palette {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 60px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}

.color-box,
.color-stop {
  width: 100px;
  height: 100px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  user-select: none;
  color: #fff;
  font-size: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.color-box:hover,
.color-stop:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

.color-code {
  font-size: 12px;
  text-align: center;
  pointer-events: none;
}

/* DELETE BUTTON FIXED */
.delete-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: #ff4d4d;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
}

.delete-btn:hover {
  opacity: 1;
}

/* =====================================================
   CSS SNIPPET OUTPUT
===================================================== */
#cssSnippet {
  background: #111827;
  color: #22c55e;
  padding: 10px;
  border-radius: 6px;
  overflow-x: auto;
  white-space: pre-wrap;
  font-family: monospace;
}

/* =====================================================
   TOAST
===================================================== */
.toast {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  opacity: 0;
  transition: 0.3s;
  z-index: 9999;
}

/* =====================================================
   SHARED SECTIONS
===================================================== */
.palette-examples,
.color-psychology,
.build-palette,
.color-accessibility,
.palette-types {
  max-width: 1000px;
  margin: 70px auto;
  padding: 30px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.05);
}

.palette-examples h2,
.color-psychology h2,
.build-palette h2,
.color-accessibility h2,
.palette-types h2 {
  font-size: 28px;
  margin-bottom: 15px;
  color: #111827;
}

.palette-examples p,
.color-psychology p,
.build-palette p,
.color-accessibility p,
.palette-types p {
  color: #4b5563;
  line-height: 1.7;
}

/* =====================================================
   GRIDS
===================================================== */
.palette-grid,
.palette-types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

/* =====================================================
   CARDS
===================================================== */
.palette-card,
.palette-type {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  padding: 20px;
  border-radius: 10px;
  transition: 0.25s;
}

.palette-card:hover,
.palette-type:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.08);
}

/* =====================================================
   COLORS PREVIEW
===================================================== */
.colors {
  display: flex;
  gap: 6px;
  margin: 15px 0;
}

.colors span {
  flex: 1;
  height: 40px;
  border-radius: 4px;
}

/* =====================================================
   LISTS
===================================================== */
.psychology-list,
.accessibility-list,
.palette-steps {
  margin-top: 20px;
  padding-left: 20px;
}

.psychology-list li,
.accessibility-list li,
.palette-steps li {
  margin-bottom: 10px;
}



/* =========================
   IMAGE FIX (IMPORTANT FIX)
========================= */

.intro-image {
  flex: 1 1 420px;
  min-width: 280px;
  max-width: 600px;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
}

.intro-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  transition: transform 0.4s ease;
  object-fit: cover;
}

/* hover only on container (not nested bug) */
.intro-image:hover img {
  transform: scale(1.05);
}

/* caption */
.intro-image figcaption {
  font-size: 0.85rem;
  color: #6b7280;
  margin-top: 0.5rem;
  text-align: center;
}

.intro-image figcaption a {
  color: #2563eb;
}

/* =========================
   TEXT SIDE
========================= */

.intro-text {
  flex: 1 1 420px;
  min-width: 280px;
  max-width: 700px;
}

.intro-text h1,
.intro-text h2 {
  font-size: 1.9rem;
  margin-bottom: 1rem;
  color: #111827;
  line-height: 1.2;
}

.intro-text p {
  font-size: 1rem;
  line-height: 1.7;
  color: #374151;
  margin-bottom: 1rem;
}

.intro-text strong {
  color: #2563eb;
}

/* =========================
   RESPONSIVE FIX
========================= */

@media (max-width: 900px) {
  .intro-grid {
    flex-direction: column;
    text-align: center;
  }

  .intro-text,
  .intro-image {
    max-width: 100%;
  }
}

/* =========================
   DARK MODE – CLEAN UNIFIED
========================= */

body.dark,
body.dark-mode,
.dark-mode body {
  background: #0f172a;
  color: #e5e7eb;
}

body.dark .intro-grid,
body.dark-mode .intro-grid {
  background: #111827;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}

body.dark .intro-text h1,
body.dark .intro-text h2,
body.dark-mode .intro-text h1,
body.dark-mode .intro-text h2 {
  color: #f9fafb;
}

body.dark .intro-text p,
body.dark-mode .intro-text p {
  color: #d1d5db;
}

body.dark .intro-image figcaption,
body.dark-mode .intro-image figcaption {
  color: #9ca3af;
}

body.dark .intro-image figcaption a {
  color: #60a5fa;
}

