/* ═══════════════════════════════════════════════════════════════════
   GENERATOR-PLUS.CSS — Premium Media Library, Worksheets, and Certificates
   CourseForge AI | RJ Business Solutions
   Aesthetics: Rich dark/light glassmorphic UI, gold foil borders, and micro-animations
   ═══════════════════════════════════════════════════════════════════ */

/* ─── MEDIA LIBRARY PAGE ─── */
.media-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}

@media (max-width: 900px) {
  .media-layout {
    grid-template-columns: 1fr;
  }
}

.media-left-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.media-right-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  min-height: 500px;
}

/* Glassmorphic Cards for Sidebar */
.glass-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.glass-card h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
}

/* Drag & Drop Area */
.dropzone-area {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  background: var(--bg-elevated);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.dropzone-area:hover, .dropzone-area.dragover {
  border-color: var(--accent);
  background: rgba(10, 102, 255, 0.05);
}

.dropzone-icon {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
  animation: floatAnim 3s ease-in-out infinite;
}

.dropzone-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.dropzone-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Text Area for Pasting Paths */
.path-textarea {
  width: 100%;
  height: 120px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  color: var(--text-primary);
  font-family: 'Space Grotesk', monospace;
  font-size: 0.8rem;
  resize: none;
  line-height: 1.4;
}

.path-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 102, 255, 0.15);
}

/* Asset Search & Filter Grid */
.asset-controls {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.search-wrapper {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-wrapper i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-wrapper input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.search-wrapper input:focus {
  outline: none;
  border-color: var(--accent);
}

.filter-select {
  padding: 0.65rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
}

.filter-select:focus {
  border-color: var(--accent);
}

/* Asset Grid */
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  overflow-y: auto;
  max-height: 550px;
  padding-right: 0.25rem;
}

.asset-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.asset-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.asset-preview-box {
  height: 120px;
  background: #0d0d14;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.asset-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-icon-fallback {
  font-size: 2.5rem;
  color: var(--text-muted);
  opacity: 0.7;
  transition: transform 0.3s ease;
}

.asset-card:hover .asset-icon-fallback {
  transform: scale(1.1) rotate(5deg);
}

.asset-meta {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.asset-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.25rem;
}

.asset-path-badge {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: monospace;
  margin-bottom: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.15rem 0.3rem;
  border-radius: 4px;
}

.asset-details-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.asset-category-tag {
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  border-radius: 10px;
  background: rgba(10, 102, 255, 0.12);
  color: var(--accent);
  font-weight: 500;
}

.asset-size {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.asset-delete-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.85);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 5;
}

.asset-card:hover .asset-delete-btn {
  opacity: 1;
}

/* Custom asset upload tag list */
.custom-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.custom-tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-secondary);
}

/* Active Index Counter */
.index-counter {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  margin-top: auto;
}

.index-counter strong {
  color: var(--accent);
}


/* ─── RESOURCE & CERTIFICATE TAB ─── */
.resource-center {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 1000px) {
  .resource-center {
    grid-template-columns: 1fr;
  }
}

.resource-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Beautiful Worksheets Card */
.worksheet-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.worksheet-card h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1.25rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
}

.worksheet-item {
  border-left: 3px solid var(--accent);
  background: var(--bg-elevated);
  padding: 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 1rem;
  transition: transform 0.2s ease;
}

.worksheet-item:hover {
  transform: translateX(4px);
}

.worksheet-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.worksheet-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.worksheet-mod {
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
  background: rgba(10, 102, 255, 0.1);
  color: var(--accent);
  border-radius: 4px;
}

.worksheet-body {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.worksheet-actions {
  display: flex;
  gap: 0.5rem;
}

.worksheet-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.2s ease;
}

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

/* Printable Premium Certificate Builder */
.certificate-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.certificate-outer {
  width: 100%;
  max-width: 650px;
  aspect-ratio: 1.414; /* Standard landscape ratio */
  background: #ffffff;
  color: #0b1220;
  padding: 2.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

/* Gold border pattern */
.certificate-border {
  width: 100%;
  height: 100%;
  border: 12px double #d4af37; /* Double gold line */
  padding: 1.5rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  background: radial-gradient(circle at center, #ffffff 60%, #fdfdf6 100%);
  position: relative;
}

.certificate-watermark {
  position: absolute;
  font-size: 15rem;
  color: rgba(212, 175, 55, 0.04);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  pointer-events: none;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  z-index: 1;
}

.cert-header {
  text-align: center;
  z-index: 2;
}

.cert-badge {
  font-size: 1.75rem;
  color: #d4af37;
  margin-bottom: 0.25rem;
}

.cert-authority {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #5a5f6e;
  font-weight: 600;
}

.cert-main {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  z-index: 2;
}

.cert-title {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: #003B8F;
  letter-spacing: -1px;
}

.cert-presents {
  font-size: 0.85rem;
  font-style: italic;
  color: #5a5f6e;
}

.cert-name {
  font-family: 'Syne', sans-serif;
  font-size: 1.85rem;
  font-weight: 700;
  color: #000;
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
  display: inline-block;
  min-width: 250px;
  padding-bottom: 0.25rem;
  margin: 0.25rem auto;
}

.cert-text {
  font-size: 0.8rem;
  color: #5a5f6e;
  line-height: 1.5;
  max-width: 480px;
  margin: 0 auto;
}

.cert-course-title {
  font-weight: 700;
  color: #0A66FF;
}

.cert-footer {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 1.5rem;
  z-index: 2;
}

.cert-sig-block {
  text-align: center;
  width: 120px;
}

.cert-sig-line {
  border-top: 1px solid rgba(0, 0, 0, 0.2);
  margin-top: 1.75rem;
  padding-top: 0.25rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.65rem;
  text-transform: uppercase;
  color: #5a5f6e;
  font-weight: 500;
}

.cert-sig-font {
  font-family: 'Syne', cursive, sans-serif;
  font-style: italic;
  font-size: 1.1rem;
  color: #003B8F;
  height: 24px;
}

.cert-seal {
  width: 48px;
  height: 48px;
  background: radial-gradient(circle, #fcd34d 0%, #d4af37 100%);
  border-radius: 50%;
  border: 2px dashed #92400e;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #78350f;
  font-size: 0.95rem;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4);
  transform: rotate(-10deg);
}

/* Certificate Actions */
.cert-actions {
  display: flex;
  gap: 0.75rem;
}

/* Theme-Adaptive SVG Charts & Gradients */
.adaptive-chart-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.adaptive-chart-box h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1.2rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chart-canvas {
  width: 100%;
  max-width: 500px;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

/* Funnel graphic CSS */
.svg-funnel-node {
  fill: var(--accent);
  transition: fill var(--transition), filter 0.2s ease;
}

.svg-funnel-node:hover {
  fill: var(--accent-2);
  filter: drop-shadow(0 4px 12px var(--accent));
}

.svg-text {
  fill: var(--text-primary);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 500;
  pointer-events: none;
}

.svg-title {
  fill: var(--text-invert);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}

.svg-arrow {
  stroke: var(--border-strong);
  stroke-dasharray: 4;
  animation: strokeDashAnim 1.5s linear infinite;
}

/* KEYFRAMES & ANIMATIONS */
@keyframes floatAnim {
  0% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
  100% { transform: translateY(0); }
}

@keyframes strokeDashAnim {
  to { stroke-dashoffset: -20; }
}

/* Toast animations overlap custom classes safely */
@keyframes slideOutToast {
  to { transform: translateX(120%); opacity: 0; }
}
