/* Unified theme for NFT Mural pages */
:root {
  --bg-start: #0f2027;
  --bg-mid: #203a43;
  --bg-end: #2c5364;
  --card-bg: #111827;
  --muted: #9CA3AF;
  --text: #E5E7EB;
  --accent: #06B6D4; /* cyan-500 */
  --accent-600: #0891B2;
  --accent-700: #0E7490;
  --danger: #EF4444;
  --success: #10B981;
  --border: #1F2937;
  --shadow: rgba(0,0,0,0.4);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: linear-gradient(135deg, var(--bg-start), var(--bg-mid) 40%, var(--bg-end));
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
a:focus { outline: 2px dashed var(--accent); outline-offset: 2px; }

/* Header / Nav */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.brand .logo {
  width: 28px; height: 28px;
  border-radius: 6px;
  background-color: transparent;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'><rect width='28' height='28' rx='6' fill='%23111827'/><g><rect x='4' y='4' width='6' height='6' rx='1' fill='%2306B6D4'/><rect x='12' y='4' width='6' height='6' rx='1' fill='%2349C7F2'/><rect x='20' y='4' width='4' height='6' rx='1' fill='%2350A5F9'/><rect x='4' y='12' width='6' height='6' rx='1' fill='%235EEAD4'/><rect x='12' y='12' width='6' height='6' rx='1' fill='%2306B6D4'/><rect x='20' y='12' width='4' height='6' rx='1' fill='%2310B981'/><rect x='4' y='20' width='6' height='4' rx='1' fill='%230891B2'/><rect x='12' y='20' width='6' height='4' rx='1' fill='%2349C7F2'/><rect x='20' y='20' width='4' height='4' rx='1' fill='%2350A5F9'/></g></svg>");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.35);
}
.nav {
  display: flex;
  gap: 10px;
}
.nav a {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  color: var(--muted);
}
.nav a:hover { color: var(--text); background: rgba(255,255,255,0.04); border-color: var(--border); }
.nav a.active { color: var(--text); background: rgba(6, 182, 212, 0.12); border-color: rgba(6,182,212,0.4); }

/* Page container */
.page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  width: 100%;
  max-width: 1100px;
  background: rgba(17, 24, 39, 0.8);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 30px var(--shadow);
  padding: 20px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-title { font-size: 20px; font-weight: 700; }
.card-subtitle { color: var(--muted); font-size: 14px; }

/* Common elements */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  color: var(--text);
  cursor: pointer;
  transition: transform 0.05s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:hover { background: rgba(255,255,255,0.08); }
.btn:active { transform: translateY(1px); }
.btn-primary { border-color: rgba(6,182,212,0.4); background: linear-gradient(180deg, rgba(6,182,212,0.25), rgba(6,182,212,0.15)); }
.btn-primary:hover { background: linear-gradient(180deg, rgba(6,182,212,0.35), rgba(6,182,212,0.22)); }
.btn-secondary { border-color: rgba(156,163,175,0.4); background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03)); }
.btn-danger { border-color: rgba(239,68,68,0.4); background: linear-gradient(180deg, rgba(239,68,68,0.25), rgba(239,68,68,0.15)); }
.btn-ghost { background: transparent; }

.input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(31, 41, 55, 0.7);
  color: var(--text);
}
.input::placeholder { color: var(--muted); }

.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.center { display: flex; align-items: center; justify-content: center; }

/* Image and canvas containers */
.media-frame {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255,255,255,0.02);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}
.media-frame img, .media-frame canvas { display: block; }

/* Editor specific */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.color-label { color: var(--muted); font-size: 14px; }
.color-input { height: 36px; width: 48px; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: transparent; }

.canvas-wrap { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

/* Footer */
.footer { color: var(--muted); font-size: 12px; text-align: center; margin-top: 8px; }

/* Full-height media layout for main/buy/edit */
.page.fullheight-media {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
}
.page.fullheight-media .card {
  width: 100%;
  max-width: none;
  height: 100%;
  border-radius: 0;
  border-left: none;
  border-right: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  padding: 12px 16px; /* keep minimal padding for header/footer inside */
}
.page.fullheight-media .card-header { margin-bottom: 8px; }
.page.fullheight-media .center {
  flex: 1;
  min-height: 0; /* allow child to size within flex container */
  align-items: stretch;
  justify-content: stretch;
}
.page.fullheight-media .media-frame {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.page.fullheight-media .media-frame img,
.page.fullheight-media .media-frame canvas {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Responsive */
@media (max-width: 740px) {
  .header-inner { padding: 10px 14px; }
  .card { padding: 16px; }
}
