/* Global Styles */
:root {
    --primary-color: rgb(30, 113, 214);
    /* ROI Header Blue */
    --secondary-color: rgb(27, 86, 179);
    /* ROI Button Blue */
    --background-color: rgb(249, 249, 249);
    /* ROI Body Background */
    --text-color: #333;
    --light-text: #fff;
    --border-radius: 8px;
    --box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
header {
    background-color: var(--primary-color);
    color: var(--light-text);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
header nav {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    position: relative;
}
header a { color: var(--light-text); }
header .logo { color: var(--light-text); }
/* Ensure header links are not underlined and inline mode text looks like plain text */
header a { text-decoration: none; }
header .logo span {
    text-decoration: none;
    cursor: default;
    opacity: 0.9;
}
/* If header contains a wrapper, ensure it spaces content correctly */
header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
header .nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
    align-items: center;
    margin-left: auto; /* push links to the right */
}
header .nav-links a {
    color: var(--light-text);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s ease;
}
header .nav-links a:hover { opacity: 0.8; }

/* Hamburger (hidden on desktop) */
.hamburger {
    display: none; /* hidden by default on wide screens */
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    margin-left: auto; /* push to right on narrow screens */
    /* Ensure bars stack vertically */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.hamburger .bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--light-text);
    margin: 0; /* spacing handled by gap on container */
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Mobile nav */
@media (max-width: 768px) {
    header .nav-links {
        display: none;
        position: absolute;
        top: 56px;
        right: 12px;
        flex-direction: column;
        background: #ffffff;
        color: #333;
        box-shadow: 0 8px 24px rgba(0,0,0,0.15);
        border-radius: 8px;
        padding: 10px 12px;
        z-index: 1000;
        min-width: 160px;
    }
    header .nav-links.open { display: flex; }
    header .nav-links a { color: #333; padding: 8px 6px; display: block; }
    .hamburger { display: inline-flex; }
}

.logo {
    margin: 8px 0 12px 0;
    color: #444;
    font-weight: bold;
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.10);
}

/* New: grid layout and accents */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}
@media (max-width: 1023px) {
    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}
.promo { margin-top: 20px; }
.features-header {
    margin-bottom: 12px;
}
@media (min-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
.features-header h2 {
    margin: 0 0 6px 0;
}
.features-header p {
    margin: 0 0 12px 0;
    color: #333;
}
.feature-icon {
    font-size: 28px;
    line-height: 1;
}
.feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.tag {
    display: inline-block;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f2f2f2;
    color: #333;
}
.card-cta {
    display: inline-block;
    margin-top: 4px;
    font-weight: 600;
    color: #0b69ff;
    text-decoration: none;
}
.card-cta:hover { text-decoration: underline; }

/* Accent borders for visual variety */
.accent-1 { border-top: 4px solid #0984e3; }
.accent-2 { border-top: 4px solid #00b894; }
.accent-3 { border-top: 4px solid #fdcb6e; }
.accent-4 { border-top: 4px solid #e17055; }
.accent-5 { border-top: 4px solid #0984e3; }
.accent-6 { border-top: 4px solid #00b894; }

/* Legacy nav styles removed in favor of header-scoped styles above */

/* Main Content */
main {
    flex: 1;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    width: 100%;
    box-sizing: border-box;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    background-color: var(--primary-color);
    color: var(--light-text);
    margin-top: auto;
    border-top: none;
}

footer a {
    color: var(--light-text);
    text-decoration: underline;
}

footer a:hover {
    opacity: 0.8;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.hero p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
}

/* Highlight pills/tags for hero section */
.hero-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
}
.hero-tags .pill {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    background: #f2f6ff;
    color: #1f3b73;
    border: 1px solid #dbe5ff;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-flex; /* ensure consistent height across <a> and <button> */
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background-color: var(--secondary-color);
    color: var(--light-text);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: background-color 0.3s, transform 0.2s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1.2; /* normalize line-height across elements */
}

.btn:hover {
    background-color: #154694;
    /* Darker shade of secondary */
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* Features Grid */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 16px;
}

/* Modal */
.modal.hidden { display: none; }
/* Center all modals */
.modal { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.4); }
.modal-content { position: relative; max-width: 900px; margin: 0 auto; background: #fff; border-radius: var(--border-radius); box-shadow: var(--box-shadow); overflow: hidden; width: calc(100% - 32px); }
/* Tighter layout for the results modal only */
#results-modal .modal-content { max-width: 520px; }
.modal-header { display:flex; align-items:center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid #eee; }
.modal-body { padding: 1rem 1.25rem; }
.modal-close { background: transparent; border: none; font-size: 1.5rem; cursor: pointer; }

.quiz-table { width: 100%; border-collapse: collapse; }
.quiz-table th, .quiz-table td { padding: 0.75rem; border-bottom: 1px solid #eee; text-align: left; }
.quiz-table th { background: #f8f9fa; color: #333; font-weight: 600; }
.quiz-table tbody tr:hover { background: #f6f9ff; }

/* Scrollable grid area for many quizzes */
#quiz-table-container { max-height: 50vh; overflow: auto; border: 1px solid #eee; border-radius: 6px; }
.quiz-table thead th { position: sticky; top: 0; z-index: 1; }

@media (max-width: 640px) {
    .modal-content { margin: 0; height: 100vh; border-radius: 0; }
    .modal-body { padding: 0.5rem; }
    #quiz-table-container { max-height: 70vh; }
    /* Hide Difficulty column on small screens, keep Open button visible */
    .quiz-table th:nth-child(3), .quiz-table td:nth-child(3) { display:none; }
}

.feature-card {
    background: #fff;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
}
.feature-card { width: 100%; box-sizing: border-box; }
.feature-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Forms */
.config-form {
    background: #fff;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #444;
}

select,
input[type="range"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: var(--font-family);
}

.radio-group {
    display: flex;
    gap: 1.5rem;
}

.radio-group label {
    font-weight: normal;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.powered-by { display:flex; align-items:center; gap:10px; justify-content:center; margin-top: 12px; color:#666; }
.powered-by img { height: 22px; width: auto; display: inline-block; }
.powered-by span { font-size: 0.95rem; }

/* Edit Page - slightly larger fonts for readability */
.edit-page { font-size: 1.06rem; }

/* Results modal accents */
.results-emoji { font-size: 3.25rem; line-height: 1; margin-bottom: 0.25rem; }
#results-title { color: var(--primary-color); }
.edit-page label { font-size: 1.02rem; }
.edit-page textarea,
.edit-page input[type="text"],
.edit-page select { font-size: 1.06rem; line-height: 1.5; }
.edit-page .question-number { font-size: 1.1rem; }

/* Questions */
.question-card {
    background: #fff;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
}

.question-text {
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    color: #2c3e50;
}

.options-list {
    list-style: none;
    padding: 0;
}

.option-item {
    padding: 10px 15px;
    margin-bottom: 10px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
/* Ensure pointer cursor over any part of the option */
.options-list .option-item *,
.options-list .option-item { cursor: pointer; }
.option-label { display: inline-flex; align-items: center; }
.option-label p { margin: 0; }
.option-label ul, .option-label ol { margin: 0; }

.option-item:hover {
    background-color: #e2e6ea;
}

.answer-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.explanation {
    background-color: #e8f4fd;
    padding: 1rem;
}

.question-card h1, .question-card h2, .question-card h3 {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.question-card pre, .question-card code {
    background-color: #f3f6fa;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

.question-card ul, .question-card ol {
    padding-left: 1.2rem;
}

.text-muted {
    color: #9aa0a6;
    font-style: italic;
}

.answer-content.hidden { display: none; }
.result-status { font-weight: 600; margin-bottom: 0.75rem; }
.result-status.correct { color: #2e7d32; }
.result-status.incorrect { color: #c62828; }

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.loading-overlay.hidden { display: none; }
.spinner {
    width: 56px;
    height: 56px;
    border: 6px solid #e0e0e0;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.loading-text { margin-top: 1rem; color: #333; font-weight: 600; }
@keyframes spin { to { transform: rotate(360deg); } }


.awards-section {
  text-align: center;
  padding: 40px 20px;
  color: #444;
}

.case-study {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.case-study-header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.case-study-header.reverse-layout {
  flex-direction: row-reverse;
}

.instructor-photo {
  text-align: center;
  flex-shrink: 0;
}

.instructor-photo,
.program-highlights {
  flex: 1;
  max-width: 50%;
}

.photo-placeholder {
  width: 80px;
  height: 80px;
  background-color: #ccc;
  border-radius: 50%;
  margin: 0 auto;
}

.instructor-name {
  margin-top: 8px;
  font-weight: 600;
  font-size: 14px;
}

.program-highlights {
  flex: 1;
}

.program-highlights h4 {
  margin-bottom: 10px;
  font-size: 1rem;
  color: #1E71D6;
}

.program-highlights ul {
  margin: 0;
  padding-left: 18px; /* tighter than 20px */
  list-style-type: disc;
}

.program-highlights li {
  margin-bottom: 4px;
  font-size: 0.92rem;
  padding-left: 4px;  /* aligns text better under bullet */
}

.testimonial {
  margin-top: 20px;
  font-style: italic;
  background: #f4f8ff;
  padding: 12px 16px;
  border-left: 4px solid #1E71D6;
  border-radius: 4px;
  font-size: 0.92rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.reverse-layout {
  flex-direction: row-reverse;
}

.team-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  margin-top: 30px;
}

.team-member {
  text-align: center;
  max-width: 200px;
}

.team-photo {
  width: 100px;
  height: 100px;
  margin: 0 auto 10px;
  background-color: #ccc;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
}

.team-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.team-title {
  font-size: 0.9rem;
  color: #555;
}

.case-study-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1E71D6;
  text-align: center;
  margin-bottom: 12px;
}

.awards-contact-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 40px;
  margin-top: 20px;
  text-align: left;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}


.awards-column,
.contact-info {
  flex: 1;
  min-width: 300px;
}

@media (max-width: 700px) {
  .awards-contact-grid {
    flex-direction: column;
    text-align: center;
  }

  .awards-column,
  .contact-info {
    min-width: unset;
  }
}


.contact-info h4 {
  color: #1E71D6;
  font-size: 1rem;
  margin-bottom: 8px;
}

.contact-info a {
  color: #1E71D6;
  text-decoration: none;
}

.contact-info a:hover {
  text-decoration: underline;
}

.circular-photo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 10px;
}

.custom-dev-section {
  padding: 40px 20px;
  background-color: #f6f8fa;
  border-radius: 8px;
  margin-top: 40px;
  text-align: center;
}