/* Base styles */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0 20px;
  background: #f8f9fa;
  color: #333;
  line-height: 1.6;
  max-width: none;
}

/* HEADER */
header {
  background: linear-gradient(135deg, #004080 0%, #003366 100%);
  color: #fff;
  padding: 20px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  border-radius: 0 0 8px 8px;
  margin-bottom: 2rem;
}

header h1 {
  margin: 0;
  font-weight: 700;
  font-size: 2.2rem;
  letter-spacing: 1px;
}

header nav a {
  color: #fff;
  margin-left: 20px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: color 0.3s ease;
}

header nav a:hover,
header nav a:focus {
  color: #a8caff;
}

/* MAIN content */
main {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 2rem;
  margin: 0 auto;
  max-width: 100%;
}

/* Intro section */
#intro {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #eaeaea;
}

#intro h2 {
  color: #004080;
  margin-top: 0;
  border-bottom: 2px solid #004080;
  padding-bottom: 0.5rem;
  display: inline-block;
  font-weight: 700;
  font-size: 1.8rem;
}

/* Top info section with grid layout */
.top-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
  max-width: 100%;
}

.download-block, .docs-block {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s;
}

/* Examples */
.examples {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}


.examples select {
  padding: 10px 15px;
  border: 2px solid #004080;
  border-radius: 4px;
  background-color: white;
  height: 40px;
  box-sizing: border-box;
}

/* Download buttons (global) */
.download-options a,
.docs-block a,
#downloadBtn {
  display: inline-block;
  background: #004080;
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 4px;
  margin-top: 1rem;
  transition: background 0.3s;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.3s;
  cursor: pointer;
}
.download-options a:hover,
.docs-block a:hover,
#downloadBtn:hover {
  background: #003366;
}

/* Download format selector */
#downloadFormat {
  padding: 10px 15px;
  border: 2px solid #004080;
  border-radius: 6px;
  background-color: white;
  margin-right: 10px;
  font-size: 0.95rem;
}
.download-controls {
  margin-bottom: 1rem;
}

/* YASGUI container */
#yasgui {
  display: block;
  width: 100%;
  margin: 1rem 0 2rem 0;
  padding-bottom: 2rem;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  height: auto;
  min-height: 400px;
}

/* YASGUI use the full width */
.yasgui {
  width: 100% !important;
}

/* Control the internal layout of YASGUI */
.yasgui .yasqe, .yasgui .yasr {
  width: 100% !important;
}

/* Ensure the results container doesn't create nested scrolling */
.yasgui .yasr .results {
  overflow: auto;
  max-height: none !important;
  height: auto !important;
}

/* Make the table responsive within the results */
.yasgui .results .tableView {
  overflow: auto;
  width: 100%;
}

.yasgui .results .tableView table {
  width: 100%;
  table-layout: auto;
}

.yasgui .results .tableView td {
  word-break: break-word;
  white-space: normal;
  max-width: none;
}

/* Keep internal results visually contained */
.yasgui .results {
  overflow: auto;
  padding: 1rem;
  box-sizing: border-box;
}

.yasgui .results .tableView table {
  width: 100%;
  table-layout: fixed;
}
.yasgui .results .tableView td {
  word-break: break-word;
  white-space: normal;
}

/* Hides the endpoint field (fixed readonly) */
#endpointInput,
label[for="endpointInput"] {
  display: none;
}

/* Custom Query Section */
#custom-query {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  margin-top: 2rem;
}

#custom-query h2 {
  color: #004080;
  margin-top: 0;
  font-weight: 700;
  font-size: 1.5rem;
}

#custom-query label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

#custom-query input[type="text"],
#custom-query textarea {
  width: 100%;
  max-width: 100%;
  padding: 10px;
  border: 1px solid #ccd6e0;
  border-radius: 6px;
  font-family: Arial, sans-serif;
  font-size: 1rem;
  margin-bottom: 15px;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
}

#custom-query input[type="text"]:focus,
#custom-query textarea:focus {
  border-color: #004080;
  outline: none;
  box-shadow: 0 0 5px #a8caff;
}

#custom-query button#runQuery {
  background-color: #004080;
  color: #fff;
  font-weight: 700;
  border: none;
  padding: 12px 25px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  box-shadow: 0 2px 5px rgba(0,64,128,0.3);
}

#custom-query button#runQuery:hover,
#custom-query button#runQuery:focus {
  background-color: #003366;
  box-shadow: 0 4px 10px rgba(0,51,102,0.5);
}

/* Links styling */
a {
  color: #004080;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

a:hover,
a:focus {
  color: #00264d;
  text-decoration: underline;
}

/* Footer */
footer {
  background: #f8f9fa;
  color: #555;
  text-align: center;
  padding: 20px 0;
  margin-top: 50px;
  font-size: 0.9rem;
  border-top: 1px solid #e7e7e7;
  border-radius: 0 0 8px 8px;
}

/* Responsive design */
@media (max-width: 1200px) {
  main {
    padding: 1.5rem;
  }
}

@media (max-width: 900px) {
  .top-info {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .top-info {
    grid-template-columns: 1fr;
  }
  
  header {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
    padding: 15px;
  }
  
  header nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
  }
  
  header nav a {
    margin: 0;
  }
  
  main {
    padding: 1.5rem;
  }
  
  .examples {
    flex-direction: column;
    align-items: stretch;
  }
  
  .examples button {
    margin-right: 0;
    margin-bottom: 10px;
    width: 100%;
  }
}
.yasgui .results .tableView td {
  max-width: 300px;
}

.yasgui .results .tableView td a {
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  white-space: normal;
}

/* DOCS PAGE SPECIFIC STYLES */
/* Content sections */
.content-section {
  margin-bottom: 2.5rem;
  scroll-margin-top: 6rem;
}

.content-section h2 {
  color: #004080;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #004080;
  font-size: 1.5rem;
  font-weight: 700;
}

/* Card style for blocks */
.card {
  background: #f8f9fa;
  border-left: 4px solid #004080;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}
