/* Reset & base */
* {
  box-sizing: border-box;
}
body {
  margin: 0; 
  font-family: 'Poppins', sans-serif;
  background: #0f172a; /* dark background like portfolio */
  color: #f8fafc;
  scroll-behavior: smooth;
}
a {
  text-decoration: none; 
  color: inherit;
}

/* Header */
header {
  position: sticky;
  top: 0; left: 0; right: 0;
  background: #1e293b; /* matching dark navbar */
  color: #f8fafc;
  padding: 1.25rem 3rem;
  font-weight: 600;
  font-size: 1.6rem;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 15px rgb(0 0 0 / 0.3);
  user-select: none;
}
header {
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #040264f1;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  margin: 0;
}

/* Hamburger menu */
.hamburger {
  display: none;
  cursor: pointer;
  flex-direction: column;
  gap: 6px;
}
.hamburger div {
  width: 28px; 
  height: 3.5px;
  background: #f8fafc;
  border-radius: 3px;
  transition: background 0.3s;
}

/* Container */
.container {
  max-width: 1150px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}

/* Search + filters */
.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  gap: 1rem;
}
.search-box {
  flex-grow: 1;
  min-width: 280px;
}
.search-box input {
  width: 100%;
  padding: 0.75rem 1.2rem;
  font-size: 1.1rem;
  border-radius: 30px;
  border: 2px solid #64748b;
  background: #1e293b;
  color: #f8fafc;
  transition: border-color 0.3s, background-color 0.3s;
  font-weight: 500;
}
.search-box input::placeholder {
  color: #94a3b8;
}
.search-box input:focus {
  outline: none;
  border-color: #38bdf8;
  background: #0f172a;
  box-shadow: 0 0 8px #38bdf8aa;
}

.categories {
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  -webkit-overflow-scrolling: touch;
}
.category-btn {
  padding: 0.65rem 1.8rem;
  background: transparent;
  border: 2px solid #64748b;
  color: #94a3b8;
  border-radius: 9999px;
  cursor: pointer;
  font-weight: 600;
  user-select: none;
  transition: all 0.3s ease;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 1rem;
  letter-spacing: 0.7px;
  box-shadow: 0 0 0 transparent;
}
.category-btn.active,
.category-btn:hover {
  background: #38bdf8;
  color: #0f172a;
  border-color: #38bdf8;
  box-shadow: 0 6px 15px #38bdf8aa;
  transform: translateY(-3px);
}

/* PDF grid */
.pdf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

/* PDF card */
.pdf-card {
  background: #1e293b;
  border-radius: 20px;
  box-shadow: 0 8px 30px rgb(56 223 248 / 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.4s cubic-bezier(0.4,0,0.2,1), box-shadow 0.4s ease;
  opacity: 0;
  transform: translateY(40px);
  animation: fadeInUp 0.6s forwards;
  cursor: default;
}
.pdf-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgb(56 223 248 / 0.4);
}

/* Thumbnail */
.pdf-thumb {
  width: 100%;
  height: 180px;
  object-fit: cover;
  user-select: none;
  border-bottom: 3px solid #38bdf8;
  transition: transform 0.5s ease;
}
.pdf-card:hover .pdf-thumb {
  transform: scale(1.05);
}

/* Info */
.pdf-info {
  padding: 1.5rem 2rem 2rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}
.pdf-title {
  margin: 0 0 0.8rem;
  font-size: 1.4rem;
  font-weight: 700;
  color: #e0f2fe;
  letter-spacing: 0.8px;
  line-height: 1.2;
  transition: color 0.3s;
}
.pdf-card:hover .pdf-title {
  color: #38bdf8;
}
.pdf-category {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #38bdf8;
  border: 1.5px solid #38bdf8;
  border-radius: 30px;
  padding: 0.2rem 1rem;
  margin-bottom: 0.9rem;
  user-select: none;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.pdf-desc {
  font-size: 1rem;
  color: #94a3b8;
  flex-grow: 1;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

/* Buttons container */
.pdf-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.btn {
  flex-grow: 1;
  text-align: center;
  padding: 0.7rem 0;
  font-weight: 700;
  border-radius: 30px;
  cursor: pointer;
  user-select: none;
  transition: background 0.35s, color 0.35s, box-shadow 0.35s;
  border: 2.5px solid #38bdf8;
  color: #38bdf8;
  background: transparent;
  font-size: 1.05rem;
  box-shadow: 0 0 10px transparent;
  min-width: 130px;
}
.btn:hover {
  background: #38bdf8;
  color: #0f172a;
  box-shadow: 0 8px 20px #38bdf8aa;
}

/* Modal */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 500;
}
.modal-bg.active {
  display: flex;
}
.modal {
  background: #1e293b;
  max-width: 480px;
  width: 95%;
  border-radius: 20px;
  padding: 2rem 2.5rem;
  box-shadow: 0 15px 40px rgb(56 223 248 / 0.4);
  position: relative;
  animation: scaleIn 0.4s cubic-bezier(0.4,0,0.2,1) forwards;
  color: #cbd5e1;
  user-select: none;
}
@keyframes scaleIn {
  from {transform: scale(0.85); opacity: 0}
  to {transform: scale(1); opacity: 1}
}
.modal h2 {
  margin-top: 0;
  color: #38bdf8;
  font-weight: 700;
  letter-spacing: 1.2px;
  font-size: 2rem;
}
.modal p {
  margin: 1.25rem 0 2rem;
  color: #94a3b8;
  font-size: 1rem;
  line-height: 1.4;
}
.modal form {
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
}
.modal input, .modal textarea {
  padding: 1rem 1.25rem;
  font-size: 1.05rem;
  border-radius: 15px;
  border: none;
  background: #0f172a;
  color: #cbd5e1;
  box-shadow: inset 0 0 8px #38bdf8aa;
  resize: none;
  transition: box-shadow 0.3s ease;
}
.modal input::placeholder, .modal textarea::placeholder {
  color: #64748b;
}
.modal input:focus, .modal textarea:focus {
  outline: none;
  box-shadow: 0 0 10px #38bdf8;
}
.modal button {
  background: #38bdf8;
  border: none;
  color: #0f172a;
  padding: 1rem;
  font-weight: 700;
  font-size: 1.2rem;
  border-radius: 30px;
  cursor: pointer;
  transition: background 0.4s;
  box-shadow: 0 8px 25px #38bdf8aa;
}
.modal button:hover {
  background: #0ea5e9;
  box-shadow: 0 12px 40px #0ea5e9aa;
}
.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 2rem;
  font-weight: 700;
  color: #38bdf8;
  cursor: pointer;
  user-select: none;
  transition: color 0.3s;
}
.modal-close:hover {
  color: #0ea5e9;
}

/* Animations */
@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */

/* Tablets */
@media (max-width: 900px) {
  header {
    font-size: 1.3rem;
    padding: 1rem 2rem;
  }
  .pdf-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
  .pdf-thumb {
    height: 160px;
  }
}

/* Small tablets & large phones */
@media (max-width: 600px) {
  .controls {
    flex-direction: column;
    gap: 1.5rem;
  }
  .categories {
    justify-content: flex-start;
    padding-bottom: 0.75rem;
  }
  .pdf-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
  .pdf-thumb {
    height: 140px;
  }
  .btn {
    min-width: 100%;
  }
  header {
    padding: 1rem 1.2rem;
    font-size: 1.2rem;
  }
  .hamburger {
    display: flex;
  }
}

/* Mobile phones */
@media (max-width: 400px) {
  .pdf-grid {
    grid-template-columns: 1fr;
  }
  .pdf-thumb {
    height: 180px;
  }
  .btn {
    min-width: 100%;
  }
}

.logo {
  text-align: center;
  font-size: 1.5rem;
  font-weight: bold;
  margin: 1rem auto;
  display: block;
}


.back-btn {
  display: inline-flex;
  align-items: center;
  background-color: transparent;
  border: none;
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  transition: all 0.3s ease;
  overflow: hidden;
  position: relative;
}

.back-btn .icon {
  font-size: 20px;
  margin-right: 8px;
  transition: transform 0.2s ease;
}

.back-btn .text {
  opacity: 0;
  max-width: 0;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.3s ease, max-width 0.3s ease;
  color: #ffffff;
}

.back-btn:hover .text {
  opacity: 1;
  max-width: 150px;
}

.back-btn:hover .icon {
  transform: translateX(-2px);
}

@media (max-width: 768px) {
  .back-btn {
    display: none;
  }
}

.site-footer {
  background: #111;
  color: #f0f0f0;
  text-align: center;
  padding: 1rem 0;
  font-size: 0.9rem;
  position: relative;
  z-index: 10;
}

.footer-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}

.footer-content p {
  margin: 0 0 0.5rem;
}

.social-icons a {
  color: #ccc;
  margin: 0 0.5rem;
  font-size: 1.2rem;
  transition: color 0.3s, transform 0.3s;
}

.social-icons a:hover {
  color: #00ffae;
  transform: scale(1.2);
}
