/* 
 * Main CSS Styles
 * Comic Gallery Website
 */

/* ===== Reset and Base Styles ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-bg: #1f2937;
  --secondary-bg: #111827;
  --accent-color: #d278e9;
  --text-light: #ffffff;
  --text-dim: #d1d5db;
  --text-dark: #b368df;
  --shelf-color: #8B5A2B;
  --shelf-shadow: #5D4037;
  --modal-bg: rgba(0, 0, 0, 0.75);
  --transition-normal: all 0.3s ease;
  --transition-slow: all 0.5s ease;
}

body {
  font-family: 'Open Sans', sans-serif;
  background: linear-gradient(to bottom, var(--primary-bg), var(--secondary-bg));
  color: var(--text-light);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Comic-style dotted background */
.app-container {
  min-height: 100vh;
  position: relative;
}

.app-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(#fff 1px, transparent 1px),
    radial-gradient(#fff 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
  opacity: 0.2;
  pointer-events: none;
  z-index: -1;
}

/* ===== Header Styles ===== */
.main-header {
  background-color: var(--secondary-bg);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.site-title {
  font-family: 'Bangers', cursive;
  font-size: 2rem;
  margin-right: 2rem;
  letter-spacing: 1px;
}

.category-nav {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.5rem 0;
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

.category-nav::-webkit-scrollbar {
  display: none;  /* Chrome, Safari and Opera */
}

.category-btn {
  background: transparent;
  color: var(--text-dim);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  white-space: nowrap;
  transition: var(--transition-normal);
}

.category-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
}

.category-btn.active {
  background-color: rgba(255, 255, 255, 0.2);
  color: var(--text-light);
}

.icon {
  display: inline-block;
  width: 1.2rem;
  height: 1.2rem;
  margin-right: 0.5rem;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

/* We'll replace these with SVG icons later */
.portfolio-icon { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>'); }
.blog-icon { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20"/></svg>'); }
.stories-icon { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"/><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"/></svg>'); }
.challenge-icon { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 9H4.5a2.5 2.5 0 0 1 0-5H6"/><path d="M18 9h1.5a2.5 2.5 0 0 0 0-5H18"/><path d="M4 22h16"/><path d="M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22"/><path d="M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22"/><path d="M18 2H6v7a6 6 0 0 0 12 0V2Z"/></svg>'); }
.projects-icon { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 19l7-7 3 3-7 7-3-3z"/><path d="M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z"/><path d="m2 2 7.586 7.586"/><circle cx="11" cy="11" r="2"/></svg>'); }

/* ===== Category Title ===== */
.category-title {
  text-align: center;
  padding-top: 8rem;
  margin-bottom: 1rem;
}

.category-title h2 {
  font-family: 'Bangers', cursive;
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  letter-spacing: 1px;
}

.category-title p {
  color: var(--text-dim);
}

/* ===== Modal Styles ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: none;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--modal-bg);
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 900px;
  height: 80vh;
  background-color: white;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  z-index: 1001;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #e5e7eb;
  background-color: #f9fafb;
}

.modal-header h2 {
  color: var(--text-dark);
  font-size: 1.5rem;
}

.close-button {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #6b7280;
  padding: 0.5rem;
  border-radius: 0.25rem;
}

.close-button:hover {
  background-color: #f3f4f6;
  color: #111827;
}

.content-viewer {
  height: calc(80vh - 4rem);
  overflow-y: auto;
  padding: 2rem;
  background-color: #f9fafb;
  color: var(--text-dark);
}

/* ===== Responsive Styles ===== */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .site-title {
    margin-bottom: 1rem;
  }
  
  .category-title h2 {
    font-size: 2rem;
  }
  
  .bookshelf-container {
    padding: 0 1rem;
  }
  
  .modal-content {
    width: 95%;
    height: 90vh;
  }
  
  .content-viewer {
    height: calc(90vh - 4rem);
    padding: 1rem;
  }
}


:root {
  --heading-font: 'Monoton';
  --body-font: 'Open Sans', sans-serif;
}

body {
  font-family: var(--body-font);
}

.category-title h2{
  font-family: var(--heading-font);
}

.site-title {
  font-family: var(--heading-font);
}

/* Add after the .site-title style */
.site-branding {
  display: flex;
  align-items: center;
  margin-right: 2rem;
}

.site-logo {
  height: 4rem; /* Adjust based on your logo size */
  width: auto;
  margin-right: 0.75rem;
}

/* You might need to adjust the existing .site-title style */
.site-title {
  font-size: 2rem;
  letter-spacing: 1px;
  margin: 0; /* Remove any margin that might have been there */
}

@media (max-width: 768px) {
  .site-branding {
    margin-bottom: 1rem;
  }
  
  .site-logo {
    height: 2rem; /* Slightly smaller on mobile */
  }
}



/* Viewer container styles */
.content-viewer-container {
  position: relative;
  height: calc(80vh - 8rem);
  background-color: #f9fafb;
  overflow: hidden;
}

/* Individual viewers */
.content-viewer {
  width: 100%;
  height: 100%;
  display: none;
}

.content-viewer.active {
  display: block;
}

/* EPUB specific styles */
.epub-viewer {
  background-color: #f5f5f5;
}

.epub-viewer iframe {
  border: none;
  width: 100%;
  height: 100%;
}

/* PDF specific styles */
.pdf-viewer canvas {
  display: block;
  margin: 0 auto;
}

/* Loading indicator */
.content-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.9);
  z-index: 10;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-left-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}


#contentModal.active {
  display: flex !important;
  opacity: 1 !important;
}

.modal-content {
  display: block !important;
  visibility: visible !important;
}

#htmlViewer {
  display: block !important;
  visibility: visible !important;
  background-color: white !important;
  color: black !important;
  min-height: 300px;
}


/* Book Layout Styles */
.book-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background-color: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.book-nav-btn {
  background-color: #e5e7eb;
  border: none;
  color: #4b5563;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.book-nav-btn:hover:not(:disabled) {
  background-color: #d1d5db;
  color: #1f2937;
}

.book-nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.book-content-wrapper {
  flex: 1;
  overflow: auto;
  padding: 1rem;
  background-color: #f5f5f5;
}

.book-spread {
  display: flex;
  min-height: 100%;
  background-color: #f5f5f5;
  border-radius: 4px;
  overflow: hidden;
}

.book-page {
  flex: 1;
  padding: 1.5rem;
  background-color: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.book-page-left {
  border-radius: 4px 0 0 4px;
  margin-right: 2px;
}

.book-page-right {
  border-radius: 0 0 4px 4px;
  margin-left: 2px;
}

.book-page-divider {
  width: 4px;
  background: linear-gradient(to right, rgba(0,0,0,0.1), rgba(0,0,0,0.2), rgba(0,0,0,0.1));
  position: relative;
  box-shadow: inset -1px 0 3px rgba(0,0,0,0.1), inset 1px 0 3px rgba(0,0,0,0.1);
}

/* Content styling */
.book-page h1 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: #1f2937;
}

.book-page h2 {
  font-size: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: #1f2937;
}

.book-page h3 {
  font-size: 1.25rem;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  color: #1f2937;
}

.book-page p {
  margin-bottom: 1rem;
  line-height: 1.6;
  color: #4b5563;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .book-spread {
    flex-direction: column;
  }
  
  .book-page-left {
    border-radius: 4px 4px 0 0;
    margin-right: 0;
    margin-bottom: 2px;
  }
  
  .book-page-right {
    border-radius: 0 0 4px 4px;
    margin-left: 0;
    margin-top: 2px;
  }
  
  .book-page-divider {
    width: 100%;
    height: 4px;
  }
  
  .book-controls {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}


.category-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.category-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: transparent;
  border: 1px solid var(--border-color, #e5e7eb);
  color: var(--text-color, #ececec);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.category-btn svg {
  width: 20px;
  height: 20px;
}

.category-btn:hover {
  background-color: var(--border-color, #e5e7eb);
}

.category-btn.active {
  background-color: var(--heading-color, #1f2937);
  color: var(--bg-color, #ffffff);
  border-color: var(--heading-color, #1f2937);
}

.category-btn.active svg {
  stroke: var(--bg-color, #ffffff);
}

@media (max-width: 640px) {
  .category-nav {
    gap: 0.5rem;
  }
  
  .category-btn {
    padding: 0.4rem 0.75rem;
  }
  
  .category-btn svg {
    width: 16px;
    height: 16px;
  }
  
  .category-btn span {
    display: none;
  }
}