/* Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

::-webkit-scrollbar {
  display: none;
}

body {
  font-family: 'Ubuntu';
  background-color: #ffffff;
  margin: 0;
  overscroll-behavior-x: auto;
}

iframe {
  width: 100%;
} 

/* Body padding for main page */
body.main-page {
  padding: 0;
  overflow: hidden;
  height: 100vh;
}

/* Body styles for landing page */
body.landing-page {
  background-color: #000;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Landing Page Specific Styles */
.background-image {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.content-overlay {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 100px 20px 60px;
  text-decoration: none;
}

.title-overlay {
  text-align: center;
  margin-bottom: 30%;
  color: white;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
}

.title-overlay a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.title-overlay h1 {
  font-size: 32px;
  font-weight: 300;
  margin-bottom: 10px;
  cursor: pointer;
  text-decoration: none;
}

.title-overlay p {
  font-size: 18px;
  font-weight: 300;
  cursor: pointer;
  text-decoration: none;
}

@media (min-width: 768px) {
  .title-overlay h1 {
    font-size: 56px;
  }
  
  .title-overlay p {
    font-size: 28px;
  }
}

/* Header Styles */
.header {
  padding: 20px;
  border-radius: 15px 15px 0px 0px;
  text-align: center;
  background: #395d73;
  color: white;
  font-size: 20px;
  display: none;
}

.landing-page .header {
  display: block;
}

@media (min-width: 768px) {
  .header {
    padding: 30px;
    font-size: 30px;
  }
}

.header h1 {
  margin: 0;
}

.header p {
  font-size: 16px;
  margin-top: -10px;
  color: white;
}

@media (min-width: 768px) {
  .header p {
    font-size: 20px;
    margin-top: -15px;
  }
}

/* Inside Header (Logo Bar) */
.inside-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 10px;
  flex-wrap: nowrap;
  gap: 5px;
  position: relative;
  z-index: 100;
}

/* Main page header positioning */
.main-page .inside-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background-color: transparent;
  box-shadow: none;
}

/* Landing page header positioning */
.landing-page .inside-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background-color: transparent;
  z-index: 10;
}

@media (min-width: 768px) {
  .inside-header {
    gap: 10px;
  }
}

/* Language Toggle */
.language-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
}

.language-toggle button {
  background-color: transparent;
  border: 2px solid #395d73;
  color: #395d73;
  padding: 5px 12px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.3s ease;
}

/* Main page language toggle - white text for dark background */
.main-page .language-toggle button {
  border-color: rgba(255, 255, 255, 0.8);
  color: white;
  background-color: rgba(0, 0, 0, 0.3);
}

.main-page .language-toggle button:hover {
  background-color: rgba(255, 255, 255, 0.9);
  color: #395d73;
  border-color: white;
}

.main-page .language-toggle button.active {
  background-color: rgba(255, 255, 255, 0.9);
  color: #395d73;
  border-color: white;
}

/* Landing page language toggle */
.landing-page .language-toggle button {
  background-color: rgba(255, 255, 255, 0.9);
}

.language-toggle button:hover {
  background-color: #395d73;
  color: white;
}

.language-toggle button.active {
  background-color: #395d73;
  color: white;
}

@media (min-width: 768px) {
  .language-toggle button {
    padding: 8px 16px;
    font-size: 16px;
  }
}

/* Logo Group */
.logo-group {
  display: flex;
  gap: 5px;
  align-items: flex-start;
}

@media (min-width: 768px) {
  .logo-group {
    gap: 10px;
  }
}

.site-logo {
  max-height: 30px;
  height: auto;
  width: auto;
  margin-left: 3px;
  flex-shrink: 1;
  min-width: 0;
}

@media (min-width: 480px) {
  .site-logo {
    max-height: 40px;
    margin-left: 5px;
  }
}

@media (min-width: 768px) {
  .site-logo {
    max-height: 60px;
    margin-left: 10px;
  }
}

@media (min-width: 1200px) {
  .site-logo {
    max-height: 80px;
  }
}

/* D3 Visualization Container */
#my_dataviz {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  background-image: url('/Content/images/debes_small.jpg');
  background-size: cover;
  background-position: center;
  display: flex;
  justify-content: center;
  align-items: center;
}

.svg-container {
  display: inline-block;
  margin: 0 auto;
}

/* Typography */
p {
  font-family: 'Ubuntu';
  font-size: 16px;
  text-align: justify;
  color: #ededed;
}

@media (min-width: 768px) {
  p {
    font-size: 20px;
  }
}

/* Links */
#external-link {
  font-family: 'Ubuntu';
  font-size: 16px;
  text-decoration: none;
  color: #656565;
}

@media (min-width: 768px) {
  #external-link {
    font-size: 20px;
  }
}

#external-link:after {
  color: #1e4678;
  padding-left: 2px;
  font: normal normal normal 18px/1 Arial;
  content: "\02197";
}

/* Tooltip */
.tooltip {
  position: absolute;
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 8px 12px;
  pointer-events: none;
  font-family: 'Ubuntu';
  font-size: 14px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 1000;
}

.node {
  cursor: pointer;
}

/* Footer Links (Landing Page) */
.footer-links {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 30px;
  padding: 55px 20px;
  z-index: 10;
}

/* Main page footer links */
/* .main-page .footer-links {
  position: fixed;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
} */

.footer-links a {
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  color: rgb(255, 255, 255);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.footer-links a:hover {
  color: #8ec5e3;
  text-decoration: underline;
}

@media (min-width: 768px) {
  .footer-links {
    gap: 50px;
  }
  
  .footer-links a {
    font-size: 18px;
  }
}

/* Image Copyright Attribution */
.image-copyright {
  position: fixed;
  bottom: 5px;
  right: 10px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
  background-color: rgba(0, 0, 0, 0.3);
  padding: 4px 8px;
  border-radius: 3px;
  z-index: 9;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

@media (min-width: 768px) {
  .image-copyright {
    font-size: 11px;
    padding: 5px 10px;
  }
}

.landing-page .image-copyright {
  bottom: 5px;
}

/* Overlay Styles */
.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  overflow: auto;
}

.overlay-content {
  position: relative;
  background-color: #2c5f6f;
  margin: 20px;
  padding: 20px;
  width: calc(100% - 40px);
  max-width: 1200px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  display: flex;
  gap: 20px;
}

@media (min-width: 768px) {
  .overlay-content {
    margin: 50px auto;
    padding: 40px;
    width: 90%;
  }
}

.overlay-main {
  flex: 1;
  overflow-y: auto;
  max-height: 80vh;
}

.overlay-sidebar {
  width: 300px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  padding-left: 20px;
  overflow-y: auto;
  max-height: 80vh;
}

@media (max-width: 767px) {
  .overlay-content {
    flex-direction: column;
  }
  
  .overlay-sidebar {
    width: 100%;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 0;
    padding-top: 20px;
    max-height: 300px;
  }
}

.overlay-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 32px;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  line-height: 1;
}

.overlay-close:hover {
  color: white;
}

/* Metadata (Author & Source) */
.metadata {
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 15px;
  margin-bottom: 20px;
}

.metadata-item {
  margin-bottom: 8px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
}

.metadata-label {
  font-weight: bold;
  color: white;
  margin-right: 8px;
}

.metadata a {
  color: #8ec5e3;
  text-decoration: none;
  cursor: pointer;
}

.metadata a:hover {
  text-decoration: underline;
}

.metadata svg {
  display: inline-block;
  vertical-align: middle;
}

/* Tag Network */
.tag-network {
  width: 100%;
  height: 250px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  margin-bottom: 15px;
  background-color: rgba(0, 0, 0, 0.1);
}

.related-files {
  margin-top: 15px;
}

.related-files h3 {
  font-size: 16px;
  color: white;
  margin-bottom: 10px;
}

.related-files ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.related-files li {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.related-files a {
  color: #8ec5e3;
  text-decoration: none;
  font-size: 14px;
}

.related-files a:hover {
  text-decoration: underline;
}

/* Markdown Content */
.markdown-content {
  font-family: 'Ubuntu';
  font-size: 18px;
  line-height: 1.6;
  color: white;
}

.markdown-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px auto;
  border-radius: 4px;
}

.markdown-content video {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px auto;
  border-radius: 4px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.markdown-content .video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  margin: 20px 0;
  border-radius: 4px;
}

.markdown-content .video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
}

.markdown-content h1, 
.markdown-content h2, 
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
  color: white;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

.markdown-content h1 {
  font-size: 28px;
}

.markdown-content h2 {
  font-size: 24px;
}

.markdown-content h3 {
  font-size: 20px;
}

.markdown-content p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 15px;
  text-align: justify;
}

.markdown-content a {
  color: #8ec5e3;
  text-decoration: none;
}

.markdown-content a:hover {
  text-decoration: underline;
}

.markdown-content ul,
.markdown-content ol {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 15px;
  padding-left: 30px;
}

.markdown-content li {
  margin-bottom: 8px;
}

.markdown-content blockquote {
  border-left: 4px solid rgba(255, 255, 255, 0.3);
  padding-left: 20px;
  margin: 20px 0;
  color: rgba(255, 255, 255, 0.8);
  font-style: italic;
}

.markdown-content code {
  background-color: rgba(0, 0, 0, 0.2);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

.markdown-content pre {
  background-color: rgba(0, 0, 0, 0.3);
  padding: 15px;
  border-radius: 4px;
  overflow-x: auto;
  margin: 20px 0;
}

.markdown-content pre code {
  background-color: transparent;
  padding: 0;
}

/* Overlay Text (for landing page overlays) */
.overlay-text {
  color: #333;
  line-height: 1.6;
}

.overlay-text h2 {
  color: #395d73;
  margin-bottom: 20px;
  font-size: 28px;
}

.overlay-text p {
  font-size: 16px;
  margin-bottom: 15px;
  text-align: justify;
  color: #333;
}

@media (min-width: 768px) {
  .overlay-text p {
    font-size: 18px;
  }
}

.overlay-text a {
  color: #1e4678;
  text-decoration: none;
}

.overlay-text a:hover {
  text-decoration: underline;
}

/* Landing page overlays (About, Contact, Impress, DSE) */
.footer-overlay .overlay-content,
.landing-page .overlay-content {
  background-color: white;
  display: block;
}

/* Footer overlay specific styling */
.footer-overlay-content {
  max-width: 800px;
}

.footer-overlay .overlay-close {
  color: #999;
}

.footer-overlay .overlay-close:hover {
  color: #333;
}

/* Tables */
table {
  width: 100%;
  margin-top: 20px;
}

th {
  padding: 10px;
  text-align: left;
}