/* =============================================================================
   Components - Reusable UI Components
   - Content containers, tabs, forms, buttons, and interactive elements
============================================================================= */

/* =============================================================================
   Content Containers
   - Enhanced styles for boxed content, paragraphs, and sections.
============================================================================= */

/* Paragraph Container Box */
.paragraph-box {
  background: linear-gradient(145deg, var(--paragraph-bg), rgba(255, 255, 255, 0.02));
  padding: 2rem;
  margin: 2rem auto;
  max-width: 900px;
  border-radius: 16px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  width: calc(100% - 2rem);
  box-sizing: border-box;
}

.paragraph-box:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Paragraph styling inside boxes */
.paragraph-box p {
  margin: 0;
  line-height: 1.8;
  font-family: 'Roboto', sans-serif;
  font-size: 1.15rem;
  color: var(--text-color);
  text-align: justify;
  text-indent: 1.5rem;
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.8), 0 0 2px rgba(0, 0, 0, 0.4);
}

.paragraph-box p:first-of-type {
  text-indent: 0;
}

.paragraph-box p:not(:last-child) {
  margin-bottom: 1.2rem;
}

/* Enhanced link styling within paragraphs */
.paragraph-box a {
  color: #00d4ff;
  text-decoration: none;
  font-weight: 500;
  position: relative;
  transition: all 0.3s ease;
}

.paragraph-box a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #00ffff, #00d4ff);
  transition: width 0.3s ease;
}

.paragraph-box a:hover {
  color: #00ffff;
  text-shadow: 0 0 8px rgba(0, 255, 255, 0.3);
}

.paragraph-box a:hover::after {
  width: 100%;
}

/* =============================================================================
   Section Styling
   - Enhanced styling for main content sections.
============================================================================= */
section {
  margin: 4rem 0;
  padding: 2rem 0;
  position: relative;
}

section:not(:last-child)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.2), transparent);
}

/* Table of Contents Styling */
.toc {
  margin: 3rem auto;
}

.toc .paragraph-box {
  background: linear-gradient(145deg, rgba(0, 255, 255, 0.05), rgba(0, 212, 255, 0.02));
  border-left: 4px solid #00ffff;
}

.toc ol {
  margin: 1rem 0;
  padding-left: 2rem;
}

.toc li {
  margin: 0.8rem 0;
  font-size: 1.1rem;
}

.toc a {
  color: #00d4ff;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.toc a:hover {
  color: #00ffff;
  text-shadow: 0 0 8px rgba(0, 255, 255, 0.3);
}

/* Image and Figure Styling */
figure.center {
  margin: 3rem auto;
  text-align: center;
  max-width: 600px;
}

figure.center img {
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

figure.center img:hover {
  transform: scale(1.02);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}

/* =============================================================================
   Enhanced Quick Facts Section
   - Modern styling for the tabbed quick facts component.
============================================================================= */

/* Quick Facts Container */
#quick-facts {
  max-width: 900px;
  margin: 3rem auto;
  background: linear-gradient(145deg, rgba(0, 255, 255, 0.05), rgba(0, 212, 255, 0.02));
  border-radius: 20px;
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(0, 255, 255, 0.2);
  overflow: hidden;
  backdrop-filter: blur(5px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#quick-facts:hover {
  transform: translateY(-5px);
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Section Heading for Quick Facts */
#quick-facts h2 {
  text-align: center;
  margin: 2rem 0 1.5rem 0;
  font-family: 'Montserrat', sans-serif;
  font-size: 2rem;
  background: linear-gradient(135deg, #00ffff 0%, #00d4ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  position: relative;
}

#quick-facts h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #00ffff, transparent);
  border-radius: 2px;
}

/* =============================================================================
   Enhanced Tabs
   - Modern styling for tabbed navigation and content areas.
============================================================================= */
.tabs {
  display: flex;
  flex-wrap: wrap;
  border-bottom: none;
  padding: 0 1rem;
  gap: 8px;
  justify-content: center;
}

.tab {
  flex: none;
  padding: 8px 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  outline: none;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-color);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 1rem;
}

.tab::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.6s ease;
}

.tab:hover::before {
  left: 100%;
}

.tab:hover {
  background: linear-gradient(135deg, rgba(0, 255, 255, 0.2), rgba(0, 212, 255, 0.1));
  border-color: rgba(0, 255, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 255, 255, 0.2);
  color: #00ffff;
}

.tab.active {
  background: linear-gradient(135deg, #00ffff, #00d4ff);
  border-color: #00ffff;
  color: #000;
  font-weight: 700;
  transform: translateY(-3px);
  box-shadow: 
    0 10px 30px rgba(0, 255, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.tab.active::before {
  display: none;
}

/* Tab Content Container */
.tab-content {
  padding: 2rem;
  min-height: 120px;
}

.content {
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s ease;
}

.content.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
  animation: slideInContent 0.5s ease-out;
}

@keyframes slideInContent {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Enhanced paragraph styling within tab content */
.content p {
  margin: 1rem 0;
  line-height: 1.7;
  font-family: 'Roboto', sans-serif;
  font-size: 1.1rem;
  color: var(--text-color);
}

.content p:first-child {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 1.5rem;
  text-align: center;
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.6);
}

.content p:last-child {
  font-style: italic;
  opacity: 1;
  border-left: 3px solid rgba(0, 255, 255, 0.3);
  padding-left: 1rem;
  margin-left: 1rem;
}

/* Enhanced links within content */
.content a {
  color: #00d4ff;
  text-decoration: none;
  font-weight: 600;
  position: relative;
  transition: all 0.3s ease;
}

.content a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #00ffff, #00d4ff);
  transition: width 0.3s ease;
}

.content a:hover {
  color: #00ffff;
  text-shadow: 0 0 8px rgba(0, 255, 255, 0.4);
}

.content a:hover::after {
  width: 100%;
}

/* =============================================================================
   Scroll Animations
   - Animation classes for scroll-triggered elements
============================================================================= */
.scroll-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-animate.visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-animate-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-animate-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.scroll-animate-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-animate-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.scroll-animate-scale {
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-animate-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* =============================================================================
   Gallery Basic Styling
   - Grid layout for image gallery and modal display styles.
============================================================================= */
#gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2rem;
}

.gallery-item {
  overflow: hidden;
  position: relative;
  cursor: pointer;
  text-align: center;
}

.gallery-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
  transform: translateZ(0);
}

.gallery-item:hover img {
  transform: scale(1.1) translateZ(0);
}

/* Description text below each gallery image */
.gallery-item .description {
  margin-top: 0.5rem;
  font-family: 'Roboto', sans-serif;
  font-size: 1rem;
  color: var(--text-color);
  z-index: var(--z-content);
}

/* Modal Overlay for enlarged gallery view */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: var(--z-modal);
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #000;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  z-index: var(--z-modal-content);
  max-width: 90vw;
  max-height: 90vh;
}

.modal img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 8px;
}

.close {
  position: absolute;
  top: 15px;
  right: 20px;
  color: #fff;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  z-index: var(--z-tooltip);
}

.close:hover {
  color: #00ffff;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .paragraph-box {
    padding: 1.5rem;
    margin: 1.5rem auto;
    border-radius: 12px;
  }
  
  .paragraph-box p {
    font-size: 1.1rem;
    text-indent: 1rem;
  }

  #quick-facts {
    margin: 2rem 15px;
    border-radius: 16px;
    max-width: none;
    width: calc(100% - 30px);
  }
  
  #quick-facts h2 {
    font-size: 1.6rem;
    margin: 1.5rem 0 1rem 0;
  }
  
  .tabs {
    flex-direction: column;
    gap: 8px;
    padding: 0 15px;
    align-items: stretch;
  }
  
  .tab {
    flex: none;
    width: 100%;
    margin-bottom: 8px;
    font-size: 0.85rem;
    padding: 12px 16px;
    text-align: center;
  }
  
  .tab-content {
    padding: 1.5rem 15px;
  }
  
  .content p:first-child {
    font-size: 1.1rem;
    margin-bottom: 1rem;
  }
  
  .content p:last-child {
    margin-left: 0;
    padding-left: 15px;
    border-left-width: 2px;
  }

  #gallery {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    margin: 1rem;
    gap: 0.8rem;
  }
  
  .gallery-item img {
    height: 150px;
  }
  
  .modal-content {
    padding: 1rem;
    margin: 1rem;
  }
}

@media (max-width: 480px) {
  .paragraph-box {
    padding: 1.2rem;
    margin: 1.2rem auto;
  }
  
  .paragraph-box p {
    font-size: 1rem;
    text-indent: 0.8rem;
  }

  #quick-facts {
    margin: 1.5rem 10px;
    width: calc(100% - 20px);
  }
  
  #quick-facts h2 {
    font-size: 1.4rem;
    margin: 1rem 0 0.8rem 0;
  }
  
  .tabs {
    padding: 0 10px;
  }
  
  .tab {
    font-size: 0.8rem;
    padding: 10px 12px;
    margin-bottom: 6px;
  }
  
  .tab-content {
    padding: 1rem 10px;
  }
  
  .content p:first-child {
    font-size: 1rem;
  }
  
  .content p:last-child {
    padding-left: 12px;
  }

  #gallery {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    margin: 0.8rem;
    gap: 0.6rem;
  }
  
  .gallery-item img {
    height: 120px;
  }
}