/* CCP5 Summer School 2027 - Modern Theme & Bootstrap Enhancements */

:root {
  --theme-primary: #0284c7;
  --theme-primary-rgb: 2, 132, 199;
  --theme-primary-dark: #0369a1;
  --theme-primary-light: #e0f2fe;
  --theme-accent: #38bdf8;
  --theme-gradient: linear-gradient(135deg, #0f172a 0%, #0369a1 50%, #0284c7 100%);
  --theme-hero-bg: linear-gradient(rgba(15, 23, 42, 0.82), rgba(15, 23, 42, 0.88)), url('../../../pics/back.png');
  --theme-card-bg: #ffffff;
  --theme-card-inner-bg: #f8fafc;
  --theme-subtle-bg: #f8fafc;
  --theme-card-border: #e2e8f0;
  --theme-card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --theme-card-hover-shadow: 0 12px 20px -3px rgba(0, 0, 0, 0.12), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
  --theme-text-muted: #64748b;
  --theme-badge-bg: #e0f2fe;
  --theme-badge-color: #0369a1;
  --theme-radius: 12px;

  /* Bootstrap Variable Mappings */
  --bs-primary: var(--theme-primary) !important;
  --bs-primary-rgb: var(--theme-primary-rgb) !important;
  --bs-link-color: var(--theme-primary) !important;
  --bs-link-hover-color: var(--theme-primary-dark) !important;
}

[data-color-theme="emerald"] {
  --theme-primary: #059669;
  --theme-primary-rgb: 5, 150, 105;
  --theme-primary-dark: #047857;
  --theme-primary-light: #d1fae5;
  --theme-accent: #34d399;
  --theme-badge-bg: #d1fae5;
  --theme-badge-color: #047857;
  --theme-gradient: linear-gradient(135deg, #064e3b 0%, #059669 50%, #10b981 100%);
}

[data-color-theme="amethyst"] {
  --theme-primary: #7c3aed;
  --theme-primary-rgb: 124, 58, 237;
  --theme-primary-dark: #6d28d9;
  --theme-primary-light: #ede9fe;
  --theme-accent: #a78bfa;
  --theme-badge-bg: #ede9fe;
  --theme-badge-color: #6d28d9;
  --theme-gradient: linear-gradient(135deg, #3b0764 0%, #7c3aed 50%, #8b5cf6 100%);
}

[data-color-theme="terracotta"] {
  --theme-primary: #ea580c;
  --theme-primary-rgb: 234, 88, 12;
  --theme-primary-dark: #c2410c;
  --theme-primary-light: #ffedd5;
  --theme-accent: #fb923c;
  --theme-badge-bg: #ffedd5;
  --theme-badge-color: #c2410c;
  --theme-gradient: linear-gradient(135deg, #431407 0%, #ea580c 50%, #f97316 100%);
}

[data-color-theme="crimson"] {
  --theme-primary: #e11d48;
  --theme-primary-rgb: 225, 29, 72;
  --theme-primary-dark: #be123c;
  --theme-primary-light: #ffe4e6;
  --theme-accent: #fb7185;
  --theme-badge-bg: #ffe4e6;
  --theme-badge-color: #be123c;
  --theme-gradient: linear-gradient(135deg, #4c0519 0%, #e11d48 50%, #f43f5e 100%);
}

[data-color-theme="slate"] {
  --theme-primary: #475569;
  --theme-primary-rgb: 71, 85, 105;
  --theme-primary-dark: #334155;
  --theme-primary-light: #f1f5f9;
  --theme-accent: #94a3b8;
  --theme-badge-bg: #f1f5f9;
  --theme-badge-color: #334155;
  --theme-gradient: linear-gradient(135deg, #0f172a 0%, #334155 50%, #475569 100%);
}

/* Dark mode adjustments */
[data-bs-theme="dark"],
[data-md-color-scheme="slate"] {
  --theme-card-bg: #1e293b;
  --theme-card-inner-bg: #0f172a;
  --theme-subtle-bg: #0f172a;
  --theme-card-border: #334155;
  --theme-text-muted: #94a3b8;
  --theme-badge-bg: rgba(var(--theme-primary-rgb), 0.25);
  --theme-badge-color: var(--theme-accent);
  --theme-card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --theme-card-hover-shadow: 0 12px 20px -3px rgba(0, 0, 0, 0.6);
}

/* Synchronize with MkDocs Material */
.md-header {
  background: var(--theme-gradient) !important;
}
@media screen and (min-width: 60em) {
  .md-header__inner {
    padding-right: 7.5rem !important;
  }
}

/* =========================================================
   Modern Navigation - Coloured Pills
   ========================================================= */

.md-tabs {
  background: var(--theme-gradient) !important;
  padding: 0.65rem 0 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.md-tabs__list {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0.65rem !important;
  align-items: center !important;
  justify-content: flex-start !important;
  margin: 0 !important;
  padding: 0 0.5rem !important;
  list-style: none !important;
}

.md-tabs__item {
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
}

.md-tabs__link {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.4rem !important;
  padding: 0.45rem 1.15rem !important;
  border-radius: 50px !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  color: #ffffff !important;
  background: rgba(var(--pill-rgb, 255, 255, 255), 0.22) !important;
  border: 1px solid rgba(var(--pill-rgb, 255, 255, 255), 0.45) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
  text-decoration: none !important;
  line-height: 1.4 !important;
  margin: 0 !important;
  opacity: 0.95 !important;
}

.md-tabs__link:hover {
  background: rgba(var(--pill-rgb, 255, 255, 255), 0.42) !important;
  border-color: rgba(255, 255, 255, 0.85) !important;
  color: #ffffff !important;
  transform: translateY(-2px) scale(1.03) !important;
  box-shadow: 0 4px 14px rgba(var(--pill-rgb, 0, 0, 0), 0.4) !important;
  opacity: 1 !important;
}

.md-tabs__item--active .md-tabs__link {
  background: var(--pill-color, #ffffff) !important;
  color: #ffffff !important;
  border-color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 16px rgba(var(--pill-rgb, 0, 0, 0), 0.5), 0 0 0 2px #ffffff !important;
  transform: translateY(-1px) !important;
  opacity: 1 !important;
}

/* Distinct Menu Pill Colors */
/* 1. Home - Azure Blue */
.md-tabs__item:nth-child(1) .md-tabs__link {
  --pill-color: #0284c7;
  --pill-rgb: 2, 132, 199;
}

/* 2. Registration - Warm Amber */
.md-tabs__item:nth-child(2) .md-tabs__link {
  --pill-color: #d97706;
  --pill-rgb: 217, 119, 6;
}

/* 3. Lectures - Royal Purple */
.md-tabs__item:nth-child(3) .md-tabs__link {
  --pill-color: #7c3aed;
  --pill-rgb: 124, 58, 237;
}

/* 4. Timetable - Ocean Teal */
.md-tabs__item:nth-child(4) .md-tabs__link {
  --pill-color: #0d9488;
  --pill-rgb: 13, 148, 136;
}

/* 5. Speakers - Emerald Green */
.md-tabs__item:nth-child(5) .md-tabs__link {
  --pill-color: #059669;
  --pill-rgb: 5, 150, 105;
}

/* 6. Campus - Crimson Rose */
.md-tabs__item:nth-child(6) .md-tabs__link {
  --pill-color: #e11d48;
  --pill-rgb: 225, 29, 72;
}

/* 7. Students - Violet Magenta */
.md-tabs__item:nth-child(7) .md-tabs__link {
  --pill-color: #9333ea;
  --pill-rgb: 147, 51, 234;
}

/* 8. Contact - Indigo Slate */
.md-tabs__item:nth-child(8) .md-tabs__link {
  --pill-color: #4f46e5;
  --pill-rgb: 79, 70, 229;
}

.md-button--primary {
  background-color: var(--theme-primary) !important;
  border-color: var(--theme-primary) !important;
}
.md-typeset a {
  color: var(--theme-primary);
}
.md-typeset a:hover {
  color: var(--theme-primary-dark);
}

/* MkDocs Admonitions & Details Theme Synchronization */
.md-typeset .admonition,
.md-typeset details {
  background-color: var(--theme-card-bg) !important;
  border-color: var(--theme-primary) !important;
  border-radius: var(--theme-radius);
  box-shadow: var(--theme-card-shadow);
  color: inherit !important;
}
.md-typeset .admonition-title,
.md-typeset summary {
  background-color: var(--theme-badge-bg) !important;
  color: var(--theme-badge-color) !important;
  border-top-left-radius: var(--theme-radius);
  border-top-right-radius: var(--theme-radius);
}

/* =========================================================
   Bootstrap Component Theme Overrides
   ========================================================= */

/* All Bootstrap cards follow the theme */
.card,
.ccp5-card {
  background-color: var(--theme-card-bg) !important;
  border: 1px solid var(--theme-card-border) !important;
  border-radius: var(--theme-radius) !important;
  color: inherit !important;
  box-shadow: var(--theme-card-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.ccp5-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--theme-card-hover-shadow);
  border-color: var(--theme-primary) !important;
}

.ccp5-card-inner {
  background-color: var(--theme-card-inner-bg) !important;
  border: 1px solid var(--theme-card-border);
  color: inherit !important;
}

/* Background utility classes */
.bg-light {
  background-color: var(--theme-subtle-bg) !important;
  color: inherit !important;
}
.bg-white {
  background-color: var(--theme-card-bg) !important;
  color: inherit !important;
}

/* Buttons */
.btn-primary,
.ccp5-btn-primary {
  background-color: var(--theme-primary) !important;
  border-color: var(--theme-primary) !important;
  color: #ffffff !important;
}
.btn-primary:hover,
.btn-primary:focus,
.ccp5-btn-primary:hover {
  background-color: var(--theme-primary-dark) !important;
  border-color: var(--theme-primary-dark) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-outline-primary {
  color: var(--theme-primary) !important;
  border-color: var(--theme-primary) !important;
}
.btn-outline-primary:hover {
  background-color: var(--theme-primary) !important;
  border-color: var(--theme-primary) !important;
  color: #ffffff !important;
}

/* Text and Badges */
.text-primary {
  color: var(--theme-primary) !important;
}
.border-primary {
  border-color: var(--theme-primary) !important;
}

.badge.bg-primary {
  background-color: var(--theme-primary) !important;
  color: #ffffff !important;
}

/* Alerts / Callout Boxes */
.alert,
.ccp5-alert {
  background-color: var(--theme-card-bg) !important;
  border: 1px solid var(--theme-card-border) !important;
  border-radius: var(--theme-radius) !important;
  color: inherit !important;
  box-shadow: var(--theme-card-shadow);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.alert-warning {
  border-left: 5px solid #f59e0b !important;
}
.alert-info,
.ccp5-alert {
  border-left: 5px solid var(--theme-primary) !important;
}
.alert-success {
  border-left: 5px solid #10b981 !important;
}

.ccp5-alert-icon {
  font-size: 1.4rem;
  line-height: 1;
}
.ccp5-alert-content {
  flex: 1;
}

/* =========================================================
   Layout & Modern Components
   ========================================================= */

.ccp5-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.ccp5-hero {
  position: relative;
  background-image: var(--theme-hero-bg);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  color: #ffffff;
  padding: 5rem 1.5rem 4.5rem;
  border-radius: var(--theme-radius);
  margin-bottom: 2.5rem;
  overflow: hidden;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25);
  text-align: center;
}

.ccp5-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  padding: 0.4rem 1.1rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.ccp5-hero-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 0.75rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.ccp5-hero-subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 500;
  color: #e2e8f0;
  margin-bottom: 1.75rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.ccp5-hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: center;
}

.ccp5-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.6rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none !important;
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

.ccp5-btn-outline {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(4px);
}
.ccp5-btn-outline:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: #ffffff;
  transform: translateY(-2px);
}

/* =========================================================
   Grid & Card Styles
   ========================================================= */

.ccp5-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.ccp5-grid-speakers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.75rem;
  margin-bottom: 2.5rem;
}

.ccp5-speaker-card {
  text-align: center;
  align-items: center;
  padding: 1.75rem 1.5rem;
}

.ccp5-speaker-avatar-wrap {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  margin-bottom: 1.25rem;
  overflow: hidden;
  border: 4px solid var(--theme-primary-light);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  background: var(--theme-card-inner-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ccp5-speaker-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.ccp5-speaker-card:hover .ccp5-speaker-avatar {
  transform: scale(1.05);
}

.ccp5-speaker-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: inherit;
}

.ccp5-speaker-affil {
  font-size: 0.92rem;
  color: var(--theme-text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.ccp5-badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 50px;
  background-color: var(--theme-badge-bg) !important;
  color: var(--theme-badge-color) !important;
  margin-top: auto;
}

/* =========================================================
   Timetable Timeline & Tables
   ========================================================= */

.ccp5-timetable-day {
  background: var(--theme-card-bg);
  border: 1px solid var(--theme-card-border);
  border-radius: var(--theme-radius);
  margin-bottom: 1.5rem;
  overflow: hidden;
  box-shadow: var(--theme-card-shadow);
}

.ccp5-timetable-day-header {
  background: var(--theme-gradient);
  color: #ffffff;
  padding: 0.85rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.ccp5-timeline-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 !important;
}

.ccp5-timeline-table th {
  background: var(--theme-card-inner-bg);
  color: var(--theme-text-muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--theme-card-border);
}

.ccp5-timeline-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--theme-card-border);
  font-size: 0.92rem;
  vertical-align: middle;
}

.ccp5-timeline-table tr:last-child td {
  border-bottom: none;
}

.ccp5-timeline-table tr:hover td {
  background: rgba(var(--theme-primary-rgb), 0.04);
}

.ccp5-time-badge {
  display: inline-block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--theme-primary);
  white-space: nowrap;
}

.ccp5-loc-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--theme-card-inner-bg);
  color: var(--theme-text-muted);
  border: 1px solid var(--theme-card-border);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.82rem;
}

/* =========================================================
   Sponsors & Committee
   ========================================================= */

.ccp5-sponsor-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--theme-card-bg);
  border: 1px solid var(--theme-card-border);
  border-radius: var(--theme-radius);
  margin-bottom: 2rem;
}

.ccp5-sponsor-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 72px;
  min-height: 72px;
  padding: 10px 22px;
  border-radius: 10px;
  background: #ffffff !important;
  border: 1px solid var(--theme-card-border);
  box-shadow: var(--theme-card-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ccp5-sponsor-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--theme-card-hover-shadow);
  border-color: var(--theme-primary) !important;
}

.ccp5-sponsor-img {
  height: 50px !important;
  max-height: 50px !important;
  min-height: 50px !important;
  width: auto !important;
  max-width: 180px !important;
  object-fit: contain !important;
  display: block;
}

/* =========================================================
   Top Theme Selector Widget
   ========================================================= */

.ccp5-theme-widget-wrap {
  position: fixed;
  top: 0.65rem;
  right: 1rem;
  z-index: 10000;
  font-family: system-ui, -apple-system, sans-serif;
}

.ccp5-theme-widget-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #ffffff;
  padding: 0.38rem 0.9rem;
  border-radius: 50px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.ccp5-theme-widget-btn:hover {
  background: rgba(255, 255, 255, 0.38);
  border-color: rgba(255, 255, 255, 0.8);
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
}

.ccp5-theme-panel {
  position: absolute;
  top: calc(100% + 10px);
  bottom: auto;
  right: 0;
  width: 320px;
  background: var(--theme-card-bg);
  border: 1px solid var(--theme-card-border);
  border-radius: 16px;
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.3);
  padding: 1.25rem;
  transform-origin: top right;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.ccp5-theme-panel.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95);
  display: none;
}

.ccp5-theme-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--theme-card-border);
}

.ccp5-theme-panel-close {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--theme-text-muted);
  line-height: 1;
}

.ccp5-theme-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--theme-text-muted);
  margin-bottom: 0.6rem;
}

.ccp5-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.ccp5-mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.25rem;
  background: var(--theme-card-inner-bg);
  border: 1px solid var(--theme-card-border);
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ccp5-mode-btn:hover {
  border-color: var(--theme-primary);
}

.ccp5-mode-btn.active {
  background: var(--theme-primary);
  color: #ffffff;
  border-color: var(--theme-primary);
}

.ccp5-palette-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.ccp5-palette-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  background: var(--theme-card-inner-bg);
  border: 1px solid var(--theme-card-border);
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.ccp5-palette-btn:hover {
  border-color: var(--theme-primary);
  transform: translateY(-1px);
}

.ccp5-palette-btn.active {
  border-color: var(--theme-primary);
  box-shadow: 0 0 0 2px var(--theme-primary-light);
  background: var(--theme-badge-bg);
  color: var(--theme-badge-color);
}

.ccp5-palette-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
