/* ═══════════════════════════════════════════════════════════
   ELDRAVAN ALCHEMY BOOK — UI Styles
   ═══════════════════════════════════════════════════════════ */

#tab-alchemy {
  background: var(--bg-dark, #0a0a0a) url('/regions/eldravan_raw_map.jpg') no-repeat center center;
  background-size: cover;
  background-blend-mode: overlay;
}

#tab-alchemy .alc-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(100vh - 60px);
  padding: 20px;
}

/* The Open Book */
.alc-book {
  position: relative;
  display: flex;
  width: 900px;
  height: 600px;
  background: #2b2118; /* Dark leather cover */
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.8), inset 0 0 0 8px #1a120b;
  padding: 10px; /* Cover padding */
}

/* Spine shadow */
.alc-book::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 100%;
  background: linear-gradient(to right, 
    rgba(0,0,0,0.8) 0%, 
    rgba(0,0,0,0.3) 30%, 
    rgba(0,0,0,0.0) 50%, 
    rgba(0,0,0,0.3) 70%, 
    rgba(0,0,0,0.8) 100%);
  z-index: 5;
  pointer-events: none;
}

.alc-page {
  flex: 1;
  background: #e6d8c3; /* Old parchment color */
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Texture overlay for pages */
.alc-page::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.1'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

.alc-left-page {
  border-radius: 8px 0 0 8px;
  box-shadow: inset -10px 0 20px rgba(0,0,0,0.2);
  padding: 40px 30px;
  z-index: 1;
}

.alc-right-page {
  border-radius: 0 8px 8px 0;
  box-shadow: inset 10px 0 20px rgba(0,0,0,0.2);
  padding: 40px 30px;
  z-index: 1;
}

/* Page contents */
.alc-content {
  position: relative;
  z-index: 2;
  height: 100%;
  overflow-y: auto;
}

.alc-content::-webkit-scrollbar { width: 4px; }
.alc-content::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.3); border-radius: 2px; }

/* LEFT PAGE: Index/List */
.alc-header {
  font-family: serif;
  font-size: 28px;
  font-weight: bold;
  color: #3b2a1a;
  text-align: center;
  border-bottom: 2px solid #5a4228;
  padding-bottom: 15px;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.alc-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.alc-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  border: 1px dashed transparent;
}
.alc-list-item:hover {
  background: rgba(0,0,0,0.05);
  border-color: rgba(90,66,40,0.3);
}
.alc-list-item.active {
  background: rgba(0,0,0,0.08);
  border-color: #5a4228;
}

.alc-icon-frame {
  width: 40px; height: 40px;
  background: #cbbba3;
  border-radius: 5px;
  border: 1px solid #88745c;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.alc-icon-frame img {
  width: 30px; height: 30px;
  filter: brightness(0) sepia(1) hue-rotate(340deg) saturate(3) opacity(0.8); /* Make SVG look ink-drawn */
}
.alc-icon-frame.locked img {
  filter: brightness(0) opacity(0.2);
}

.alc-item-info { flex: 1; }
.alc-item-name {
  font-size: 16px;
  font-weight: bold;
  color: #2b1f13;
}
.alc-item-cat {
  font-size: 12px;
  color: #5a4228;
  font-style: italic;
}
.alc-locked-text {
  color: #88745c;
  font-style: italic;
  font-size: 14px;
}

/* RIGHT PAGE: Details */
.alc-detail {
  display: none; /* Shown when selected */
  flex-direction: column;
  height: 100%;
}
.alc-detail.active {
  display: flex;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.alc-detail-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #88745c;
  font-size: 18px;
  font-style: italic;
  font-family: serif;
}

.alc-d-header {
  text-align: center;
  margin-bottom: 20px;
}
.alc-d-title {
  font-size: 24px;
  color: #2b1f13;
  font-weight: bold;
  font-family: serif;
  margin-bottom: 5px;
}
.alc-d-meta {
  font-size: 13px;
  color: #5a4228;
  font-style: italic;
}

.alc-d-image {
  width: 120px;
  height: 120px;
  margin: 0 auto 20px;
  display: block;
  filter: brightness(0) sepia(1) hue-rotate(340deg) saturate(2); /* Ink look */
}

.alc-d-section {
  margin-bottom: 15px;
}
.alc-d-section-title {
  font-size: 14px;
  font-weight: bold;
  text-transform: uppercase;
  color: #5a4228;
  border-bottom: 1px solid rgba(90,66,40,0.3);
  padding-bottom: 4px;
  margin-bottom: 8px;
}
.alc-d-text {
  font-size: 14px;
  line-height: 1.6;
  color: #3b2a1a;
}

.alc-recipe {
  background: rgba(0,0,0,0.03);
  border: 1px solid rgba(90,66,40,0.2);
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 8px;
}
.alc-recipe-name {
  font-weight: bold;
  color: #2b1f13;
  margin-bottom: 4px;
}
.alc-recipe-ing {
  font-size: 12px;
  color: #5a4228;
  margin-bottom: 4px;
}
.alc-recipe-res {
  font-size: 13px;
  color: #812519; /* Blood red text for results */
  font-weight: bold;
}

/* DM Controls */
.alc-dm-controls {
  margin-top: auto;
  display: flex;
  gap: 10px;
  padding-top: 15px;
  border-top: 1px dashed rgba(90,66,40,0.3);
}
.alc-btn {
  background: #5a4228;
  color: #e6d8c3;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  font-size: 12px;
  transition: 0.2s;
  flex: 1;
}
.alc-btn:hover {
  background: #3b2a1a;
}
.alc-btn.unlock {
  background: #c8a94e;
  color: #000;
}
.alc-btn.unlock:hover {
  background: #e2c058;
}
