/* Import base styles from main CSS */
@import url('../index.css');

/* Navigation Styles */
.navbar {
    background: #982037;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-weight: 600;
    font-size: 1.2rem;
}

.nav-logo img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 3px 0;
    transition: 0.3s;
}

/* Mobile Navigation Styles */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: #667eea;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0,0,0,0.05);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .hamburger {
        display: flex;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 1rem;
    }
}

/* Library-specific styles */

.library-hero {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
  min-height: 40rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
  border-bottom: 6px solid var(--brand-secondary);
}

.library-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(
    90deg,
    rgba(230, 218, 8, 0.3),
    rgba(119, 12, 32, 0.4),
    rgba(45, 108, 223, 0.2),
    rgba(205, 196, 21, 0.1)
  );
  background-size: 400% 100%;
  animation: gradientShift 8s ease-in-out infinite;
  z-index: 1;
}

.library-hero .hero-container {
  display: flex;
  align-items: center;
  max-width: 1200px;
  width: 100%;
  gap: 3rem;
  position: relative;
  z-index: 2;
}

.library-hero .hero-content {
  flex: 1;
  text-align: left;
}

.library-hero h1 {
  font-family: var(--font-primary);
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--brand-primary);
  margin-bottom: 1.5rem;
  line-height: 1.2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.library-hero h2 {
  font-family: var(--font-accent);
  font-size: 1.8rem;
  color: var(--brand-secondary);
  margin-bottom: 2rem;
  line-height: 1.6;
  opacity: 0.95;
}

.library-hero .hero-image {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.library-hero .hero-image img {
  max-width: 100%;
  height: auto;
  border: 0px solid #222;
  box-shadow: none;
}

/* Collected Works Section */
.collected-works {
  background: var(--bg-secondary);
  padding: 4rem 1rem;
}

.collected-works h2 {
  font-family: var(--font-primary);
  font-size: 2.5rem;
  color: var(--brand-secondary);
  text-align: center;
  margin-bottom: 1rem;
  font-weight: 600;
}

.section-description {
  font-family: var(--font-accent);
  color: var(--brand-secondary);
  text-align: center;
  max-width: 800px;
  margin: 0 auto 3rem auto;
  font-size: 1.1rem;
  line-height: 1.6;
}

.works-index {
  margin-bottom: 3rem;
}

.works-index h3 {
  font-family: var(--font-primary);
  font-size: 1.8rem;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 2rem;
  font-weight: 600;
}

.index-card {
  background: var(--white);
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 700px;
  margin: 0 auto;
  transition: all 0.3s ease;
  gap: 2rem;
}

.index-image {
  flex-shrink: 0;
  width: 120px;
  height: 160px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.index-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.index-card:hover .index-image img {
  transform: scale(1.05);
}

.index-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.index-info h4 {
  font-family: var(--font-primary);
  font-size: 1.4rem;
  color: var(--brand-secondary);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.index-info p {
  font-family: var(--font-accent);
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.file-size {
  font-family: var(--font-accent);
  color: var(--text-secondary);
  font-size: 0.9rem;
  background: var(--bg-secondary);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  display: inline-block;
}

.index-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.volumes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.volume-card {
  background: var(--white);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
}

.volume-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  border-color: var(--brand-secondary);
}

.volume-cover {
  margin-bottom: 1rem;
  border-radius: 8px;
  overflow: hidden;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
}

.volume-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.volume-card:hover .volume-cover img {
  transform: scale(1.05);
}

.volume-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.volume-letter {
  font-family: var(--font-primary);
  font-size: 2rem;
  color: var(--brand-secondary);
  font-weight: 700;
  background: var(--bg-secondary);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.volume-info {
  flex: 1;
  margin-left: 1rem;
}

.volume-title {
  font-family: var(--font-primary);
  font-size: 1.2rem;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.volume-size {
  font-family: var(--font-accent);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.volume-description {
  font-family: var(--font-accent);
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: 8px;
  border-left: 4px solid var(--brand-secondary);
}

.volume-actions {
  margin-top: auto;
  display: flex;
  gap: 0.5rem;
}

.read-btn {
  background: var(--brand-secondary);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-family: var(--font-accent);
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
}

.read-btn:hover {
  background: var(--border-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(142, 142, 142, 0.15);
}

.download-btn {
  background: var(--brand-secondary);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-family: var(--font-accent);
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
}

.download-btn:hover {
  background: var(--border-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* PDF Viewer Modal Styles */
.pdf-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

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

.pdf-modal-content {
  background: var(--white);
  border-radius: 16px;
  width: 95%;
  max-width: 1200px;
  height: 90%;
  max-height: 800px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.pdf-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-secondary);
  border-radius: 16px 16px 0 0;
}

.pdf-modal-header h3 {
  font-family: var(--font-primary);
  color: var(--brand-secondary);
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0;
}

.pdf-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pdf-btn {
  background: var(--white);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.pdf-btn:hover {
  background: var(--brand-secondary);
  color: var(--white);
  border-color: var(--brand-secondary);
}

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

#pageInfo {
  font-family: var(--font-accent);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  min-width: 100px;
  text-align: center;
}

.close-btn {
  background: var(--brand-secondary);
  color: var(--white);
  border: none;
  padding: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.close-btn:hover {
  background: var(--brand-primary);
  transform: scale(1.1);
}

.pdf-viewer-container {
  flex: 1;
  padding: 2rem;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  position: relative;
}

#pdfCanvas {
  max-width: 100%;
  max-height: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  z-index: 1;
}

.pdf-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--white);
  border: 3px solid var(--brand-secondary);
  color: var(--brand-secondary);
  padding: 2.2rem 2.8rem;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  z-index: 2;
  font-size: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, border 0.2s;
  margin: 0 3.5rem;
  opacity: 0.98;
}

.pdf-nav-btn.left {
  left: 0;
}

.pdf-nav-btn.right {
  right: 0;
}

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

.pdf-nav-btn:hover:not(:disabled) {
  background: var(--brand-secondary);
  color: var(--white);
  border-color: var(--brand-primary);
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

.pdf-page-info {
  text-align: center;
  font-family: var(--font-accent);
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 500;
  margin: 0.5rem 0 1rem 0;
}

/* Responsive Design */
@media (max-width: 900px) {
  .library-hero .hero-container {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }

  .library-hero h1 {
    font-size: 2.8rem;
  }

  .library-hero h2 {
    font-size: 1.5rem;
  }

  .volumes-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .index-card {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }

  .index-image {
    width: 100px;
    height: 140px;
  }

  .pdf-modal-content {
    width: 98%;
    height: 95%;
  }

  .pdf-modal-header {
    padding: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .pdf-controls {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 0.5rem;
  }

  .pdf-btn {
    width: 35px;
    height: 35px;
  }

  #pageInfo {
    min-width: 80px;
    font-size: 0.8rem;
  }
  .pdf-nav-btn.left {
    left: 0;
  }
  .pdf-nav-btn.right {
    right: 0;
  }
  .pdf-nav-btn {
    padding: 1.5rem 2rem;
    font-size: 2rem;
    margin: 0 1.2rem;
  }
  .pdf-page-info {
    font-size: 0.9rem;
  }
}

@media (max-width: 600px) {
  .library-hero h1 {
    font-size: 2.2rem;
  }

  .library-hero h2 {
    font-size: 1.3rem;
  }

  .collected-works h2 {
    font-size: 2rem;
  }

  .works-index h3 {
    font-size: 1.5rem;
  }

  .index-info h4 {
    font-size: 1.2rem;
  }

  .volume-letter {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }

  .volume-cover {
    height: 150px;
  }

  .index-image {
    width: 80px;
    height: 120px;
  }

  .volumes-grid {
    grid-template-columns: 1fr;
  }

  .pdf-modal-content {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .pdf-modal-header {
    border-radius: 0;
    padding: 0.75rem;
  }

  .pdf-viewer-container {
    padding: 1rem;
  }
  .pdf-nav-btn {
    padding: 1rem 1.3rem;
    font-size: 1.2rem;
    margin: 0 0.2rem;
  }
  .pdf-page-info {
    font-size: 0.85rem;
  }
} 

/* Responsive Design menu*/
@media (max-width: 768px) {
  .nav-menu {
      position: fixed;
      left: -100%;
      top: 7rem;
      flex-direction: column;
      background-color: #982037;
      width: 100%;
      text-align: center;
      transition: 0.3s;
      box-shadow: 0 10px 27px rgba(0,0,0,0.05);
      padding: 2rem 0;
  }

  .nav-menu.active {
      left: 0;
  }

  .hamburger {
      display: flex;
  }

  .hamburger.active .bar:nth-child(2) {
      opacity: 0;
  }

  .hamburger.active .bar:nth-child(1) {
      transform: translateY(8px) rotate(45deg);
  }

  .hamburger.active .bar:nth-child(3) {
      transform: translateY(-8px) rotate(-45deg);
  }
}