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

body {
  font-family: 'DM Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Main Container */
.pdf-library {
  min-height: 100vh;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  padding: 4rem 2rem;
  position: relative;
  overflow: hidden;
}

.pdf-library::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 80%, rgba(220, 38, 38, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(220, 38, 38, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

/* Header */
.header-container {
  text-align: center;
  margin-bottom: 4rem;
  z-index: 1;
  position: relative;
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.logo-icon {
  width: 80px;
  height: 80px;
}

.logo-text {
  font-family: 'DM Sans', sans-serif;
  font-size: 4rem;
  font-weight: 500;
  background: black;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 0;
}

.subtitle {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.5rem;
  color: #6b7280;
  font-weight: 300;
}

/* PDF Grid */
.pdf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  z-index: 1;
  position: relative;
}

/* PDF Card */
.pdf-card {
  background: white;
  border: 2px solid #b91c1c;
  border-radius: 30px;
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.pdf-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.pdf-card:hover::before {
  left: 100%;
}

.pdf-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(69, 10, 10, 0.6);
}

/* PDF Icon */
.pdf-icon {
  width: 80px;
  height: 80px;
  color: #b91c1c;
  margin-bottom: 1.5rem;
}

.pdf-icon svg {
  width: 100%;
  height: 100%;
}

/* PDF Title */
.pdf-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.5rem;
  font-weight: 500;
  color: #000000;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

/* PDF Description */
.pdf-description {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  color: #6b7280;
  margin-bottom: 2rem;
  line-height: 1.5;
}

/* Download Button */
.download-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: transparent;
  color: #b91c1c;
  border: 2px solid #b91c1c;
  border-radius: 30px;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
}

.download-button:hover {
  background: #b91c1c;
  color: white;
  transform: scale(1.05);
}

.download-button.downloading {
  background: #f59e0b;
  color: white;
  border-color: #f59e0b;
  cursor: wait;
}

.download-button.download-success {
  background: #10b981;
  color: white;
  border-color: #10b981;
  cursor: default;
}

.download-icon {
  width: 20px;
  height: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .pdf-library {
    padding: 2rem 1rem;
  }

  .logo-icon {
    width: 60px;
    height: 60px;
  }

  .logo-text {
    font-size: 2.5rem;
  }
  
  .subtitle {
    font-size: 1.125rem;
  }

  .pdf-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .pdf-card {
    padding: 2rem;
  }

  .pdf-icon {
    width: 60px;
    height: 60px;
  }

  .pdf-title {
    font-size: 1.25rem;
  }

  .pdf-description {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .logo-icon {
    width: 40px;
    height: 40px;
  }

  .logo-text {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .header-container {
    margin-bottom: 2rem;
  }
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8);
  animation: fadeIn 0.3s ease;
}

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

.modal-content {
  background-color: white;
  width: 90%;
  height: 90%;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 2px solid #b91c1c;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 20px 20px 0 0;
}

.modal-header h2 {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.5rem;
  font-weight: 500;
  color: #000000;
  margin: 0;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.open-tab-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  color: #b91c1c;
  border: 2px solid #b91c1c;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.open-tab-button:hover {
  background: #b91c1c;
  color: white;
  transform: scale(1.1);
}

.open-tab-button .tab-icon {
  width: 20px;
  height: 20px;
}

.download-button-modal {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: #b91c1c;
  color: white;
  border: 2px solid #b91c1c;
  border-radius: 30px;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.download-button-modal:hover {
  background: #450a0a;
  border-color: #450a0a;
  transform: scale(1.05);
}

.download-button-modal.downloading {
  background: #f59e0b;
  border-color: #f59e0b;
  cursor: wait;
}

.download-button-modal.download-success {
  background: #10b981;
  border-color: #10b981;
  cursor: default;
}

.download-button-modal .download-icon {
  width: 18px;
  height: 18px;
}

.close-button {
  background: transparent;
  border: 2px solid #b91c1c;
  color: #b91c1c;
  font-size: 2rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  padding: 0;
  line-height: 1;
}

.close-button:hover {
  background: #b91c1c;
  color: white;
  transform: rotate(90deg);
}

.preview-iframe {
  flex: 1;
  border: none;
  width: 100%;
  background: white;
  border-radius: 0 0 20px 20px;
}

/* PDF Card Cursor */
.pdf-card {
  cursor: pointer;
}

.pdf-card .download-button {
  cursor: pointer;
  pointer-events: auto;
}

/* Animation classes */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-in-left {
  opacity: 0;
  transform: translateX(-50px);
  animation: slideInLeft 0.6s ease forwards;
}

@keyframes slideInLeft {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-right {
  opacity: 0;
  transform: translateX(50px);
  animation: slideInRight 0.6s ease forwards;
}

@keyframes slideInRight {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Responsive Modal */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    height: 95%;
    border-radius: 10px;
  }

  .modal-header {
    padding: 1rem 1.5rem;
    border-radius: 10px 10px 0 0;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .modal-header h2 {
    font-size: 1.2rem;
    flex: 1 1 100%;
  }

  .modal-actions {
    gap: 0.5rem;
    flex: 1 1 auto;
  }

  .open-tab-button {
    width: 35px;
    height: 35px;
  }

  .open-tab-button .tab-icon {
    width: 18px;
    height: 18px;
  }

  .download-button-modal {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  .download-button-modal .download-icon {
    width: 16px;
    height: 16px;
  }

  .close-button {
    width: 35px;
    height: 35px;
    font-size: 1.5rem;
  }

  .preview-iframe {
    border-radius: 0 0 10px 10px;
  }
}

