﻿/* ==========================================================================
   CROQUET AUSTRALIA - ACADEMY TUTORIAL & COURSE PLAYER DESIGN SYSTEM
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Brand Palette */
  --ca-green-primary: #006A4E;
  --ca-green-dark: #004d38;
  --ca-green-deep: #003627;
  --ca-green-light: #008765;
  --ca-green-surface: #f0fdf4;
  --ca-green-border: rgba(0, 106, 78, 0.2);

  --ca-gold-accent: #E8A821;
  --ca-gold-light: #fef3c7;
  --ca-gold-dark: #c78a10;
  --ca-gold-glow: rgba(232, 168, 33, 0.35);

  /* Neutrals & Dark Theme Accents */
  --bg-slate-dark: #0d171e;
  --bg-slate-panel: #16222f;
  --bg-slate-card: #1e2e3e;
  --bg-slate-hover: #26384d;
  --text-slate-light: #f8fafc;
  --text-slate-muted: #94a3b8;
  --text-slate-dim: #64748b;
  --border-dark: #334155;

  /* Light Canvas & Cards */
  --bg-canvas: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #475569;
  --border-light: #e2e8f0;

  /* Dimensions & Shadows */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.15);
  --shadow-glow: 0 0 20px var(--ca-gold-glow);

  --transition-fast: 0.18s ease;
  --transition-normal: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  min-height: 100vh;
  font-family: 'Outfit', Bicyclette, "Bicyclette", Bierstadt, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-slate-dark);
  color: var(--text-slate-light);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ==========================================================================
   APP HEADER & BANNER
   ========================================================================== */
.app-header {
  background: linear-gradient(135deg, var(--ca-green-deep) 0%, var(--ca-green-primary) 60%, var(--ca-green-dark) 100%);
  border-bottom: 3px solid var(--ca-gold-accent);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: white;
}

.brand-logo-img {
  height: 48px;
  width: auto;
  object-fit: contain;
  background: white;
  border-radius: 8px;
  padding: 4px 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-title .gold-tag {
  color: var(--ca-gold-accent);
  font-weight: 700;
  font-size: 0.85rem;
  background: rgba(232, 168, 33, 0.2);
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--ca-gold-accent);
}

.brand-subtitle {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 400;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Base Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-gold {
  background: linear-gradient(135deg, var(--ca-gold-accent) 0%, #d89710 100%);
  color: #0f172a;
  border-color: #f3b938;
  box-shadow: 0 2px 10px rgba(232, 168, 33, 0.3);
}

.btn-gold:hover {
  background: linear-gradient(135deg, #f3b938 0%, var(--ca-gold-accent) 100%);
  box-shadow: 0 4px 14px rgba(232, 168, 33, 0.5);
  color: #000;
}

.btn-green {
  background: var(--ca-green-primary);
  color: white;
  border-color: var(--ca-green-light);
}

.btn-green:hover {
  background: var(--ca-green-light);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-color: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(4px);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: white;
}

.btn-editor-toggle {
  background: rgba(15, 23, 42, 0.6);
  color: var(--ca-gold-accent);
  border: 1px solid rgba(232, 168, 33, 0.4);
}

.btn-editor-toggle:hover {
  background: var(--ca-gold-accent);
  color: #0f172a;
}

.btn-editor-toggle.active {
  background: var(--ca-gold-accent);
  color: #0f172a;
  box-shadow: 0 0 12px var(--ca-gold-glow);
}

/* ==========================================================================
   PROGRESS & DISCIPLINE BAR
   ========================================================================== */
.sub-nav-bar {
  background: var(--bg-slate-panel);
  border-bottom: 1px solid var(--border-dark);
  padding: 10px 24px;
}

.sub-nav-inner {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.progress-section {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 280px;
  max-width: 600px;
}

.progress-label {
  font-size: 0.85rem;
  color: var(--text-slate-muted);
  font-weight: 500;
  white-space: nowrap;
}

.progress-track {
  flex: 1;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-fill {
  height: 100%;
  width: 3.33%;
  background: linear-gradient(90deg, var(--ca-green-light) 0%, var(--ca-gold-accent) 100%);
  border-radius: 20px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(232, 168, 33, 0.4);
}

.progress-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ca-gold-accent);
  white-space: nowrap;
}

.view-mode-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-slate-card);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-dark);
}

.mode-btn {
  background: transparent;
  border: none;
  color: var(--text-slate-muted);
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.mode-btn:hover {
  color: white;
}

.mode-btn.active {
  background: var(--ca-green-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 106, 78, 0.4);
}

/* ==========================================================================
   MAIN WORKSPACE LAYOUT
   ========================================================================== */
.main-app-layout {
  max-width: 1600px;
  margin: 20px auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  transition: all var(--transition-normal);
}

/* Layout Views */
.workspace-grid.split-mode {
  grid-template-columns: 1fr 1fr;
}

.workspace-grid.video-mode {
  grid-template-columns: 1fr;
}

/* ==========================================================================
   A4 SLIDE VIEWER COMPONENT
   ========================================================================== */
.slide-viewer-card {
  background: var(--bg-slate-panel);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.slide-viewer-header {
  padding: 12px 20px;
  background: var(--bg-slate-card);
  border-bottom: 1px solid var(--border-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.slide-badge-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.slide-num-badge {
  background: var(--ca-green-primary);
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.02em;
}

.slide-section-badge {
  color: var(--ca-gold-accent);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.slide-viewer-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-dark);
  color: var(--text-slate-muted);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tool-icon-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border-color: var(--ca-gold-accent);
}

/* A4 Container & Canvas */
.a4-viewport-container {
  padding: 24px;
  background: #080d12;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 640px;
  position: relative;
  overflow: auto;
}

/* True A4 Aspect Ratio Box (1 : 1.414) */
.a4-document-sheet {
  width: 100%;
  max-width: 580px;
  aspect-ratio: 1 / 1.4142;
  background: #ffffff;
  color: #0f172a;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.1);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast);
}

.a4-document-sheet.zoom-125 {
  transform: scale(1.25);
  transform-origin: top center;
  margin-bottom: 120px;
}

.a4-document-sheet.zoom-150 {
  transform: scale(1.5);
  transform-origin: top center;
  margin-bottom: 240px;
}

.a4-image-element {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: #ffffff;
  display: block;
}

/* Built-in High-Resolution SVG Slide Template for Pages without custom image */
.a4-custom-render {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 28px;
  color: #0f172a;
  position: relative;
}

.a4-card-header {
  border-bottom: 2px solid var(--ca-green-primary);
  padding-bottom: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.a4-card-header h2 {
  font-size: 1.25rem;
  color: var(--ca-green-primary);
  font-weight: 800;
}

.a4-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.a4-diagram-box {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
}

.a4-card-footer {
  margin-top: auto;
  border-top: 1px solid #e2e8f0;
  padding-top: 10px;
  font-size: 0.75rem;
  color: #64748b;
  display: flex;
  justify-content: space-between;
}

/* Slide Notes & Drawer under Viewer */
.slide-details-bar {
  padding: 16px 24px;
  background: var(--bg-slate-card);
  border-top: 1px solid var(--border-dark);
}

.slide-title-main {
  font-size: 1.15rem;
  font-weight: 700;
  color: white;
  margin-bottom: 6px;
}

.slide-desc-text {
  font-size: 0.9rem;
  color: var(--text-slate-muted);
  line-height: 1.5;
  margin-bottom: 12px;
}

.coaching-cues-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.coaching-cues-list li {
  background: rgba(0, 106, 78, 0.25);
  border: 1px solid rgba(0, 106, 78, 0.5);
  color: #4ade80;
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
}

/* Slide Navigation Bar */
.slide-nav-toolbar {
  padding: 14px 24px;
  background: var(--bg-slate-panel);
  border-top: 1px solid var(--border-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-page-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-select-input {
  background: var(--bg-slate-card);
  border: 1px solid var(--border-dark);
  color: white;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
}

.page-select-input:focus {
  outline: none;
  border-color: var(--ca-gold-accent);
}

/* ==========================================================================
   VIMEO VIDEO PANEL COMPONENT
   ========================================================================== */
.video-viewer-card {
  background: var(--bg-slate-panel);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.video-header {
  padding: 12px 20px;
  background: var(--bg-slate-card);
  border-bottom: 1px solid var(--border-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.video-badge {
  background: #1ab7ea;
  color: white;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 3px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.video-container-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-container-frame iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-no-media {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-slate-muted);
}

.video-no-media svg {
  width: 48px;
  height: 48px;
  color: var(--text-slate-dim);
  margin-bottom: 12px;
}

.video-info-box {
  padding: 18px 24px;
  background: var(--bg-slate-card);
  border-top: 1px solid var(--border-dark);
}

.video-title-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  margin-bottom: 6px;
}

.video-desc-text {
  font-size: 0.88rem;
  color: var(--text-slate-muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

.video-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-watched {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-slate-muted);
  border: 1px solid var(--border-dark);
}

.btn-watched.is-watched {
  background: rgba(0, 106, 78, 0.3);
  color: #4ade80;
  border-color: #22c55e;
}

.doc-link-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(66, 133, 244, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(66, 133, 244, 0.3);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  text-decoration: none;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.doc-link-pill:hover {
  background: rgba(66, 133, 244, 0.3);
  color: white;
  border-color: #60a5fa;
}

/* ==========================================================================
   THUMBNAIL FILMSTRIP / GRID DRAWER
   ========================================================================== */
.thumbnail-strip-section {
  background: var(--bg-slate-panel);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
}

.thumbnail-strip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.thumbnail-strip-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ca-gold-accent);
  display: flex;
  align-items: center;
  gap: 8px;
}

.thumbnail-scroll-container {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-behavior: smooth;
}

.thumbnail-card {
  flex: 0 0 110px;
  background: var(--bg-slate-card);
  border: 2px solid var(--border-dark);
  border-radius: var(--radius-md);
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  position: relative;
}

.thumbnail-card:hover {
  transform: translateY(-2px);
  border-color: var(--ca-gold-accent);
  background: var(--bg-slate-hover);
}

.thumbnail-card.active {
  border-color: var(--ca-gold-accent);
  background: rgba(232, 168, 33, 0.12);
  box-shadow: 0 0 12px var(--ca-gold-glow);
}

.thumbnail-card.has-video::after {
  content: 'ÔûÂ';
  position: absolute;
  top: 4px;
  right: 4px;
  background: #1ab7ea;
  color: white;
  font-size: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb-preview-box {
  width: 100%;
  aspect-ratio: 1 / 1.414;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-slate-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ==========================================================================
   EDITOR AUTHORITY DRAWER & MODAL
   ========================================================================== */
.editor-panel-container {
  background: var(--bg-slate-panel);
  border: 2px solid var(--ca-gold-accent);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  padding: 24px;
  display: none;
  flex-direction: column;
  gap: 20px;
}

.editor-panel-container.visible {
  display: flex;
}

.editor-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-dark);
}

.editor-heading {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ca-gold-accent);
  display: flex;
  align-items: center;
  gap: 10px;
}

.editor-actions-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.editor-body-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
}

/* Editor Slide List */
.editor-slide-list {
  background: var(--bg-slate-card);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-md);
  padding: 12px;
  max-height: 600px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.editor-slide-item {
  background: var(--bg-slate-panel);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.editor-slide-item:hover {
  border-color: var(--ca-gold-accent);
}

.editor-slide-item.active {
  background: rgba(0, 106, 78, 0.4);
  border-color: var(--ca-green-light);
}

.editor-slide-item-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.editor-slide-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Editor Form Fields */
.editor-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg-slate-card);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-md);
  padding: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-slate-muted);
}

.form-input, .form-textarea, .form-select {
  background: var(--bg-slate-panel);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  color: white;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color var(--transition-fast);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--ca-gold-accent);
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

.drive-helper-box {
  background: rgba(66, 133, 244, 0.1);
  border: 1px solid rgba(66, 133, 244, 0.3);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: #bfdbfe;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Multi-Course Switcher Toolbar */
.course-switcher-bar {
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.course-select-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.course-select-label {
  font-size: 0.85rem;
  color: var(--ca-gold-accent);
  font-weight: 700;
  white-space: nowrap;
}

.course-dropdown {
  background: var(--bg-slate-card);
  color: white;
  border: 1px solid var(--ca-gold-accent);
  border-radius: 6px;
  padding: 6px 12px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
}

/* ==========================================================================
   COMPLETION MODAL & CERTIFICATE
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 10, 15, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--bg-slate-panel);
  border: 2px solid var(--ca-gold-accent);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  position: relative;
  color: white;
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text-slate-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover {
  color: white;
}

.celebrate-header {
  text-align: center;
  margin-bottom: 24px;
}

.celebrate-badge {
  font-size: 3rem;
  margin-bottom: 8px;
  display: inline-block;
  animation: bounce 1.5s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.celebrate-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--ca-gold-accent);
  margin-bottom: 6px;
}

.celebrate-subtitle {
  font-size: 0.95rem;
  color: var(--text-slate-muted);
}

/* Certificate Layout */
.certificate-preview-card {
  background: #ffffff;
  color: #0f172a;
  border: 8px double var(--ca-green-primary);
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  margin: 20px 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  position: relative;
}

.certificate-preview-card .cert-logo {
  height: 48px;
  margin-bottom: 12px;
}

.cert-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--ca-green-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.cert-sub {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 16px;
}

.cert-name {
  font-size: 1.6rem;
  font-weight: 800;
  color: #0f172a;
  border-bottom: 2px solid var(--ca-gold-accent);
  display: inline-block;
  padding: 0 20px 4px 20px;
  margin-bottom: 12px;
}

.cert-body {
  font-size: 0.9rem;
  color: #334155;
  line-height: 1.4;
  margin-bottom: 20px;
}

.cert-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-top: 1px solid #cbd5e1;
  padding-top: 12px;
  font-size: 0.75rem;
  color: #64748b;
}

/* Email Form in Modal */
.notify-form-box {
  background: var(--bg-slate-card);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.notify-form-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ca-gold-accent);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   FOOTER & COPYRIGHT
   ========================================================================== */
.app-footer {
  background: var(--bg-slate-panel);
  border-top: 2px solid var(--ca-green-primary);
  padding: 30px 24px;
  margin-top: 40px;
}

.footer-inner {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-links {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
}

.footer-link {
  color: var(--text-slate-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--ca-gold-accent);
}

.footer-copyright-text {
  font-size: 0.8rem;
  color: var(--text-slate-dim);
  line-height: 1.6;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 14px;
}

/* ==========================================================================
   RESPONSIVE DESIGN & PRINT
   ========================================================================== */
@media (max-width: 1024px) {
  .workspace-grid.split-mode {
    grid-template-columns: 1fr;
  }
  .editor-body-grid {
    grid-template-columns: 1fr;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  .slide-nav-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

@media print {
  body * {
    visibility: hidden;
  }
  #certificate-print-area, #certificate-print-area * {
    visibility: visible;
  }
  #certificate-print-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    border: none;
    box-shadow: none;
  }
}
