/* Page Hero */
.page-hero {
  margin-top: 70px;
  height: 50vh;
  background: linear-gradient(
      var(--color-overlay-brown-dark),
      var(--color-overlay-brown-light)
    ),
    url(Assets/Images/legal-bg.webp);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--color-text-white);
}

.page-hero h1 {
  font-family: var(--font-heading);
  font-size: 4rem;
  font-weight: 700;
  letter-spacing: 3px;
  margin-bottom: 1rem;
  text-shadow: 0 2px 20px var(--shadow-black);
}

.page-hero p {
  font-size: 1.3rem;
  font-weight: 200;
  letter-spacing: 1px;
}

/* Document Grid */
.documents-grid {
  display: grid;
  /* grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); */
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  /* margin-bottom: 4rem; */
}

.document-card {
  background: var(--color-bg-white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 30px var(--shadow-dark);
  transition: all 0.4s ease;
  border: 2px solid transparent;
}

.document-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 60px var(--shadow-brown-dark);
  border-color: var(--color-accent-gold);
}

.document-preview {
  height: 250px;
  border-bottom: 1px solid var(--color-border-dark);
  /* background: var(--color-bg-secondary); */
  background-image: url(./Assets/Images/certificate.jpg);
  background-size: cover;
  background-position: top;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  /* opacity: 0.6; */
}

.document-thumbnail {
  width: 100%;
  height: 100%;
  background: var(--color-bg-white);
  border-radius: 8px;
  box-shadow: 0 4px 20px var(--shadow-darkest);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  border: 1px solid var(--color-border-dark);
  transition: all 0.3s ease;
}

.document-card:hover .document-thumbnail {
  transform: scale(1.05);
  box-shadow: 0 8px 30px var(--shadow-extra-dark);
}

.doc-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 2px solid var(--color-primary-brown);
}

.doc-icon-small {
  font-size: 2rem;
}

.doc-title-small {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-primary-brown);
  letter-spacing: 0.5px;
}

.doc-content-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.doc-line {
  height: 6px;
  background: linear-gradient(
    90deg,
    var(--color-primary-brown),
    var(--color-secondary-beige)
  );
  border-radius: 3px;
  opacity: 0.3;
}

.doc-line:nth-child(1) {
  width: 90%;
}
.doc-line:nth-child(2) {
  width: 85%;
}
.doc-line:nth-child(3) {
  width: 95%;
}
.doc-line:nth-child(4) {
  width: 80%;
}
.doc-line:nth-child(5) {
  width: 88%;
}
.doc-line:nth-child(6) {
  width: 92%;
}
.doc-line:nth-child(7) {
  width: 75%;
}
.doc-line:nth-child(8) {
  width: 85%;
}

.doc-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border-dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.doc-badge {
  background: var(--gradient-gold);
  color: var(--color-text-white);
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.doc-pages {
  color: var(--color-neutral-gray-light);
  font-size: 0.75rem;
  font-weight: 600;
}

/* Document type backgrounds */
.doc-type-certificate .document-thumbnail {
  background: linear-gradient(135deg, #fffef7, #fff8e7);
  border-left: 4px solid var(--color-accent-gold);
}

.doc-type-approval .document-thumbnail {
  background: linear-gradient(135deg, #f5f9ff, #ebf4ff);
  border-left: 4px solid var(--color-primary-brown);
}

.doc-type-legal .document-thumbnail {
  background: linear-gradient(135deg, #fff5f5, #ffebeb);
  border-left: 4px solid var(--color-primary-brown-light);
}

.document-info {
  padding: 2rem;
}

.document-info h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--color-primary-brown);
  margin-bottom: 0.5rem;
  letter-spacing: 1px;
}

.document-type {
  color: var(--color-accent-gold);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  letter-spacing: 1px;
}

.document-description {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  font-weight: 300;
}

.document-actions {
  display: flex;
  gap: 1rem;
}

.preview-btn,
.download-btn {
  flex: 1;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-family: var(--font-accent);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
}

.preview-btn {
  background: transparent;
  color: var(--color-primary-brown);
  border: 2px solid var(--color-primary-brown);
}

.preview-btn:hover {
  background: var(--color-primary-brown);
  color: var(--color-text-white);
}

.download-btn {
  background: var(--color-accent-gold);
  color: var(--color-text-white);
}

.download-btn:hover {
  background: var(--color-accent-gold-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--shadow-gold);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.modal.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: var(--color-bg-white);
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  border-radius: 16px;
  overflow: hidden;
  animation: modalZoom 0.4s ease;
}

@keyframes modalZoom {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-header {
  background: var(--gradient-brown-dark);
  color: var(--color-text-white);
  padding: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 2rem;
  letter-spacing: 2px;
}

.modal-close {
  width: 40px;
  height: 40px;
  background: var(--color-overlay-white-20);
  border: none;
  border-radius: 50%;
  color: var(--color-text-white);
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.modal-body {
  padding: 2rem;
  max-height: calc(90vh - 160px);
  overflow-y: auto;
}

.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: var(--color-bg-secondary);
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--color-accent-gold);
  border-radius: 4px;
}

/* Legal Sections */
.legal-section {
  background: var(--color-bg-white);
  padding: 3rem;
  border-radius: 16px;
  box-shadow: 0 4px 20px var(--shadow-medium);
  margin-bottom: 3rem;
}

.legal-section h2 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  color: var(--color-primary-brown);
  margin-bottom: 1.5rem;
  letter-spacing: 2px;
}

.legal-section h3 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--color-primary-brown);
  margin: 2rem 0 1rem;
  letter-spacing: 1.5px;
}

.legal-section p {
  color: var(--color-text-tertiary);
  font-size: 1.05rem;
  line-height: 1.9;
  margin-bottom: 1.5rem;
  font-weight: 300;
  letter-spacing: 0.3px;
}

.legal-section ul {
  margin-left: 2rem;
  margin-bottom: 1.5rem;
}

.legal-section li {
  color: var(--color-text-tertiary);
  font-size: 1.05rem;
  line-height: 1.9;
  margin-bottom: 0.8rem;
  font-weight: 300;
}

.highlight-box {
  background: var(--gradient-beige);
  padding: 2rem;
  border-radius: 12px;
  border-left: 4px solid var(--color-accent-gold);
  margin: 2rem 0;
}

.highlight-box p {
  margin-bottom: 0;
  color: var(--color-text-primary);
}

.last-updated {
  text-align: center;
  color: var(--color-neutral-gray-light);
  font-size: 0.9rem;
  margin-top: 2rem;
  font-style: italic;
}

@media (max-width: 968px) {
  .nav-links {
    display: none;
  }
  .page-hero h1 {
    font-size: 2.5rem;
  }
  .documents-grid {
    grid-template-columns: 1fr;
  }
  .legal-section {
    padding: 2rem;
  }
  .modal-content {
    width: 95%;
  }
  .document-actions {
    flex-direction: column;
  }
}
