/*
 * styles.css
 *
 * This stylesheet defines the look and feel of the educational platform.
 * The design is inspired by the recommendations from the cahier des charges.
 * It features two palettes (dark and light) through CSS variables. By default
 * the dark palette is used, but the colours are defined in variables so a
 * future toggle can easily switch to a light theme. The layout is responsive
 * and mobile‑first, with the navigation collapsing into a hamburger menu on
 * smaller screens. Utility classes are provided for the mindmap interactions
 * such as panning and zooming.
 */

:root {
  /* Dark theme colours */
  --color-bg: #0a1d37;
  --color-surface: #11284d;
  --color-primary-economy: #2fa36e;
  --color-primary-ia: #0077ff;
  --color-primary-influence: #6c2a8a;
  --color-primary-esprit: #ff8c42;
  --color-secondary: #1e3a70;
  --color-text: #f7f8fa;
  --color-text-secondary: #a8bed0;
  --color-accent: #ffda79;
  --color-border: rgba(255, 255, 255, 0.1);
  --color-success: #00c49a;
  --color-warning: #e58b17;
}

/* Basic resets */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  font-size: 16px;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Navigation bar */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

nav .logo {
  font-weight: bold;
  font-size: 1.2rem;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

nav ul li a {
  position: relative;
  padding-bottom: 0.2rem;
  transition: color 0.2s;
}

nav ul li a:hover {
  color: var(--color-accent);
}

/* Hero section */
header.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-bg) 100%);
  text-align: center;
  padding: 2rem;
}

header.hero .hero-content {
  max-width: 800px;
}

header.hero h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

header.hero p {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  color: var(--color-text-secondary);
}

.btn {
  background-color: var(--color-primary-ia);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: 600;
  transition: background-color 0.2s;
}

.btn:hover {
  background-color: var(--color-primary-influence);
}

/* Pillars section */
.pillars {
  padding: 4rem 2rem;
}

.pillars h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.8rem;
}

.pillar-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.pillar-card {
  background-color: var(--color-surface);
  padding: 1.5rem;
  border-radius: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: default;
  border: 1px solid var(--color-border);
}

.pillar-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.pillar-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.pillar-card p {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

/* Step section */
.how-it-works {
  padding: 4rem 2rem;
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.how-it-works h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.8rem;
}

.steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
}

.step {
  flex: 1 1 200px;
  max-width: 280px;
  text-align: center;
}

.step-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem auto;
  border-radius: 50%;
  background-color: var(--color-primary-influence);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: bold;
}

.step h3 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.step p {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

/* Footer */
footer {
  padding: 2rem;
  text-align: center;
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  margin-top: 4rem;
}

footer ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
}

footer a {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

footer a:hover {
  color: var(--color-accent);
}

/* Discover page */
main.discover {
  padding: 2rem;
}

main.discover h1 {
  margin-bottom: 1rem;
  font-size: 1.8rem;
}

main.discover .filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

main.discover input[type="text"],
main.discover select {
  padding: 0.5rem 1rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  color: var(--color-text);
}

main.discover input[type="text"]::placeholder {
  color: var(--color-text-secondary);
}

main.discover .content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.content-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.content-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.content-card .card-image {
  background-color: var(--color-secondary);
  height: 120px;
}

.content-card .card-body {
  padding: 1rem;
  flex: 1;
}

.content-card .card-title {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.content-card .card-description {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
}

.content-card .card-info {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

/* Courses (mindmap) page */
main.courses {
  padding: 2rem;
}

main.courses .courses-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
}

main.courses h1 {
  font-size: 1.6rem;
}

.course-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.4rem 0.8rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background-color: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  font-size: 0.85rem;
  transition: background-color 0.2s;
}

.filter-btn:hover {
  background-color: var(--color-primary-ia);
}

.filter-btn.active {
  background-color: var(--color-primary-influence);
}

/* Mindmap wrapper */
.mindmap-wrapper {
  position: relative;
  border: 1px solid var(--color-border);
  background-color: var(--color-surface);
  min-height: 70vh;
  overflow: hidden;
  border-radius: 8px;
  margin-top: 1rem;
}

#mindmap-container {
  width: 2000px;
  height: 2000px;
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
}

/* Node styles */
.mindmap-node {
  position: absolute;
  width: 160px;
  padding: 0.5rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.mindmap-node:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.mindmap-node h4 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.mindmap-node .tags {
  font-size: 0.7rem;
  color: var(--color-text-secondary);
}

.mindmap-node .status {
  margin-top: 0.3rem;
  font-size: 0.7rem;
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status.not-started {
  background-color: var(--color-border);
  color: var(--color-text-secondary);
}

.status.in-progress {
  background-color: var(--color-warning);
  color: #fff;
}

.status.completed {
  background-color: var(--color-success);
  color: #fff;
}

/* Node details panel */
#node-details {
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  height: 100%;
  background-color: var(--color-surface);
  border-left: 1px solid var(--color-border);
  padding: 1rem;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.4);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 2;
}

#node-details.visible {
  transform: translateX(0);
}

#node-details #close-details {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}

#node-details h2 {
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

#node-details p {
  margin-bottom: 0.8rem;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

#node-details .tags {
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

#node-details .progress-bar {
  width: 100%;
  height: 8px;
  background-color: var(--color-border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1rem;
}

#node-details .progress-bar .progress {
  height: 100%;
  width: 0%;
  background-color: var(--color-primary-ia);
  transition: width 0.3s;
}

#start-course {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: var(--color-primary-ia);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  margin-top: 1rem;
}

#start-course:hover {
  background-color: var(--color-primary-influence);
}

/* Contact page */
main.contact {
  padding: 2rem;
  max-width: 600px;
  margin: 0 auto;
}

main.contact h1 {
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
}

main.contact form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

main.contact input,
main.contact textarea {
  padding: 0.6rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background-color: var(--color-surface);
  color: var(--color-text);
}

main.contact textarea {
  resize: vertical;
  min-height: 120px;
}

main.contact button {
  align-self: flex-start;
  padding: 0.5rem 1.2rem;
  background-color: var(--color-primary-ia);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
}

main.contact button:hover {
  background-color: var(--color-primary-influence);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  nav ul {
    flex-direction: column;
    gap: 0.5rem;
  }
  nav {
    flex-wrap: wrap;
  }
  header.hero h1 {
    font-size: 1.6rem;
  }
  .pillar-card {
    padding: 1rem;
  }
  .steps {
    flex-direction: column;
    align-items: center;
  }
  .mindmap-wrapper {
    min-height: 60vh;
  }
  #node-details {
    width: 80%;
  }
}