/* ============================================================
   ArtPartner Anti-Bullying Training Programme
   Shared Stylesheet — used across all pages
   ============================================================ */

/* ----- Custom Properties (Design Tokens) ----- */
:root {
  --color-primary:      #1a1a2e;
  --color-secondary:    #16213e;
  --color-accent:       #e94560;
  --color-accent-light: #ff6b81;
  --color-white:        #ffffff;
  --color-off-white:    #f8f9fa;
  --color-grey-100:     #f1f3f5;
  --color-grey-200:     #e9ecef;
  --color-grey-300:     #dee2e6;
  --color-grey-400:     #ced4da;
  --color-grey-600:     #868e96;
  --color-grey-800:     #343a40;
  --color-text:         #2c2c3e;
  --color-text-light:   #555566;
  --color-link:         #e94560;
  --color-legal-bg:     #eef2ff;
  --color-legal-border: #4361ee;
  --color-success:      #2ecc71;
  --color-error:        #e74c3c;

  --font-stack:         system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono:          'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;

  --line-height:        1.7;
  --max-width:          960px;
  --radius:             8px;
  --radius-sm:          4px;
  --shadow-sm:          0 1px 3px rgba(0,0,0,.08);
  --shadow-md:          0 4px 12px rgba(0,0,0,.1);
  --shadow-lg:          0 8px 30px rgba(0,0,0,.12);
  --transition:         .25s ease;
}


/* ----- Reset ----- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-stack);
  font-size: 16px;
  line-height: var(--line-height);
  color: var(--color-text);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-link);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover,
a:focus-visible {
  color: var(--color-accent-light);
  text-decoration: underline;
}

ul, ol {
  padding-left: 1.4em;
}


/* ----- Typography ----- */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-primary);
  line-height: 1.25;
  margin-bottom: .5em;
  font-weight: 700;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: .875rem; text-transform: uppercase; letter-spacing: .04em; }

p {
  margin-bottom: 1em;
}

strong { font-weight: 600; }

blockquote {
  border-left: 4px solid var(--color-accent);
  padding: .75em 1.25em;
  margin: 1.5em 0;
  background: var(--color-grey-100);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--color-text-light);
}

code {
  font-family: var(--font-mono);
  font-size: .9em;
  background: var(--color-grey-100);
  padding: .15em .35em;
  border-radius: var(--radius-sm);
}

hr {
  border: none;
  border-top: 1px solid var(--color-grey-300);
  margin: 2em 0;
}


/* ----- Layout ----- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 3rem 0;
}

.section + .section {
  border-top: 1px solid var(--color-grey-200);
}


/* ----- Page Header ----- */
.page-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: var(--color-white);
  padding: 3rem 0 2.5rem;
  text-align: center;
  position: relative;
}

.page-header h1 {
  color: var(--color-white);
  margin-bottom: .3em;
  font-size: 2rem;
}

.page-header .subtitle {
  color: var(--color-accent-light);
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: .02em;
}

.page-header .logo {
  margin: 0 auto 1.25rem;
}


/* ----- Page Footer ----- */
.page-footer {
  background: var(--color-primary);
  color: var(--color-grey-400);
  text-align: center;
  padding: 1.5rem 0;
  font-size: .85rem;
  margin-top: 3rem;
}

.page-footer a {
  color: var(--color-accent-light);
}


/* ----- Language Toggle Button ----- */
.lang-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  background: var(--color-accent);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius);
  padding: .45rem .9rem;
  font-size: .85rem;
  font-weight: 700;
  font-family: var(--font-stack);
  cursor: pointer;
  letter-spacing: .05em;
  box-shadow: var(--shadow-md);
  transition: background var(--transition), transform var(--transition);
}

.lang-toggle:hover,
.lang-toggle:focus-visible {
  background: var(--color-accent-light);
  transform: translateY(-1px);
}


/* ----- Cards ----- */
.card {
  background: var(--color-white);
  border: 1px solid var(--color-grey-200);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card h3 {
  margin-bottom: .6em;
}

.card p {
  color: var(--color-text-light);
  font-size: .95rem;
}

.card ul {
  list-style: none;
  padding: 0;
  margin-top: .75em;
}

.card ul li {
  padding: .35em 0;
}

.card ul li a {
  display: inline-flex;
  align-items: center;
  gap: .4em;
}

.card ul li a::before {
  content: '\2192';
  color: var(--color-accent);
  font-weight: 700;
}

.card-icon {
  font-size: 1.75rem;
  margin-bottom: .5em;
  display: block;
}


/* ----- Grid ----- */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}


/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  padding: .65rem 1.4rem;
  font-size: .95rem;
  font-weight: 600;
  font-family: var(--font-stack);
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
  text-decoration: none;
  line-height: 1.4;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-white);
  border-color: var(--color-accent);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--color-accent-light);
  border-color: var(--color-accent-light);
  color: var(--color-white);
}

.btn-secondary {
  background: transparent;
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: var(--color-accent);
  color: var(--color-white);
}


/* ----- Tables ----- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: .95rem;
}

thead th {
  background: var(--color-primary);
  color: var(--color-white);
  text-align: left;
  padding: .75rem 1rem;
  font-weight: 600;
}

tbody td {
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--color-grey-200);
  vertical-align: top;
}

tbody tr:hover {
  background: var(--color-grey-100);
}

tbody tr:last-child td {
  border-bottom: none;
}


/* ----- Legal Reference Box ----- */
.legal-ref {
  background: var(--color-legal-bg);
  border-left: 5px solid var(--color-legal-border);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.5rem 1.75rem;
  margin: 1.5em 0;
}

.legal-ref h3,
.legal-ref h4 {
  color: var(--color-legal-border);
  margin-bottom: .5em;
}

.legal-ref ul {
  list-style: disc;
  padding-left: 1.4em;
  margin: 0;
}

.legal-ref li {
  padding: .25em 0;
  font-size: .95rem;
}


/* ----- Scenario Cards ----- */
.scenario-card {
  background: var(--color-white);
  border: 1px solid var(--color-grey-200);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem 1.5rem 4.5rem;
  position: relative;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.scenario-card .scenario-number {
  position: absolute;
  left: 1rem;
  top: 1.35rem;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--color-accent);
  color: var(--color-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}


/* ----- Quiz Styles ----- */
.quiz-question {
  background: var(--color-grey-100);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.quiz-question h4 {
  margin-bottom: .75em;
}

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

.quiz-option {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--color-white);
  border: 2px solid var(--color-grey-300);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  margin-bottom: .5rem;
  cursor: pointer;
  font-size: .95rem;
  font-family: var(--font-stack);
  transition: border-color var(--transition), background var(--transition);
}

.quiz-option:hover {
  border-color: var(--color-accent);
  background: #fff5f6;
}

.quiz-option.selected {
  border-color: var(--color-accent);
  background: #fff0f2;
  font-weight: 600;
}

.quiz-option.correct {
  border-color: var(--color-success);
  background: #eafaf1;
}

.quiz-option.incorrect {
  border-color: var(--color-error);
  background: #fdedec;
}

.quiz-feedback {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin-top: .75rem;
  font-size: .95rem;
  line-height: 1.5;
}

.quiz-feedback.correct {
  background: #eafaf1;
  border: 1px solid var(--color-success);
  color: #1a7a42;
}

.quiz-feedback.incorrect {
  background: #fdedec;
  border: 1px solid var(--color-error);
  color: #922b21;
}


/* ----- Progress Bar ----- */
.progress-bar-container {
  width: 100%;
  background: var(--color-grey-200);
  border-radius: 50px;
  overflow: hidden;
  height: 12px;
  margin: 1rem 0;
}

.progress-bar {
  height: 100%;
  border-radius: 50px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
  transition: width .5s ease;
  min-width: 0;
}


/* ----- Navigation (breadcrumbs, back links) ----- */
.breadcrumb {
  font-size: .85rem;
  color: var(--color-grey-600);
  margin-bottom: 1rem;
}

.breadcrumb a {
  color: var(--color-grey-600);
}

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

.back-link {
  display: inline-flex;
  align-items: center;
  gap: .3em;
  font-size: .9rem;
  margin-bottom: 1.5rem;
}

.back-link::before {
  content: '\2190';
}


/* ----- Utilities ----- */
.text-center { text-align: center; }
.text-muted  { color: var(--color-text-light); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}


/* ----- Print Styles ----- */
@media print {
  .lang-toggle,
  .back-link,
  .breadcrumb {
    display: none !important;
  }

  body {
    font-size: 11pt;
    color: #000;
    background: #fff;
  }

  .page-header {
    background: none !important;
    color: #000 !important;
    padding: 1rem 0;
    border-bottom: 2px solid #000;
  }

  .page-header h1,
  .page-header .subtitle {
    color: #000 !important;
  }

  .page-footer {
    background: none !important;
    color: #666 !important;
    border-top: 1px solid #ccc;
    padding: .75rem 0;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  a[href]::after {
    content: ' (' attr(href) ')';
    font-size: .8em;
    color: #666;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }
}


/* ----- Responsive ----- */
@media (max-width: 768px) {
  h1 { font-size: 1.65rem; }
  h2 { font-size: 1.4rem; }
  h3 { font-size: 1.15rem; }

  .page-header {
    padding: 2rem 0 1.75rem;
  }

  .page-header h1 {
    font-size: 1.5rem;
  }

  .container {
    padding: 0 1rem;
  }

  .section {
    padding: 2rem 0;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .lang-toggle {
    top: .5rem;
    right: .5rem;
    padding: .35rem .7rem;
    font-size: .8rem;
  }

  .scenario-card {
    padding-left: 3.5rem;
  }

  .scenario-card .scenario-number {
    width: 2rem;
    height: 2rem;
    font-size: .9rem;
  }

  table {
    font-size: .85rem;
  }

  thead th,
  tbody td {
    padding: .5rem .6rem;
  }
}
