/* General body styling */
body {
    margin: 0;
    font-family: system-ui;
    background: #fff;
    padding: 24px;

    display: flex;
    flex-direction: column;
    min-height: 100vh; /* full viewport height */
}

/* Make main content grow to fill space */
main {
    flex: 1;
}

/* ========================= */
/* Header */
/* ========================= */
header {
    position: sticky;
    top: 0;
    z-index: 1000;  /* High but below modal */
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin: 20px;
    height: 100px;
    padding: 0 40px;
}

header img {
    max-height: 200%;
    width: auto;
    object-fit: contain;
}

/* ========================= */
/* Headings */
/* ========================= */
h2 {
    margin-top: 0;
}

/* ========================= */
/* Search input */
/* ========================= */
input#searchInput {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    margin-bottom: 24px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid #ccc;
    border-radius: 8px;
}

/* ========================= */
/* List styling */
/* ========================= */
ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px,1fr));
    gap: 16px;
}

li {
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 12px;
    background: #fefefe;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

li:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

li * {
    cursor: pointer;
}

/* SCORM / PDF text styling */
li span {
    display: block;
    font-weight: bold;
    color: #111;
}




.back-button-container {
  margin: 15px 0;
}

.back-button {
  display: inline-block;
  background-color: #4CAF50;
  color: #fff;
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  transition: background-color 0.3s;
}

.back-button:hover {
  background-color: #45a049;
}


/* ========================= */
/* Modal Styling (Iframe Overlay) */
/* ========================= */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999; /* Highest value to appear above everything */
}

/* Show modal when active */
.modal.active {
    display: flex;
}

/* Modal content container */
.modal-content {
    width: 95%;
    max-width: 1200px;
    height: 95%;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    z-index: 10000; /* Even higher than modal backdrop */
}

/* Iframe fills modal */
.modal-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}


.library-description {
  background-color: #f9f9f9;  /* light neutral background */
  border-left: 5px solid #4CAF50; /* accent color */
  padding: 15px 20px;
  margin: 20px 0;
  font-family: Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #333;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.library-description strong {
  color: #2e7d32; /* slightly darker green for emphasis */
}


/* Close button */
.modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    z-index: 10001;
}

/* Prevent background scrolling when modal is open */
body.modal-open {
    overflow: hidden;
}

/* ========================= */
/* Footer */
/* ========================= */
footer {
    /* Remove position: sticky; */
    position: relative;  /* stays at bottom of page flex container */
    z-index: 1000; 
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    background-color: #fff;
    margin: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

footer a {
    color: #333;
    font-size: 1.5rem;
    transition: color 0.3s, transform 0.3s;
}

footer a:hover {
    color: #0077ff;
    transform: scale(1.2);
}
