:root {
  --primary-color: #006064;
  --secondary-color: #b18e3a;
  --light-color: #e9f2fb;
  --dark-color: #333;
  --white: #fff;
  --gray: #f5f5f5;
  --overlay-color: rgba(0, 0, 0, 0.7);

  /* Transitions */
    --transition-fast: 0.2s;
    --transition-medium: 0.4s;
    
    /* Typography */
    --font-small: 0.8rem;
    --font-medium: 1rem;
    --font-large: 1.25rem;
    --font-x-large: 1.5rem;
    --font-xx-large: 2rem;
    --font-xxx-large: 3rem;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

/* Base Styles */
body {
  font-family: 'Quicksand', sans-serif;
  color: var(--dark-color);
  line-height: 1.6;
  background-color: var(--light-color);
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-fast);
}

/* Header & Navigation */

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 60%;
  margin: 0 auto;
  height: 90px;
}

/* Header */
  header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--primary-color);
    z-index: 1000;
    transition: all var(--transition-medium);
  }
 
/* Navigation Links */
.nav-links {
  display: flex;
  transition: all var(--transition-medium);
  gap: var(--space-lg);
  align-items: center;
}

.nav-links a {
  color: var(--white);
  font-weight: 500;
  position: relative;
  padding: 0.5rem 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--secondary-color);
  transition: width var(--transition-fast);
}

.nav-links a:hover::after {
  width: 100%;
}

/* Mobile Menu */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--overlay-color);
  z-index: 98;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-medium);
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

.nav-link {
    color: var(--white);
    text-decoration: none;
    font-size: var(--font-medium);
    transition: all var(--transition-fast);
    position: relative;
    padding: var(--space-sm) 0;
    font-weight: 500;
  }

  .nav-link:hover {
    color: var(--secondary-color);
  }

  .nav-link.active {
    color: var(--secondary-color);
    font-weight: 600;
  }

  .nav-link::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: var(--transition-fast);
  }

  .nav-link:hover::after,
  .nav-link.active::after {
    width: 100%;
  }

  .dropdown {
    position: relative;
  }

  .dropdown-content {
    display: none;
    position: absolute;
    top: 100%;   /* directly below the nav-link */
    left: 0;
    margin-top: 0; /* remove spacing to avoid gap */
    background-color: var(--white);
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    border-radius: 4px;
    animation: fadeIn var(--transition-fast);
    z-index: 999; /* keep it above */
  }

  .dropdown:hover .dropdown-content {
    display: block;
  }

    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(-10px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .dropdown-content a {
      color: var(--dark-color);
      padding: var(--space-md);
      text-decoration: none;
      display: block;
      transition: all var(--transition-fast);
    }

    .dropdown-content a:hover {
      background-color: var(--gray);
      color: var(--primary-color);
      padding-left: var(--space-lg);
    }

    .dropdown:hover .dropdown-content {
      display: block;
    }

    
/* Main Content */
main {
  margin-top: 80px;
  padding: 2rem;
  max-width: 60%;
  margin-left: auto;
  margin-right: auto;
}

.page-header {
  text-align: center;
  margin-bottom: 2rem;
}

.page-header h1 {
  color: var(--primary-color);
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--secondary-color);
  font-style: italic;
}

/* Book Suggestions */
.suggestions-section {
  background-color: white;
  border-radius: 10px;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.suggestions-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.suggestions-slider {
  position: relative;
  margin-bottom: 1rem;
}

.slider-container {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 1rem;
  padding-bottom: 1rem;
}

.slider-container::-webkit-scrollbar {
  display: none;
}

.book-card {
  flex: 0 0 auto;
  width: 150px;
  background-color: var(--light-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform var(--transition-fast);
}

.book-card:hover {
  transform: translateY(-5px);
}

.book-cover {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.book-info {
  padding: 0.75rem;
}

.book-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-author {
  font-size: 0.8rem;
  color: #666;
}

.slider-controls {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.slider-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #ccc;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.slider-dot.active {
  background-color: var(--primary-color);
}

/* Library Access */
.library-access {
  background-color: white;
  border-radius: 10px;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.access-form {
  max-width: 400px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

.btn {
  display: inline-block;
  background-color: var(--primary-color);
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.btn:hover {
  background-color: #006d68;
}

.btn i {
  margin-left: 0.5rem;
}

.error-message {
  color: #dc3545;
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

/* Quotes Section */
.quotes-section {
  margin: 3rem 0;
  text-align: center;
}

.quote {
  font-style: italic;
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.quote-author {
  color: var(--secondary-color);
  font-weight: 600;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--overlay-color);
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background-color: white;
  border-radius: 8px;
  width: 100%;
  padding: 1rem;
  max-width: 400px;
  overflow: hidden;
  animation: modalFadeIn 0.3s ease-out;
}

/* Add this to your library.css file */
#bookModal .modal-content {
  position: relative; /* Add this to establish positioning context */
  padding: 2rem; /* Add some padding */
}

#closeResumeModal {
  position: absolute;
  top: 15px;
  right: 15px;
  color: var(--dark-color);
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color var(--transition-fast);
  background: none;
  border: none;
  padding: 5px;
  z-index: 1;
}

#closeResumeModal:hover {
  color: var(--primary-color);
  transform: scale(1.1);
}

/* Update the book modal styles */
#bookModal .modal-content {
  display: flex;
  flex-direction: column;
  max-width: 25%;
}

.resume-book-cover {
  max-width: 200px;
  margin: 0 auto 1rem;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.resume-book-details {
  text-align: center;
}

#bookModalTitle {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

#bookModalAuthor {
  color: var(--secondary-color);
  font-style: italic;
  margin-bottom: 1rem;
}

#bookModalSummary {
  line-height: 1.6;
  text-align: center;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 6px;  
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  padding: 1rem;
  background-color: var(--primary-color);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem;
  background-color: #f8f9fa;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.secondary-btn {
  background-color: #6c757d;
}

.secondary-btn:hover {
  background-color: #5a6268;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
}

.modal-content {
  background-color: #fefefe;
  margin: 10% auto;
  padding: 20px;
  border-radius: 10px;
  width: 90%;
  max-width: 500px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.close-modal {
  font-size: 24px;
  cursor: pointer;
}

.pin-input-container {
  display: flex;
  gap: 10px;
  margin: 20px 0;
}

#pinInput {
  flex: 1;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 16px;
}

.submit-pin-btn {
  padding: 12px 20px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.submit-pin-btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.pin-message {
  margin: 10px 0;
  padding: 10px;
  border-radius: 5px;
}

.pin-message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.pin-message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.payment-info {
  background-color: #f8f9fa;
  padding: 15px;
  border-radius: 5px;
  margin-top: 20px;
}

.payment-info ol {
  margin: 10px 0;
  padding-left: 20px;
}

/* Footer */
footer {
  background-color: var(--primary-color);
  color: white;
  text-align: center;
  padding: 1.5rem;
  width: 100%;
}

.footer-content {
  max-width: 60%;
  margin: 0 auto;
}

/* Responsive Design */
@media (max-width: 768px) {

  .mobile-menu-btn {
    display: block;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 5rem;
    left: 0;
    width: auto;
    align-items: stretch; /* or flex-start, or initial, depending on what you want */
    background: var(--primary-color);
  }

  .nav-links.show {
    display: flex !important;
  }

  .nav-links a {
    margin: 0.5rem;
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

  main {
    max-width: 90%;
    padding: 1rem;
    margin-top: 70px;
  }

  .header-container {
    max-width: 90%;
  }

  #bookModal .modal-content {
    max-width: 60%;
  }

  .page-header h1 {
    font-size: 2rem;
  }

  .book-card {
    width: 120px;
  }

  .book-cover {
    height: 160px;
  }
  .footer-content {
  max-width: 90%;
  margin: 0 auto;
}

}

 @media (max-width: 600px) {
      .nav-container {
        flex-direction: column;
        gap: var(--space-sm);
      }

      .nav-links {
        width: 100%;
        justify-content: space-around;
        padding: var(--space-sm) 0;
        flex-wrap: wrap;
      }

      .dropdown-content {
        right: auto;
        left: 0;
      }
    }

@media (max-width: 576px) {
  .book-card {
    width: 100px;
  }

  .book-cover {
    height: 140px;
  }
}

/* Smooth transition of height + top */
header, .nav-links {
  transition: all 0.3s ease;
}