/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
  /* Default scale multiplier when the window is 1920px or wider */
  --stage-scale: 1;
}

.mobile-menu-button,
.tablet-menu-button {
  display: none;
}

.home-page {
  width: 100%;
  min-height: 100vh;
  background: #000000;
  display: flex;
  justify-content: center;
  align-items: center; /* Centers the scaled stage vertically in the viewport */
  overflow: hidden;    /* Prevents scrollbars from appearing during downscaling */
}

.home-stage {
  position: relative;
  width: 1920px;
  height: 1080px;

  /* Centers the transform origin so scaling happens from the middle */
  transform-origin: center center;

  /* Dynamically applies the downscaling multiplier */
  transform: scale(var(--stage-scale));

  /* Prevents structural collapsing of the layout container in the DOM flow */
  flex-shrink: 0;

  background-image: url("/assets/Maps/background_home-00fe5ab7.png");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: 1920px 1080px;
}

.faerinoth-world {
  position: absolute;
  width: 425px;
  height: 425px;
  left: 50%;
  top: 160px;
  transform: translateX(-50%);
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #111827;
  color: #e5e7eb;
}

.home-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  background: #000000;
  border-bottom: 1px solid #172554;
}

.home-header h1 {
  margin: 0;
}

.home-header p {
  margin: 5px 0 0;
  color: #9ca3af;
}

.main-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
}

.nav-link {
  background: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 120px;
  height: 42px;

  color: #e5e7eb;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;

  border-radius: 6px;
  box-sizing: border-box;
}

.nav-link-active {
  background: #16a34a;
  color: white;
}

.nav-link:hover {
  background: #475569;
  color: white;
}

.nav-link-active:hover {
  background: #15803d;
}

.home-header > div:first-child {
  min-width: 220px;
}

.home-header .button_to {
  margin-left: auto;
}

.signin-button {
  display: inline-block;
  background: #16a34a;
  color: white;
  padding: 12px 22px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
}

.signin-button:hover {
  background: #15803d;
  color: white;
}

.guest-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.signup-button {
  display: inline-block;
  background: #2563eb;
  color: white;
  padding: 12px 22px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
}

.signup-button:hover {
  background: #1d4ed8;
  color: white;
}

.admin-external-bar {
  width: 100%;
  height: 32px;
  background: #111827;

  display: flex;
  align-items: center;
  justify-content: flex-start;

  padding-left: 40px;
  box-sizing: border-box;

  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(0, 0, 0, 0.25);
}

.admin-external-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.external-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 120px;
  height: 26px;
  padding: 0 14px;

  background-color: #ffffff;
  color: #000000;

  text-decoration: none;
  font-size: 13px;
  font-weight: 700;

  border-radius: 4px;
  box-sizing: border-box;
}

.external-nav-link:hover {
  background: #f3f4f6;
  color: #5f330b;
}

.login-links {
  margin-top: 10px;
  text-align: center;
}

.login-link,
.login-link:visited {
  color: #60a5fa;
  text-decoration: none;
  font-size: 14px;
}

.login-link:hover {
  color: #93c5fd;
  text-decoration: underline;
}

.gallery-menu {
  position: relative;
}

.gallery-menu-button {
  width: 190px;
  cursor: pointer;
  list-style: none;
}

.gallery-menu-button::-webkit-details-marker {
  display: none;
}

.gallery-menu-button::after {
  content: "▼";
  margin-left: 8px;
  font-size: 10px;
}

.gallery-menu[open] .gallery-menu-button::after {
  content: "▲";
}

.gallery-menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 1000;

  min-width: 190px;
  padding: 6px;

  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 6px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.gallery-menu-link {
  display: block;
  padding: 10px 12px;

  color: #e5e7eb;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;

  border-radius: 4px;
}

.gallery-menu-link:hover {
  background: #475569;
  color: white;
}

.gallery-menu-link-active {
  background: #16a34a;
  color: white;
}

.gallery-menu-link-active:hover {
  background: #15803d;
}

.explore-books-button {
  display: flex;
  flex-direction: column;
  justify-content: center;

  /*background: #AE6502;*/
  background: #472301;
  color: #ffffff;

  padding: 10px 16px;
  border-radius: 6px;

  text-decoration: none;
  line-height: 1.2;

  border: 2px solid #d4af37;
  box-shadow: inset 0 0 0 2px #078f42;
}

.explore-books-title {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  font-weight: 700;
}

.explore-books-subtitle {
  display: block;
  margin-top: 3px;
  font-size: 14px;
}

.explore-books-button:hover {
  background: #0c9d48;
  color: #ffffff;
  text-decoration: none;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 40px;
  background: #1f2937;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.login-card h1 {
  margin: 0;
  text-align: center;
  font-size: 38px;
}

.login-subtitle {
  text-align: center;
  color: #9ca3af;
  margin-bottom: 30px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 7px;
  font-weight: bold;
}

.form-group input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid #4b5563;
  border-radius: 6px;
  background: #111827;
  color: white;
  font-size: 16px;
}

.login-button,
.logout-button {
  border: 0;
  border-radius: 6px;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
}

.login-button {
  width: 100%;
  background: #2563eb;
  color: white;
}

.logout-button {
  background: #dc2626;
  color: white;
}

.forgot-password {
  text-align: center;
  margin-top: 20px;
}

.forgot-password a {
  color: #93c5fd;
}

.login-alert {
  background: #7f1d1d;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 20px;
}

.login-notice {
  background: #14532d;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 20px;
}

.books-showcase {
  width: 1100px;
  max-width: calc(100% - 80px);
  margin: 50px auto;

  display: grid;
  grid-template-columns: 360px 1fr;
  column-gap: 60px;
  row-gap: 30px;

  align-items: center;
}

body:has(.books-showcase) {
  background: #000000;
}

.book-cover {
  display: flex;
  justify-content: center;
}

.book-cover img {
  display: block;
  width: 320px;
  height: auto;
}

.book-info {
  color: #ffffff;
  position: relative;
  top: -60px;
}

.book-info h1 {
  margin: 0 0 30px;
  color: #d4af37;
  font-size: 32px;
}

.book-format {
  margin-bottom: 22px;
  font-size: 22px;
}

.book-format span {
  display: block;
}

.book-format strong {
  display: block;
  margin-top: 4px;
  font-size: 34px;
}

.book-description {
  position: absolute;
  left: 140px;
  top: 50px;
  width: 640px;
  font-size: 14px;
  line-height: 1.5;
  color: #ffffff;
}

.amazon-book-link {
  display: block;
  width: 120px;
  height: auto;
  margin-top: 18px;
  cursor: pointer;
}

.home-content {
  padding: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
}



/* =========================================================
   ADMIN DASHBOARD - BOOKS
   ========================================================= */

.dashboard-books {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.dashboard-book {
  border: 1px solid #334155;
  padding: 20px;
  border-radius: 6px;
  background: #1e293b;
}

.dashboard-book strong {
  font-size: 15px;
  color: #f8fafc;
}

.dashboard-book p {
  margin: 6px 0;
  font-size: 13px;
  color: #94a3b8;
}

.dashboard-book-status {
  font-size: 12px;
  color: #94a3b8;
}

.dashboard-book-status span {
  color: #4ade80;
  font-weight: 600;
}

/* Books section */

.dashboard-books-section {
  width: 1100px;
  max-width: calc(100% - 40px);
  margin: 0 auto;
}

.dashboard-section-title {
  margin: 0 0 18px 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #94a3b8;
}

/* =========================================================
   ADMIN DASHBOARD - USERS
   ========================================================= */

.dashboard-users {
  width: 1100px;
  max-width: calc(100% - 40px);
  margin: 48px auto 0;
}

.dashboard-users-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
  border: 1px solid #334155;
  background: #1e293b;
}

.dashboard-users-table thead tr {
  background-color: #0f172a;
  border-bottom: 2px solid #334155;
}

.dashboard-users-table th {
  padding: 12px;
  border: 1px solid #334155;
  color: #cbd5e1;
}

.dashboard-users-table tbody tr {
  border-bottom: 1px solid #334155;
}

.dashboard-users-table td {
  padding: 12px;
}

.dashboard-user-name {
  font-weight: 500;
  color: #f8fafc;
}

.dashboard-user-anonymous {
  color: #64748b;
  font-style: italic;
}

.dashboard-user-email {
  font-family: monospace;
  color: #60a5fa;
}

.dashboard-user-date {
  color: #94a3b8;
}

.dashboard-users-empty {
  text-align: center;
  padding: 40px;
  border: 2px dashed #334155;
  border-radius: 6px;
  color: #64748b;
  font-style: italic;
}

.dashboard-users-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.dashboard-users-header .dashboard-section-title {
  margin: 0;
}

.dashboard-users-count {
  font-size: 12px;
  color: #ffffff;
}

/* =========================================================
   ADMIN DASHBOARD - CONTENT HEADER
   ========================================================= */

.dashboard-content-header {
  width: 1100px;
  max-width: calc(100% - 40px);
  margin: 24px auto 36px;

  display: flex;
  justify-content: space-between;
  align-items: center;

  padding-bottom: 16px;
  border-bottom: 1px solid #334155;
}

.dashboard-content-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #f8fafc;
}

.dashboard-backend-label {
  padding: 6px 12px;
  border: 1px solid #64748b;
  border-radius: 4px;

  font-size: 12px;
  color: #94a3b8;
}

/* =========================================================
   ADMIN BOOK FORM
   ========================================================= */

.book-form-section {
  margin-bottom: 28px;
  padding: 20px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
}

.book-form-section h3 {
  margin: 0 0 20px;
  color: #f8fafc;
  font-size: 18px;
  font-weight: 600;
}

.book-form-section > div {
  margin-bottom: 16px;
}

.book-form-section > div:last-child {
  margin-bottom: 0;
}

.book-form-section label {
  display: block;
  margin-bottom: 6px;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 600;
}

.book-form-section input[type="text"],
.book-form-section input[type="number"],
.book-form-section input[type="date"],
.book-form-section select {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 4px;
  color: #f8fafc;
  font-size: 14px;
}

.book-form-section input:focus,
.book-form-section select:focus {
  outline: none;
  border-color: #60a5fa;
}

.book-form-section input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.book-form-actions {
  margin-top: 24px;
}

.book-form-actions input[type="submit"] {
  padding: 10px 18px;
  background: #2563eb;
  border: 0;
  border-radius: 4px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.book-form-actions input[type="submit"]:hover {
  background: #1d4ed8;
}

.book-errors {
  margin-bottom: 20px;
  padding: 14px 16px;
  background: #450a0a;
  border: 1px solid #991b1b;
  border-radius: 6px;
  color: #fecaca;
  font-size: 14px;
}

/* =========================================================
   ADMIN BOOKS
   ========================================================= */

.book-admin-page {
  width: 100%;
}

.book-admin-page > .book-admin-header {
  padding-top: 20px;
}

.book-admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.book-admin-page > .book-admin-header > h2 {
  margin: 0;
  color: #f8fafc;
  font-size: 28px;
  font-weight: 700;
}

.book-admin-button {
  display: inline-block;
  padding: 10px 16px;
  background: #2563eb;
  border-radius: 4px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.book-admin-button:hover {
  background: #1d4ed8;
  color: #ffffff;
}

/* =========================================================
   ADMIN BOOKS - BOOK SECTIONS
   ========================================================= */

.book-detail-section {
  margin-bottom: 24px;
  padding: 20px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
}

.book-detail-section > .book-admin-header > h3 {
  margin: 0;
  color: #f8fafc;
  font-size: 22px;
  font-weight: 700;
}

.book-detail-section > h3 {
  margin: 28px 0 18px;
  padding-top: 20px;
  border-top: 1px solid #334155;
  color: #f8fafc;
  font-size: 18px;
  font-weight: 700;
}

.book-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 24px;
}

.book-detail-grid > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.book-detail-label {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.book-detail-grid span:not(.book-detail-label) {
  color: #f8fafc;
  font-size: 14px;
}

/* =========================================================
   ADMIN BOOKS - ACTIONS
   ========================================================= */

.book-admin-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.book-admin-header-actions form {
  display: inline-block;
  margin: 0;
}

.book-admin-header-actions a,
.book-admin-header-actions button {
  display: inline-block;
  box-sizing: border-box;
  padding: 7px 14px;
  border: 1px solid #475569;
  border-radius: 4px;
  background: #334155;
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.book-admin-header-actions a:hover,
.book-admin-header-actions button:hover {
  background: #475569;
  color: #ffffff;
  text-decoration: none;
}

.book-admin-link {
  color: #ffffff;
  text-decoration: none;
}

/* =========================================================
   ADMIN BOOKS - TABLE
   ========================================================= */

.book-admin-table {
  width: 100%;
  border-collapse: collapse;
  background: #1e293b;
  border: 1px solid #334155;
  font-size: 14px;
}

.book-admin-table th {
  padding: 12px;
  background: #0f172a;
  border: 1px solid #334155;
  color: #cbd5e1;
  text-align: left;
  font-weight: 600;
}

.book-admin-table td {
  padding: 12px;
  border: 1px solid #334155;
  color: #f8fafc;
  vertical-align: middle;
}

.book-admin-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.book-admin-actions form {
  display: inline-block;
  margin: 0;
}

.book-admin-actions a,
.book-admin-actions button {
  display: inline-block;
  box-sizing: border-box;
  padding: 7px 14px;
  border: 1px solid #475569;
  border-radius: 4px;
  background: #334155;
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.book-admin-actions a:hover,
.book-admin-actions button:hover {
  background: #475569;
  color: #ffffff;
  text-decoration: none;
}

.book-admin-empty {
  padding: 30px;
  background: #1e293b;
  border: 1px dashed #334155;
  border-radius: 6px;
  color: #94a3b8;
  text-align: center;
}

/* =========================================================
   RESPONSIVE - ADMIN BOOKS
   ========================================================= */

@media (max-width: 800px) {
  .book-admin-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .book-detail-grid {
    grid-template-columns: 1fr;
  }

  .book-admin-table {
    display: block;
    overflow-x: auto;
  }
}

/* =========================================================
   COMPENDIUM
   ========================================================= */

.compendium-page {
  width: 100%;
  min-height: 100vh;
  background: #000000;
  display: flex;
  justify-content: center;
}

.compendium-main-image {
  display: block;
  width: auto;
  max-width: 100%;
  height: calc(100vh - 200px);
  object-fit: contain;
}

/* =========================================================
   COMPENDIUM GALLERY
   ========================================================= */

.compendium-gallery {
  width: 100%;
}

.compendium-slide {
  display: none;
  width: 100%;
  justify-content: center;
  align-items: flex-start;
  gap: 24px;
}

.compendium-slide.active {
  display: flex;
}

/* Individual character cards */
.compendium-character-image {
  display: block;
  width: auto;
  height: calc(100vh - 200px);
  max-width: calc(50% - 20px);
  object-fit: contain;
}

/* Gallery arrows */
.compendium-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;

  background: transparent;
  border: none;
  color: #ffffff;

  font-size: 48px;
  cursor: pointer;
  padding: 20px;
}

.compendium-arrow-left {
  left: 25px;
}

.compendium-arrow-right {
  right: 25px;
}

.book-divider {
  grid-column: 1 / -1;
  width: 100%;
  border: 0;
  border-top: 1px solid #39475a;
  margin: 0;
}
