/* General Typography and Colors */
body {
    font-family: sans-serif;    /* Match Swagger UI's font */
    line-height: 1.6;
    color: #3b4151;             /* Darker text for better readability */
    background-color: #f8f9fa;  /* Subtle background */
    margin: 0;
    padding: 0;
}

h1 {
    font-size: 2.5rem;
    font-weight: bold;
    text-align: left;
}

h2 {
    font-size: 1.8rem;
    font-weight: bold;
    margin-top: 1rem;
    text-align: left;
}

h3 {
    font-size: 1.6rem;
}

p, ol {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
    font-size: 1rem;
}

/* General Section Styling */
.container {
    max-width: 800px;           /* Ensure consistent width for content */
    margin: 0 auto;
    padding: 20px;
}

.info {
    text-align: center;          /* Center-align title and description */
}

/* Title Styling */
.main {
    margin-bottom: 15px;          /* Add space between title and description */
}

.title {
    font-size: 2.5rem;
    color: #333; /* Darker text color */
    font-weight: bold;
    margin: 0;
    padding: 0;
}

.version {
    font-size: 1rem;
    color: #888; /* Subtle color for version text */
    margin: 0;
    padding: 0;
}

/* Description Styling */
.description {
    margin-top: 10px;
    text-align: left; /* Center-align description text */
}

.description h2 {
    margin-bottom: 10px;
}

.description p {
    line-height: 1.6;
    margin: 0;
}

/* Section Styling */
section {
    margin-top: 20px;
    text-align: left;         /* Left-align content for additional sections */
}

section h3 {
    font-weight: bold;
    margin-bottom: 10px;
    color: #0056b3;           /* Blue colour */
}

section p {
    line-height: 1.6;
}

section .muted-section {
    color: #6c757d;           /* Muted text color */
    font-size: 0.8em;         /* 90% of the parent's font size */
    font-style: italic;       /* Optional for emphasis */
}

section .muted-section p {
    font-size: 1em;         /* Set to force the font size in .muted-section (above) */
}

/* Footer Styling */
footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

footer p {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.6;
    text-align: center;
}

/* Navigation Bar */
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f0f8ff;
    padding: 10px 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-container .logo {
    font-size: 1.8em;
    font-family: 'Georgia', serif;
    color: black;
    text-decoration: none;
    font-weight: bold;
}

.nav-container .logo:hover {
    text-decoration: underline;
}

.nav-links {
    display: flex;
    gap: 15px;
    margin-left: 30px;
    list-style: none;
}

.nav-links a {
    color: black;
    font-size: 1em;
    text-decoration: none;
    font-weight: bold;
}

.nav-links a:hover {
    text-decoration: underline;
}

/* Navbar Logo */
.navbar-brand {
    display: flex;
    align-items: center;
    font-family: 'sans-serif';
    font-weight: bold;
    font-size: 1.3em;
    color: #333; /* Use a professional, readable color */
    text-decoration: none;
    transition: color 0.3s ease;
}

.logo-text {
    color: #333; /* Ensure readability */
}

.logo-text:hover {
    color: #ff6300; /* Match hover state of the navbar-brand */
}

/* Flash message container styling */
.flash-container {
    position: absolute;
    top: 70px; /* Adjust based on navbar height */
    right: 20px; /* Right-align messages */
    z-index: 1050; /* Ensure it appears above other elements */
    width: 300px;
}

/* Flash message styling */
.flash-message {
    display: none;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: opacity 0.5s ease;
}

/* Success message */
.flash-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Info message */
.flash-message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Danger message */
.flash-message.danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}


/* Buttons Styling */
.btn-primary {
    background-color: #0066cc;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    display: inline-block;
    text-align: center;
}

.btn-primary:hover {
    background-color: #004c99;
}

/* Authentication Links */
.auth-links {
    display: flex;
    gap: 15px;
}

.auth-links .auth-link {
    color: black;
    font-size: 1em;
    font-weight: bold;
    text-decoration: none;
    padding: 5px 10px;
    border: 1px solid black;
    border-radius: 4px;
}

.auth-links .auth-link:hover {
    background-color: black;
    color: white;
    text-decoration: none;
}

/* Form Section */
.form-section {
    margin: 2rem auto;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.card {
    background-color: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 800px; /* Match Swagger's layout width */
    padding: 20px;
    margin: 0 auto;
}

.card-body {
    padding: 20px;
    text-align: center;
}

/* Token Display */
.token-display {
    margin-top: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border: 1px dashed #cccccc;
    border-radius: 5px;
    text-align: center;
}

.token-display p {
    margin: 0;
    font-size: 1rem;
    text-align: center;
}

#copy-button {
    padding: 5px 10px; /* Reduce vertical and horizontal padding */
    font-size: 0.9em; /* Slightly smaller font size */
    background-color: #f8f9fa; /* Brighter background */
    border: 1px solid #ced4da; /* Subtle border */
    color: #495057; /* Slightly darker text color for contrast */
    border-radius: 4px; /* Slightly rounded corners */
    cursor: pointer; /* Pointer cursor on hover */
    transition: background-color 0.2s ease; /* Smooth transition for hover effect */
}

#copy-button:hover {
    background-color: #e2e6ea; /* Slightly darker background on hover */
    border-color: #dae0e5; /* Match hover state with border */
    color: #343a40; /* Darker text for better hover visibility */
}


/* Tier Section Styling */
.tier-section {
    display: block; /* Change to block layout to stack cards vertically */
    margin-top: 20px;
    margin-bottom: 20px;
}

/* Individual Tier Card Styling */
.tier-card {
    background-color: #ffffff; /* White background for the card */
    border: 1px solid #e5e5e5; /* Subtle border */
    border-radius: 8px; /* Rounded corners */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Soft shadow for depth */
    width: 100%; /* Full width within the container */
    max-width: 800px; /* Restrict maximum width */
    padding: 20px;
    margin: 20px auto; /* Center the card with spacing between cards */
    text-align: center; /* Center-align the content */
    transition: transform 0.2s ease, box-shadow 0.2s ease; /* Smooth hover effect */
}

.tier-card:hover {
    transform: translateY(-5px); /* Lift the card on hover */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15); /* Darker shadow on hover */
}

.tier-header {
    font-size: 1.4rem; /* Slightly smaller than h2 */
    font-weight: bold;
    color: #0056b3; /* Accent color for the header */
    margin-bottom: 10px;
}

.tier-card ul {
    list-style: none; /* Remove default list styling */
    padding: 10px;
    margin: 10px;
    font-weight: bold;
    text-align: center; /* Align bullet points to the left */
}

.tier-card ul li {
    margin-bottom: 8px; /* Space between bullet points */
    font-size: 0.9rem; /* Slightly smaller font size */
    line-height: 1.4;
    color: #3b4151; /* Darker text color for readability */
}

.tier-card-link {
    color: inherit; /* Ensures the text color remains unchanged */
    display: block; /* Ensures the entire card is clickable */
}

.tier-card-link:hover {
    font-weight: bold; /* Makes the font bold on hover */
    text-decoration: none;
}




/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-wrap: wrap;
    }

    h1 {
        font-size: 2rem;
    }

    .card {
        padding: 15px;
    }

    .btn-primary {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}



/* Code Block Styling */
/* Specific styling for the API Demo page */
.api-demo-page .container {
    max-width: 100%; /* Allow full width */
    padding: 0 20px; /* Add horizontal padding */
}

.api-demo-page .codecard {
    width: 90%; /* Use 90% of the viewport width */
    max-width: 1200px; /* Limit maximum width */
    margin: 20px auto; /* Center the codecard */
}

/* --- Metric Docs Styling ---  */
/* ---------------- Metric Detail (permalink) ---------------- */
.doc table { border-collapse: separate; border-spacing: 14px 6px; width: 100%; }
.doc th:first-child, .doc td:first-child { white-space: nowrap; width: 28%; padding-right: 1.25rem; }
.doc code { background:#f5f5f5; padding:.1rem .25rem; border-radius:3px; }

/* ---------------- Metric Index (catalog) ------------------- */
:root{
  --primary: 210 99% 69%;   /* Swagger-ish blue */
  --ink: 220 15% 20%;
  --muted: 220 10% 46%;
  --panel: 0 0% 100%;
  --border: 220 16% 90%;
}

.metrics-toolbar{
  position: sticky; top: 0; z-index: 5;
  display:flex; gap:.5rem; align-items:center;
  padding:.5rem 0 .75rem;
  background:hsl(0 0% 100% / .92);
  backdrop-filter: blur(4px);
}
.metrics-toolbar input[type="text"]{ flex:1; max-width:540px; }
.metrics-toolbar .results{ margin-left:auto; color:hsl(var(--muted)); font-size:.9rem; }

.group-header{
  margin:1.2rem 0 .6rem; padding-bottom:.2rem;
  border-bottom:2px solid hsl(var(--border));
  color:hsl(var(--ink)); font-weight:800;
}
.group-header .count{ color:hsl(var(--muted)); font-weight:600; font-size:.9rem; margin-left:.35rem; }

.metrics-grid{
  list-style:none; margin:0; padding:0;
  display:grid; grid-template-columns: repeat(auto-fill, minmax(360px,1fr));
  gap:1rem;
}

.metric-card{
  background:hsl(var(--panel));
  border:1px solid hsl(var(--border));
  border-radius:12px;
  box-shadow:0 1px 3px rgb(0 0 0 / .04);
  transition: box-shadow .15s ease, border-color .15s ease;
}
.metric-card:hover{ box-shadow:0 4px 12px rgb(0 0 0 / .08); border-color:#e2e2e2; }

.metric-inner{ padding:1rem; }
.metric-head{
  display:flex; align-items:center; justify-content:space-between; gap:.75rem;
}
.metric-title{
  flex:1 1 auto;
  font-weight:700; font-size:1.05rem; color:hsl(var(--ink));
  text-decoration:none;
}
.metric-title:hover{ text-decoration:none; }

.metric-slug{
  display:inline-block; margin-top:.25rem;
  background:#fff0f6; color:#c2255c;
  padding:.12rem .4rem; border-radius:6px;
}

/* Meta layout container */
.metric-meta{
  display:flex; flex-direction:column;
  gap:.35rem; margin-top:.55rem;
  font-size:.92rem; color:hsl(var(--muted));
}
.metric-meta strong{ color:hsl(var(--ink)); font-weight:600; margin-right:.25rem; }

.meta-row{ display:flex; align-items:center; min-height:1.2rem; }

.meta-group{ gap:.35rem; overflow:hidden; }
.meta-group-text{
  flex:1 1 auto;
  min-width:0;                 /* critical for ellipsis in flex */
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}

.meta-split{ justify-content:space-between; }
.meta-tier{ margin-left:1rem; white-space:nowrap; }

/* ---------------- Buttons ---------------- */
.btn{
  border:1px solid hsl(var(--border));
  background:#fff;
  padding:.32rem .6rem;
  border-radius:8px;
  cursor:pointer;
  text-decoration:none;
  color:hsl(var(--ink));                 /* readable base text */
  line-height:1.15;
}
.btn:hover{ background:#f7f7f7; color:hsl(var(--ink)); }

.btn-primary,
.btn-primary:visited{
  color:#fff !important;                 /* pin readable text */
  background:hsl(var(--primary));
  border-color:hsl(var(--primary));
}
.btn-primary:hover,
.btn-primary:focus{
  color:#fff !important;                 /* stay readable on hover/focus */
  background:hsl(var(--primary) / 0.92);
  border-color:hsl(var(--primary));
}
.btn-primary:active{
  color:#fff !important;
  background:hsl(var(--primary) / 0.86);
  border-color:hsl(var(--primary));
}
.btn:focus-visible{
  outline:2px solid hsl(var(--primary));
  outline-offset:2px;
}

/* smaller, right-aligned Open button */
.open-btn{
  font-size:.85rem;           /* smaller text */
  padding:.24rem .56rem;      /* tighter box */
  border-radius:6px;
  margin-left:auto;           /* ensure right-align in flex row */
}

/* no underlines for links inside cards */
.metrics-grid .metric-card a,
.metrics-grid .metric-card a:hover,
.metrics-grid .metric-card a:focus { text-decoration:none; }

