@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Noto+Sans+JP:wght@300;400;500;700&family=Noto+Serif+JP:wght@400;500;600;700&display=swap');

:root {
  color-scheme: dark;
  --color-primary: #18181B;
  --color-secondary: #27272A;
  --color-cta: #FACC15; /* Yellow */
  --color-background: #09090B;
  --color-text: #F4F4F5;
  
  --bg: #1A1A1A; /* Greyish dark */
  --bg-soft: #242424; /* Greyish dark soft */
  --panel: #2C2C2C;
  --panel-strong: #3A3A3A;
  --ink: #FFFFFF; /* White for bolder look */
  --muted: #A1A1AA;
  --accent: #FACC15; /* Yellow */
  --accent-2: #FDE047; /* Lighter yellow */
  --line: #3A3A3A;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.25);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.35);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.4);
  
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  font-family: 'Bebas Neue', sans-serif;
  font-weight: 500; /* Bolder text */
  --font-serif: 'Bebas Neue', sans-serif;
  letter-spacing: 0.08em; /* Global spacing for readability */
}

* { 
  box-sizing: border-box; 
  outline: none;
}

/* Accessibility skip link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-cta);
  color: #000000;
  padding: 8px;
  z-index: 100;
  transition: top 0.2s;
  font-weight: bold;
}
.skip-link:focus {
  top: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.8; /* Increased line-height for better readability */
}

button, input, textarea, select { font: inherit; }
button { 
  cursor: pointer; 
  border: none;
  background: none;
}
a { color: inherit; text-decoration: none; }

.cursor-pointer {
  cursor: pointer !important;
}

/* Header styling */
.header-container {
  position: sticky;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  z-index: 50;
  margin: 0 auto;
  max-width: 1440px;
  padding: 0 1rem;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 9999px;
  background: rgba(36, 36, 36, 0.75); /* Updated to match greyish theme */
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-md);
  margin-top: 0.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  font-family: 'Bebas Neue', sans-serif;
  font-weight: 400; /* Bebas Neue is bold by default */
  font-size: 1.65rem;
  letter-spacing: 0.05em; /* Add some spacing for readability */
  padding: 0.25rem;
  border-radius: 0.5rem;
  transition: opacity 200ms ease;
}
.brand:hover {
  opacity: 0.9;
}
.brand:focus-visible {
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.4); /* Yellow focus */
}
.brand-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--color-cta);
}

.site-nav { 
  display: flex; 
  align-items: center; 
  gap: 0.75rem; 
}
.nav-link { 
  color: var(--muted); 
  font-size: 0.95rem; 
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem;
  border-radius: 9999px;
  font-weight: 500;
  transition: color 200ms ease, background-color 200ms ease;
}
.nav-link i {
  width: 1rem;
  height: 1rem;
}
.nav-link:hover { 
  color: var(--ink); 
  background-color: rgba(255, 255, 255, 0.05);
}
.nav-link:focus-visible {
  box-shadow: 0 0 0 2px var(--line);
}

/* Hero Section */
.hero {
  display: grid;
  min-height: 50vh;
  place-items: center;
  padding: var(--space-3xl) var(--space-md);
  text-align: center;
}

.hero-card {
  width: min(840px, 100%);
  padding: var(--space-2xl) var(--space-xl);
  border: 1px solid var(--line);
  border-radius: 2rem;
  background: linear-gradient(180deg, rgba(44, 44, 44, 0.6) 0%, rgba(26, 26, 26, 0.6) 100%); /* Adjusted gradient */
  box-shadow: var(--shadow-xl);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.hero h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(3.5rem, 10vw, 7.5rem); /* Increased size */
  line-height: 1.1;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.hero-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  color: var(--color-cta);
  transition: opacity 200ms ease, transform 200ms ease;
  font-weight: bold;
}

.hero-link i {
  width: 1.25rem;
  height: 1.25rem;
}

.hero-link:hover {
  opacity: 0.8;
  transform: translateY(-2px);
}

.hero p {
  margin: var(--space-md) 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 300;
}

/* Sections */
.section { 
  padding: var(--space-xl) clamp(1rem, 5vw, 4rem) var(--space-2xl); 
  max-width: 1440px;
  margin: 0 auto;
}

.section-header { 
  display: flex; 
  justify-content: space-between; 
  align-items: flex-end; 
  gap: 1rem; 
  margin-bottom: 2rem; 
  border-bottom: 1px solid var(--line);
  padding-bottom: 1rem;
}
.section h2, .detail h1, .admin-panel h1 { 
  margin: 0; 
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 2.75rem); 
  letter-spacing: -0.03em; 
}
.section-header p, .detail p { 
  color: var(--muted); 
  margin: 0.25rem 0 0 0;
  font-size: 0.95rem;
}

/* Bento-like Grid Showcase */
.grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
  gap: 1.5rem; 
}

.card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: var(--bg-soft);
  box-shadow: var(--shadow-sm);
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
  position: relative;
  display: flex;
  flex-direction: column;
}
.card:hover { 
  transform: translateY(-4px); 
  border-color: var(--muted); 
  box-shadow: var(--shadow-lg);
}
.card button { 
  width: 100%; 
  border: 0; 
  background: transparent; 
  color: inherit; 
  text-align: left; 
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.card button:focus-visible {
  box-shadow: inset 0 0 0 3px var(--color-cta);
}
.cover { 
  aspect-ratio: 3 / 4; 
  width: 100%; 
  object-fit: cover; 
  background: var(--panel); 
  display: block; 
  transition: transform 300ms ease;
}
.card:hover .cover {
  transform: scale(1.02);
}
.art-cover { 
  aspect-ratio: 4 / 3; 
}
.card-body { 
  padding: 1.25rem; 
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-grow: 1;
}
.card h3 { 
  margin: 0; 
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  font-family: var(--font-serif);
}
.meta { 
  color: var(--muted); 
  font-size: 0.85rem; 
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: auto;
}
.meta i {
  width: 0.9rem;
  height: 0.9rem;
}

.empty-state {
  padding: var(--space-2xl);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 1.25rem;
  color: var(--muted);
  background: rgba(36, 36, 36, 0.4); /* Adjusted background */
}

/* Detail View Layout */
.detail {
  padding: var(--space-xl) clamp(1rem, 5vw, 4rem) var(--space-3xl);
  max-width: 1440px;
  margin: 0 auto;
}

.detail-grid { 
  display: grid; 
  grid-template-columns: minmax(280px, 420px) 1fr; 
  gap: 3rem; 
  align-items: start; 
}

.media-container {
  position: relative;
  border-radius: 1.25rem;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  background: var(--panel);
}

.detail-media {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 250ms ease, filter 200ms ease;
  cursor: zoom-in;
}

.detail-media:hover {
  filter: brightness(1.05);
}

.detail-media.zoomed { 
  cursor: zoom-out;
  transform: scale(1.05);
}

.detail-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.detail-description {
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1.7;
}

.detail h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin: 1.5rem 0 0.75rem 0;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.5rem;
}

.chapter-list { 
  display: grid; 
  gap: 0.75rem; 
  margin-top: 1rem; 
}
.chapter-row { 
  display: flex; 
  justify-content: space-between; 
  align-items: center;
  gap: 1rem; 
  padding: 1rem 1.25rem; 
  border: 1px solid var(--line); 
  border-radius: 0.75rem; 
  background: var(--bg-soft); 
  transition: border-color 200ms ease, background-color 200ms ease;
}
.chapter-row:hover {
  border-color: var(--muted);
  background-color: rgba(255, 255, 255, 0.02);
}
.chapter-row span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}
.chapter-row span i {
  color: var(--muted);
}
.chapter-link {
  color: var(--color-cta);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--color-cta);
  border-radius: 9999px;
  background: transparent;
  transition: background-color 200ms ease, color 200ms ease;
}
.chapter-link:hover {
  background: var(--color-cta);
  color: #000000; /* Dark text on yellow background */
}

/* UI Elements */
.admin-actions, .dialog-actions, .form-row { 
  display: flex; 
  gap: 0.75rem; 
  flex-wrap: wrap; 
  align-items: center; 
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.primary-button, .ghost-button, .danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 9999px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 200ms ease;
  white-space: nowrap;
}

.primary-button { 
  background: var(--color-cta); 
  color: #000000; /* Dark text on yellow button */
}
.primary-button:hover { 
  opacity: 0.9;
  transform: translateY(-1px);
}
.primary-button:focus-visible {
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.4); /* Yellow focus */
}

.ghost-button { 
  background: transparent; 
  border: 1px solid var(--line); 
  color: var(--ink); 
}
.ghost-button:hover { 
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--muted);
}
.ghost-button:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.danger-button { 
  background: rgba(239, 68, 68, 0.1); 
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #FCA5A5; 
}
.danger-button:hover { 
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
}
.danger-button:focus-visible {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3);
}

.btn-icon {
  width: 1.1rem;
  height: 1.1rem;
}

/* Admin Dashboard layout */
.admin-panel { 
  padding: var(--space-xl) clamp(1rem, 5vw, 4rem) var(--space-3xl); 
  max-width: 1440px;
  margin: 0 auto;
}

.admin-tabs { 
  display: flex; 
  gap: 0.75rem; 
  flex-wrap: wrap; 
  margin: 1.5rem 0; 
}
.admin-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem; 
  align-items: start; 
  margin-top: 1.5rem;
}

.panel-card { 
  padding: 1.75rem; 
  border: 1px solid var(--line); 
  border-radius: 1.25rem; 
  background: var(--bg-soft); 
  box-shadow: var(--shadow-sm);
}
.panel-card h2 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  margin: 0 0 1.25rem 0;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.panel-card h2 i {
  color: var(--muted);
}

.stack { 
  display: flex; 
  flex-direction: column;
  gap: 1.25rem; 
}

label { 
  display: flex; 
  flex-direction: column;
  gap: 0.5rem; 
  color: var(--ink); 
  font-weight: 500;
  font-size: 0.95rem;
}
.label-text {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  color: var(--ink);
  transition: border-color 200ms ease, box-shadow 200ms ease;
  font-size: 0.95rem;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--color-cta);
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.15); /* Yellow focus */
}

/* File inputs styling */
input[type="file"] {
  background: transparent;
  border: 1px dashed var(--line);
  cursor: pointer;
  padding: 1.5rem 1rem;
  text-align: center;
  border-radius: 0.75rem;
}
input[type="file"]:hover {
  border-color: var(--muted);
  background-color: rgba(255, 255, 255, 0.01);
}

textarea { min-height: 120px; resize: vertical; }

.form-error { 
  min-height: 1.2rem; 
  color: #FCA5A5; 
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}

/* Custom list layout in admin panel */
.admin-list-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.admin-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
}
.admin-list-item span {
  font-weight: 500;
  font-size: 0.95rem;
}
.admin-list-actions {
  display: flex;
  gap: 0.5rem;
}
.admin-list-actions button {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  border-radius: 0.5rem;
}

/* Login/Overlay Dialog */
.dialog-card { 
  max-width: 440px; 
  width: 90%;
  border: 1px solid var(--line); 
  border-radius: 1.5rem; 
  background: var(--bg-soft); 
  color: var(--ink); 
  box-shadow: var(--shadow-xl); 
  padding: 2rem;
}
.dialog-card::backdrop { 
  background: rgba(26, 26, 26, 0.85); /* Adjusted backdrop */
  backdrop-filter: blur(8px); 
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dialog-header h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.5rem;
}
.close-dialog-btn {
  color: var(--muted);
  transition: color 200ms ease;
  padding: 0.25rem;
  border-radius: 0.25rem;
}
.close-dialog-btn:hover {
  color: var(--ink);
}
.dialog-description {
  color: var(--muted);
  margin: 0.5rem 0 0 0;
  font-size: 0.95rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrapper input {
  padding-left: 2.5rem;
}
.input-icon {
  position: absolute;
  left: 0.9rem;
  width: 1.1rem;
  height: 1.1rem;
  color: var(--muted);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 300ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Zoom overlay */
.media-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
  cursor: zoom-out;
}
.media-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.media-overlay img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 0.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Covers Gallery for Comic Details */
.covers-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  justify-content: center;
}
.cover-thumb-btn {
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: none;
  transition: border-color 200ms ease, transform 200ms ease;
  width: 60px;
  height: 80px;
}
.cover-thumb-btn:hover {
  border-color: var(--accent-2);
  transform: translateY(-2px);
}
.cover-thumb-btn.active {
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.4);
}
.cover-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Card Pinning Badge */
.card {
  position: relative;
}
.pin-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--accent);
  color: #000000;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 10;
  box-shadow: var(--shadow-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pin-badge i {
  width: 12px;
  height: 12px;
  transform: rotate(45deg);
}

@media (max-width: 768px) {
  .site-header { 
    border-radius: 1.5rem;
    padding: 0.75rem 1rem;
  }
  .site-nav {
    gap: 0.5rem;
  }
  .nav-link {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
  }
  .nav-link span {
    display: none;
  }
  .nav-link i {
    width: 1.1rem;
    height: 1.1rem;
  }
  .detail-grid { 
    grid-template-columns: 1fr; 
    gap: 2rem;
  }
  .form-row {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

/* Floating Donate Button */
.floating-donate-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-cta); /* Yellow */
  color: #000000; /* Dark text */
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-weight: bold;
  font-size: 1rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: transform 200ms ease, opacity 200ms ease, box-shadow 200ms ease;
}

.floating-donate-btn i {
  width: 1.1rem;
  height: 1.1rem;
}

.floating-donate-btn:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  opacity: 0.95;
}

.floating-donate-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.4);
}
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
