/* File name: /static/styles.css */
/* Base styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.2;
}

.site-header.primary {
  display: flex;
  justify-content: space-between;
  align-items: center;          /* keeps logo/title vertically centered */
  background-color: #007bff;
  color: white;
  padding: 10px 10px;
}

.header-left {
    display: flex;
    flex-direction: column; /* keeps title above nav */
}

/* This site-logo server as header-right purposes*/
.site-logo {
    height: 50px;   /* adjust size as needed */
    width: auto;
}

/* this controls the font of h1 group*/
header h1 {
    margin: 0 0 10px 0;  /* This is in clockwise direction, N, E, S, W */
    font-size: 1.5rem;  /* ~28.8px if base is 16px */
    line-height: 1.2;   /* keeps spacing tidy */
}

header h2 {
  font-size: 1.2rem;   /* ~32px if base is 16px */
  line-height: 1.2;
}


/* Navigation layout */
nav {
    display: flex;
    flex-direction: column; /* Stack nav groups in two rows, i.e. secondary nav is located below primary nav. */
    gap: 5px;
}

/* Shared nav styles */
nav ul {
    list-style-type: none;      /*removes bullets*/
    padding: 0;
    margin: 0;
    display: flex;             /*makes the <li> items line up horizontally by default*/
    column-gap: 5px;         /* horizontal spacing */
    row-gap: 5px;            /* vertical spacing between rows */
    flex-wrap: wrap;        /*allows the nav links to wrap into multiple rows on smaller screens, instead of squishing into one line.*/
}

/* Primary nav group - top row */
.nav-primary a {
    color: white;
    background-color: #003f88; /* dark blue */
    padding: 10px 10px;        /* space inside button, top & bottom | left & right */
    border-radius: 5px;        /* slightly rounder corners */
    text-decoration: none;
    font-weight: bold;
    display: inline-flex;      /* ensures consistent height alignment */
    align-items: center;       /* centers text vertically */
    min-height: 10px;          /* all buttons at least 40px tall */
    line-height: 1.2;          /* tidy text spacing */
}

.nav-primary a:hover,
.nav-primary a:focus {
    background-color: #e0a800; /* yellow*/
}


/* Secondary header: keep items on the left, inline with the title */
.site-header.secondary {
  display: flex;                /* make it a flexbox */
  justify-content: flex-start;  /* keep items bunched on the left */
  align-items: center;          /* vertically center them */
  column-gap: 5px;              /* horizontal spacing between children */
  background-color: #007bff;    /* or a darker shade if you want contrast */
  color: white;                 /* same blue as primary header */
  padding: 10px 10px;           /* space inside the bar */
}

/* Remove extra bottom margin so H1 and buttons align nicely */
.site-header.secondary h1 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.2;
}

/*This overrides any generic div styling. Setting transparent + 0 ensures the secondary header’s div wrappers don’t interfere with the bar’s blue background or spacing.*/
.site-header div {
  background-color: transparent;
  padding: 0;
}

.site-header.secondary nav {
  display: block;               /* let the UL handle its own layout */
}

/* Secondary nav group - bottom row */
.nav-secondary {
    display: flex;
    flex-wrap: wrap;
    gap: 5px; /* vertical gap, horizontal gap */
    padding: 0px 10px;
    list-style: none;
    margin: 0px 0px;
    /* margin: 1rem 0; /* optional: adds spacing above and below the whole nav */
}

/*These style the actual <a> elements inside each <li>.*/
.nav-secondary a {
    color: black;
    background-color: #81e3fb; /* light blue */
    padding: 10px 10px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    min-height: 10px;          /* all buttons at least 40px tall */
    line-height: 1.2;
}

.nav-secondary a:hover,
.nav-secondary a:focus {
    background-color: #e0a800; /* yellow*/
}

/* Main content */
main {
    padding: 15px;
}

/* Footer */
footer {
    background-color: #f1f1f1;
    padding: 10px;
    text-align: center;
    margin-top: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    nav ul {
        justify-content: flex-start;
    }
}

.content-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin: 10px;
}

.text-block {
    flex: 1;
    max-width: 65%;
}

.text-success {
    color: green;
    font-weight: bold; /* optional */
}

.text-danger {
    color: red;
    font-weight: bold; /* optional */
}


button {
    padding: 10px 20px;
    border: 1px solid #ccc;
    background-color: #f0f0f0;
    cursor: pointer;
}

button.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

button:not(.active):hover {
    background-color: #ddd;
}


.equation-block {
    max-height: 600px;       /* limit height */
    overflow-y: auto;        /* add scroll if content is tall */
    border: 1px solid #ccc;  /* light grey border */
    padding: 0 30px;         /* space left/right, none top/bottom */
    margin: 20px 0;          /* vertical spacing around block */
    background-color: #fafafa; /* optional: light background for emphasis */
}


/* wrap the label so we can anchor the icon & popover */
.label-wrap {
  position: relative;
  flex: 1;
  min-width: 250px; /* matches your label sizing */
  padding-right: 26px; /* room for the icon */
}

/* tiny info icon in the top-right corner of the label */
.help-icon {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid #888;
  background: #fff;
  font-size: 12px;
  line-height: 16px;
  text-align: center;
  cursor: pointer;
  padding: 0;
}

/* popover box */
.help-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  max-width: min(320px, 80vw);
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
  padding: 10px;
  z-index: 1000;
  display: none;
}

.help-popover.open { display: block; }

.help-popover__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.help-close {
  border: none;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.help-popover p {
  margin: 6px 0 0 0;
  font-size: 0.95rem;
}


/* ================================
   PLAXIS tutorial code boxes
   ================================ */

/* Outer wrapper around each code snippet */
.code-box {
  position: relative;
  border: 1px solid #d1d5db;
  background: #f8fafc;
  border-radius: 10px;
  padding: 0.8rem;
  margin: 1rem 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

/* Dark background for the actual code */
.code-box pre {
  margin: 0;
  background: #e5e7eb;
  color: #111827;
  padding: 0.9rem 1rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.9rem;
}

/* Monospace font inside code blocks */
.code-box code {
  font-family: "JetBrains Mono", "Fira Code", Consolas, Menlo, Monaco, monospace;
}

/* "Copy" button inside each code box */
.code-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #e5e7eb;
  color: #111827;
  border: 1px solid #9ca3af;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  border-radius: 6px;
  cursor: pointer;
}

.code-copy-btn:hover {
  background: #d1d5db;
}
