/* --- General Styles --- */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  background-color: #545c7e;
  color: #a3a29a;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
}

h1,
h2 {
  color: #a3a29a;
  border-bottom: 2px solid #545c7e;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

/* --- Layout & Structure --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

header {
  background-color: #545c7e;
  color: #a3a29a;
  padding: 2rem 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

header p {
  font-size: 1.1rem;
  opacity: 0.9;
}

main {
  max-width: 960px;
  margin: 40px auto;
  padding: 30px;
  background: #282328;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  border: 1px solid #c56981;
  border-radius: 8px;
  transition: transform 0.3s ease-in-out;
}

section:hover {
  transform: translateY(-5px);
}

/* --- Navigation Menu --- */
nav {
  background-color: #282328;
  padding: 0.5rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

nav h2 {
  display: none;
  /* Hidden visually, available for screen readers */
}

nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

nav ul li a {
  display: block;
  color: #a3a29a;
  text-decoration: none;
  padding: 1rem 1.5rem;
  transition: background-color 0.3s ease;
}

nav ul li a:hover {
  background-color: #c56981;
  border-radius: 5px;
}

nav ul li ul {
  display: none;
  position: absolute;
  background-color: #282328;
  border-radius: 5px;
  padding: 10px 0;
  z-index: 1000;
}

nav ul li:hover>ul {
  display: block;
}

nav ul li ul li a {
  padding: 0.75rem 1.5rem;
  white-space: nowrap;
}

/* --- Image Gallery --- */
.image-container {
  display: flex;
  justify-content: center;
  gap: 25px;
  flex-wrap: wrap;
  margin: 30px 0;
}

.image-container img {
  max-width: 100%;
  height: auto;
  width: 280px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer; /* <-- ADDED THIS to show images are clickable */
}

.image-container img:hover {
  transform: scale(1.05) rotate(2deg);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* --- Links --- */
a {
  color: #c56981;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #545c7e;
  text-decoration: underline;
}

/* --- Forms --- */
.form-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.form-row {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.form-row .form-group {
  flex: 1;
  min-width: 200px;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  color: #a3a29a;
  font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #545c7e;
  border-radius: 5px;
  background-color: #3a3240;
  color: #a3a29a;
  font-size: 1rem;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #c56981;
  box-shadow: 0 0 5px rgba(197, 105, 129, 0.3);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

.error {
  color: #ff6b6b;
  font-size: 0.9rem;
  margin-top: 0.25rem;
  display: block;
}

.error-input {
  border-color: #ff6b6b;
}

/* --- Buttons --- */
button {
  background-color: #c56981;
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 5px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  margin: 10px 5px;
}

button:hover {
  background-color: #a84c67;
  transform: translateY(-2px);
}

/* --- Captcha & Info Blocks --- */
.captcha,
.info-display {
  background-color: #3a3240;
  padding: 15px;
  border-radius: 5px;
  border: 2px solid #545c7e;
  margin-bottom: 15px;
}

.captcha {
  font-size: 1.2rem;
  font-weight: bold;
  text-align: center;
}

.info-display {
  border-left: 4px solid #c56981;
}

.info-display strong {
  color: #c56981;
}

.date-inputs {
  display: flex;
  gap: 10px;
  align-items: center;
}

.date-inputs select {
  flex: 1;
}

.required {
  color: #c56981;
}

/* --- Footer --- */
footer {
  background-color: #545c7e;
  color: #a3a29a;
  text-align: center;
  padding: 1.5rem;
  margin-top: 4rem;
  border-top: 4px solid #c56981;
}

/* --- Game Canvas Style (Modified from 'Spirograph') --- */
#gameCanvas {
  /* Use a color from the new palette for the border */
  border: 3px solid #a3a29a;
  /* White background is crucial for visibility */
  background-color: #ffffff;
  margin-top: 10px;
  /* Add the pointer crosshair back */
  cursor: crosshair;
  /* Make the canvas responsive */
  max-width: 100%;
  height: auto;
}

#controls {
  margin-bottom: 15px;
}

.parameter-display {
  margin-top: 10px;
  font-size: 1.1em;
}

/* --- NEW STYLES FOR LIGHTBOX --- */
/* These styles create the "click to expand" effect */

.lightbox {
  /* Hidden by default */
  display: none;
  position: fixed;
  /* High z-index to be on top of everything */
  z-index: 9999;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2rem;
  /* Dark overlay using a color from your palette with transparency */
  background: rgba(40, 35, 40, 0.9);
  transition: opacity 0.3s ease-in-out;
  opacity: 0; /* Start transparent for fade-in */
}

/* This is the magic: when the lightbox link is the URL target, display it */
.lightbox:target {
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1; /* Fade in */
}

.lightbox span {
  /* This span holds the image as a background */
  display: block;
  width: 100%;
  height: 100%;
  background-position: center;
  background-repeat: no-repeat;
  /* Ensures the whole image is visible */
  background-size: contain;
}


/* ==========================================================================
   NEW STYLES FOR ADVISOR TOOL 
==========================================================================
*/

/* Override 'main' to allow more space for 3 columns */
main {
  max-width: 1200px;
  padding: 20px;
}

.advisor-container {
  display: grid;
  /* Creates 3 columns, or fewer on small screens */
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

/* Use the <section> tag but add this class */
.advisor-column {
  /* Use a dark color from your form palette */
  background-color: #3a3240;
  padding: 20px;
  border: 1px solid #c56981;
  border-radius: 8px;
  min-height: 400px;
  /* Override the :hover transform from the base CSS */
  transform: none;
}

.advisor-column h2 {
  color: #c56981; /* Use your accent color */
  border-bottom: 2px solid #545c7e; /* Use your border color */
  text-align: left; /* Override 'center' from base CSS */
}

.course-list {
  max-height: 500px;
  overflow-y: auto;
  text-align: left;
}

/* Style for the checkbox items */
.course-item {
  padding: 8px;
  margin-bottom: 5px;
  border-radius: 4px;
}

.course-item label {
  cursor: pointer;
  display: flex;
  align-items: center;
  font-weight: normal; /* Override '600' from base label */
}

.course-item input {
  margin-right: 10px;
  /* Style checkbox to be more visible on dark bg */
  width: 18px;
  height: 18px;
}

.course-item:hover {
  background-color: #545c7e; /* Use your background color */
}

.course-item input:disabled + label {
  color: #777;
  text-decoration: line-through;
  cursor: not-allowed;
}

/* Style for the clickable "Available Course" boxes */
.available-course {
  padding: 10px;
  background-color: #545c7e; /* Use your background color */
  border: 1px solid #c56981; /* Use your accent color */
  border-radius: 4px;
  margin-bottom: 8px;
  cursor: pointer;
  font-weight: 500;
  text-align: left;
  transition: background-color 0.2s, color 0.2s;
}

.available-course:hover {
  background-color: #c56981;
  color: #ffffff; /* Make text white on hover */
}

/* Styles for the Details column */
#course-details-content {
  padding-top: 10px;
  text-align: left;
}

#course-details-content h3 {
  color: #c56981;
  border-bottom: none;
  margin-bottom: 10px;
}

#course-details-content p {
  margin: 5px 0;
}

/* Style for the 'note' (Req 5), using your '.error' color */
#course-details-content .note {
  font-weight: bold;
  color: #ff6b6b; 
  margin-top: 10px;
  background-color: #282328;
  padding: 8px;
  border-radius: 4px;
  border-left: 3px solid #ff6b6b;
}

.advisor-column h4 {
  color: #a3a29a;
  border-bottom: 1px solid #545c7e;
  padding-bottom: 4px;
  margin-top: 15px;
  margin-bottom: 10px;
  text-align: left;
}

/* ===================================================================
   CMS Comparison Table Styles
   =================================================================== */

/* Table Container */
.table-container {
  overflow-x: auto;
  margin: 20px 0;
}

/* Main Table */
#cms-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #3a3240;
  border-radius: 8px;
  overflow: hidden;
}

/* Table Header */
#cms-table thead {
  background-color: #545c7e;
}

#cms-table th {
  padding: 15px;
  text-align: left;
  color: #a3a29a;
  font-weight: 600;
  border-bottom: 2px solid #c56981;
}

/* Table Data Cells */
#cms-table td {
  padding: 12px 15px;
  border-bottom: 1px solid #545c7e;
  color: #a3a29a;
  vertical-align: top;
}

/* Table Row Hover Effect */
#cms-table tbody tr {
  transition: background-color 0.3s ease;
}

#cms-table tbody tr:hover {
  background-color: #282328;
}

#cms-table tbody tr:last-child td {
  border-bottom: none;
}

/* CMS Name Styling */
.cms-name {
  font-weight: bold;
  color: #c56981;
  font-size: 1.1em;
}

/* Source Links */
.source-link {
  display: inline-block;
  margin-left: 5px;
  color: #c56981;
  font-size: 0.85em;
  text-decoration: none;
  padding: 2px 6px;
  border: 1px solid #c56981;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.source-link:hover {
  background-color: #c56981;
  color: #ffffff;
  text-decoration: none;
}

/* Loading Indicator */
.loading {
  text-align: center;
  padding: 40px;
  color: #a3a29a;
  font-size: 1.2em;
}

/* Error Message */
.error-message {
  background-color: #ff6b6b;
  color: white;
  padding: 15px;
  border-radius: 5px;
  margin: 20px 0;
  text-align: center;
}

/* Responsive Design for Smaller Screens */
@media (max-width: 768px) {
  #cms-table {
    font-size: 0.9em;
  }

  #cms-table th,
  #cms-table td {
    padding: 8px 10px;
  }
}