/* ----------------------------------------
   Root Colors (KFUPM Color Palette)
---------------------------------------- */

:root {
  /* Primary */
  --turquoise-100: #D0E6E8;
  --turquoise-300: #6BA5AD;
  --turquoise-500: #115F66;
  --turquoise-700: #0C4349;
  --turquoise-900: #06272A;

  --green-100: #CDEFE3;
  --green-300: #6BD0AF;
  --green-500: #009767;
  --green-700: #006246;
  --green-900: #003828;

  --beige-100: #F7F2E7;
  --beige-300: #EEE3CF;
  --beige-500: #ECE0C7;

  /* Secondary / feedback (for callouts etc.) */
  --yellow-100: #FDEECB;
  --yellow-300: #F7D27A;
  --yellow-500: #F0BA4F;
  --yellow-700: #A57528;
  --yellow-900: #5E4213;

  --warning-100: #FDF0D0;
  --warning-500: #F2C56C;

  --informative-100: #D7EFF8;
  --informative-500: #89C4DB;

  /* Neutral */
  --white: #FFFFFF;
  --gray-100: #E7E7E8;
  --gray-300: #C5C5C6;
  --gray-500: #ADACAD;
  --gray-700: #6B6B6C;
  --gray-900: #3D3D3E;
  --black: #000000;

  /* Interface */
  --bg: var(--beige-100);
  --surface: var(--white);
  --text: var(--turquoise-900);
  --text-muted: var(--gray-700);
  --accent: var(--green-500);
  --accent-soft: var(--green-100);
  --border: var(--gray-300);

  /* Layout */
  --sidebar-width: 300px;
}

/* ----------------------------------------
   Base Styles
---------------------------------------- */

html {
  scroll-behavior: smooth;
}

body {
  font-family: "KFUPM", sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}

h1,
h2,
h3,
h4,
h5 {
  color: var(--turquoise-700);
  font-weight: 700;
  margin-top: 0;
}

/* Typographic scale */
h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.75rem;
}

h3 {
  font-size: 1.5rem;   /* Section level: Purpose, Scope, Process Details... */
}

h4 {
  font-size: 1.25rem;  /* Subsection: Pools, subheadings inside sections */
}

h5 {
  font-size: 1.1rem;   /* Lanes, smaller subsections */
}

p {
  color: var(--text);
  font-size: 1rem;
  margin-top: 0;
}

a {
  text-decoration: none;
  color: var(--turquoise-500);
  font-weight: 700;
}

a:hover,
a:focus {
  color: var(--green-700);
}

a:focus-visible {
  outline: 2px solid var(--yellow-500);
  outline-offset: 2px;
}

/* ----------------------------------------
   Skip Link
---------------------------------------- */

.skip-link {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: -40px;
  background: var(--accent);
  color: var(--white);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  z-index: 1000;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 12px;
}

/* ----------------------------------------
   Sidebar Navigation
---------------------------------------- */

.sidebar {
  width: var(--sidebar-width);
  background: var(--turquoise-900);
  color: var(--white);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  padding: 1.5rem;
  overflow-y: auto;
  box-sizing: border-box;
}

.sidebar-header {
  text-align: center;
  margin-bottom: 2rem;
}

.sidebar .logo {
  width: 85%;
  height: auto;
  margin-bottom: 1rem;
}

.site-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}

.nav-links {
  list-style: none;
  padding: 0;
  margin-top: 2rem;
}

.nav-links li {
  margin: 0.7rem 0;
}

.nav-links a {
  color: var(--white);
  padding: 0.4rem 0.2rem;
  display: block;
  border-radius: 4px;
}

.nav-links a:hover,
.nav-links a:focus {
  background: var(--turquoise-700);
}

/* Active nav item (JS adds .active) */
.nav-links a.active {
  background: var(--turquoise-700);
}

/* ----------------------------------------
   Back Button Styling
---------------------------------------- */

.back-button {
  display: inline-block;
  margin-bottom: 1.5rem;
  padding: 0.55rem 1rem;
  background: var(--turquoise-700);
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.1s ease;
}

.back-button:hover {
  background: var(--turquoise-500);
}

.back-button:focus {
  outline: 2px solid var(--yellow-500);
  outline-offset: 3px;
}

.back-button:active {
  transform: scale(0.98);
}


/* ----------------------------------------
   Main Content
---------------------------------------- */

.content {
  margin-left: var(--sidebar-width);
  padding: 2.5rem 3rem;
  width: auto;
  box-sizing: border-box;
  min-height: 100vh;
}

.content-inner {
  max-width: 960px;
  margin: 0 auto;
}

.page-header {
  margin-bottom: 2.5rem;
}

.subtitle {
  color: var(--text-muted);
}

/* Sections and headings */

section {
  margin-bottom: 2.5rem;
}

section h3 {
  margin-bottom: 0.75rem;
}

section h4 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

/* Cards */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1rem 1.3rem;
  margin: 1rem 0;
  border-radius: 8px;
}

/* ===========================
   POOLS & LANES (BPMN Style)
=========================== */

.pool {
  padding: 1.5rem;
  margin: 2.5rem 0;
  background: var(--beige-100);
  border: 2px solid var(--turquoise-300);
  border-radius: 10px;
}

.pool-title {
  margin-top: 0;
  margin-bottom: 1rem;
  /* inherits font-size from h4 (1.25rem) */
}

.pool-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.lane {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 1rem 1.2rem;
  margin: 1rem 0;
  border-radius: 8px;
}

.lane-title {
  margin-top: 0;
  margin-bottom: 0.5rem;
  /* inherits font-size from h5 (1.1rem) */
}

/* ----------------------------------------
   Callouts
---------------------------------------- */

.callout {
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
}

.callout h4 {
  margin-top: 0;
  margin-bottom: 0.35rem;
}

/* Informational callout */
.callout-info {
  background: var(--informative-100);
  border-color: var(--informative-500);
}

/* Warning callout */
.callout-warning {
  background: var(--warning-100);
  border-color: var(--warning-500);
}

/* ----------------------------------------
   BPMN Model Frame
---------------------------------------- */

.model-frame {
  border: 2px solid var(--turquoise-300);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}
/* Footer under the viewer */
.model-frame-footer {
  border-top: 1px solid var(--border);
  padding: 0.75rem 1rem 0.85rem;
  background: var(--beige-100);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.model-frame-footer-title,
.model-frame-footer-subtitle {
  margin: 0;
}

.model-frame-footer-title {
  margin-bottom: 0.25rem;
}

.model-frame-footer a {
  font-weight: 700;
  color: var(--turquoise-500);
}

.model-frame-footer a:hover,
.model-frame-footer a:focus {
  color: var(--green-700);
}

/* ----------------------------------------
   Footer
---------------------------------------- */

.site-footer {
  margin-left: var(--sidebar-width);
  padding: 1rem 3rem 2rem;
  background: var(--beige-300);
  box-sizing: border-box;
}

.site-footer .content-inner {
  max-width: 960px;
  margin: 0 auto;
}

.footer-text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ----------------------------------------
   Responsive Design
---------------------------------------- */

@media (max-width: 900px) {
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
  }

  .content {
    margin-left: 0;
    padding: 1.5rem 1.25rem;
    width: 100%;
  }

  .site-footer {
    margin-left: 0;
    padding: 1rem 1.25rem 2rem;
  }
}



/* ========================================
   HOME PAGE LAYOUT (NO SIDEBAR)
   Applies when <body class="home">
======================================== */

body.home {
  background: var(--bg);
}

/* Shell: header + main + footer stacked */
.home-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top header bar */
.home-header {
  background: var(--turquoise-900);
  color: var(--white);
  padding: 1rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  align-items: flex-end;
}

.home-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.home-logo {
  height: 40px;
  width: auto;
}

.home-brand-text {
  display: flex;
  flex-direction: column;
}

.brand-overline {
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.8;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--beige-100);
  opacity: 0.88;
  white-space: nowrap;
  position: relative;
  top: 1px;
  border-left: 1px solid rgba(255,255,255,0.2);
  padding-left: 1rem;
  /*margin-left: 1.5rem;*/
}

/* Version pill on the right */
.pill {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--turquoise-700);
  color: var(--white);
  font-size: 0.8rem;
}

/* Main area on home page */
.home-main {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 3rem 2rem;
  box-sizing: border-box;
}

/* Hero section */
.hero {
  margin-bottom: 2.5rem;
}

.hero-subtitle {
  color: var(--text-muted);
  max-width: 720px;
}

/* Search */
.hero-actions {
  margin-top: 1.5rem;
  max-width: 420px;
  
}

.form-label,
.search-label,
.filter-label {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 0.35rem;
  font-weight: 500;
}

.search-wrapper {
  max-width: 100%;
}

.search-input {
  width: 100%;
  padding: 0.55rem 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
  font-family: inherit;
  box-sizing: border-box;
  color: var(--text);
}

.search-input:focus {
  outline: 2px solid var(--yellow-500);
  outline-offset: 2px;
}

/* Process list */
.process-list {
  margin-bottom: 2rem;
}

.section-title {
  margin-bottom: 1.25rem;
}

/* Grid of process cards */
.process-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* Individual process card */
.process-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.3rem 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.process-name {
  margin: 0;
}

.process-summary {
  margin: 0;
  color: var(--text-muted);
}

/* Tags & status */
.process-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
}

.process-tag {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  background: var(--beige-300);
  color: var(--turquoise-900);
}

.status-tag {
  background: var(--accent-soft);
  color: var(--green-900);
}

/* Link in card */
.process-link {
  margin-top: 0.25rem;
  font-size: 0.95rem;
}

/* No-results message */
.no-results {
  margin-top: 1.5rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Home footer */
.home-footer {
  padding: 1rem 3rem 1.5rem;
  background: var(--beige-300);
  box-sizing: border-box;
}

.home-footer .footer-text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Responsive tweaks for home */
@media (max-width: 900px) {
  .home-header {
    padding: 1rem 1.5rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .home-main {
    padding: 1.5rem 1.5rem 1.5rem;
  }

  .home-footer {
    padding: 1rem 1.5rem 1.5rem;
  }
}


/* Filter controls under search */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
  width: 100%;
  /* match hero-actions width */
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1 1 0;
  /* each takes half of the row */
  min-width: 0;
}

.filter-select {
  width: 100%;
  /* fill its group */
  min-width: 0;
  padding: 0.55rem 2rem 0.55rem 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236BA5AD' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px 8px;
  box-sizing: border-box;
}

.filter-select:hover {
  border-color: var(--gray-500);
}

.filter-select:focus {
  outline: 2px solid var(--yellow-500);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .filter-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-select {
    width: 100%;
  }
}



/* ----------------------------------------
   Back to Top Button
---------------------------------------- */

.top-button {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.55rem 1rem;
  background: var(--turquoise-700);
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.1s ease;
}

.top-button:hover {
  background: var(--turquoise-500);
}

.top-button:focus {
  outline: 2px solid var(--yellow-500);
  outline-offset: 3px;
}

.top-button:active {
  transform: scale(0.98);
}
