/* ═══════════════════════════════════════════════════════════════
   Store Communications Portal — components.css
═══════════════════════════════════════════════════════════════ */

/* ─── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover { background: var(--color-primary-2); color: #fff; }

.btn-secondary {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover { background: var(--color-bg-2); }

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
}
.btn-ghost:hover { background: var(--color-bg-3); color: var(--color-text); }

.btn-danger {
  background: var(--color-danger);
  color: #fff;
}
.btn-danger:hover { background: #b71c1c; }

.btn-sm { padding: 5px 12px; font-size: 0.8125rem; }
.btn-lg { padding: 11px 22px; font-size: 1rem; }
.btn-icon {
  padding: 8px;
  width: 36px;
  height: 36px;
  justify-content: center;
}

/* ─── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition-normal);
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--color-border-2);
}
.card-clickable { cursor: pointer; }
.card-body { padding: 16px; }
.card-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--color-bg-2);
  background: var(--color-bg-2);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Content card */
.content-card {}
.content-card-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--color-bg-3);
  position: relative;
  overflow: hidden;
}
.content-card-thumb img,
.content-card-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.content-card-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-2) 100%);
}
.content-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.content-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.content-card-excerpt {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}
.content-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* Play overlay for video cards */
.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.25);
}
.play-btn-circle {
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.9);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: var(--shadow-md);
}

/* Progress ring */
.progress-ring { position: absolute; bottom: 8px; right: 8px; }
.progress-ring svg { transform: rotate(-90deg); }
.progress-ring-bg    { fill: none; stroke: rgba(255,255,255,0.3); }
.progress-ring-track { fill: none; stroke: #fff; stroke-linecap: round; transition: stroke-dashoffset 0.5s ease; }

/* ─── Badges & Tags ─────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-primary { background: var(--color-accent-2); color: var(--color-primary); }
.badge-success { background: var(--color-success-bg); color: var(--color-success); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning); }
.badge-danger  { background: var(--color-danger-bg);  color: var(--color-danger); }
.badge-neutral { background: var(--color-bg-3); color: var(--color-text-muted); }
.badge-mp4     { background: #1a1a2e; color: #a29bfe; }
.badge-pdf     { background: #fff5f5; color: #e53e3e; }
.badge-ppt     { background: #fff0f0; color: #d94800; }
.badge-image   { background: #f0fff4; color: #276749; }

.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  background: var(--color-bg-3);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
  border: 1px solid var(--color-border);
}
.tag-pill:hover,
.tag-pill.active {
  background: var(--color-accent-2);
  color: var(--color-primary);
  border-color: var(--color-accent-2);
}

.mandatory-badge {
  background: var(--color-warning);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ─── Forms ─────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text);
}
.form-label .required { color: var(--color-danger); margin-left: 2px; }
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-bg);
  transition: var(--transition-fast);
  outline: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--color-primary-2);
  box-shadow: 0 0 0 3px rgba(46,109,164,0.12);
}
.form-textarea { resize: vertical; min-height: 100px; line-height: 1.5; }
.form-select   { cursor: pointer; }
.form-hint     { font-size: 0.75rem; color: var(--color-text-muted); }
.form-error    { font-size: 0.75rem; color: var(--color-danger); }
.form-row      { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Toggle / Checkbox */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}
.toggle-label { font-size: 0.875rem; font-weight: 500; }
.toggle {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--color-border-2);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-fast);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: var(--radius-full);
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
}
.toggle input:checked + .toggle-slider { background: var(--color-primary-2); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* File upload area */
.file-drop {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  transition: var(--transition-fast);
  cursor: pointer;
}
.file-drop:hover,
.file-drop.drag-over {
  border-color: var(--color-primary-2);
  background: var(--color-accent);
}
.file-drop-icon { font-size: 2rem; margin-bottom: 8px; }
.file-drop-text { font-size: 0.875rem; color: var(--color-text-muted); }

/* ─── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeOverlay 0.2s ease;
}
@keyframes fadeOverlay { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--color-bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}
.modal-lg { max-width: 800px; }
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  background: var(--color-bg);
  z-index: 1;
}
.modal-title { font-size: 1.125rem; font-weight: 700; }
.modal-body  { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  position: sticky;
  bottom: 0;
  background: var(--color-bg);
}
.btn-close {
  width: 28px;
  height: 28px;
  border: none;
  background: var(--color-bg-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: var(--transition-fast);
  flex-shrink: 0;
}
.btn-close:hover { background: var(--color-border); color: var(--color-text); }

/* ─── Drawer (slide-in from right) ─────────────────────────── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 900;
  animation: fadeOverlay 0.2s ease;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(480px, 100vw);
  background: var(--color-bg);
  box-shadow: var(--shadow-xl);
  z-index: 901;
  overflow-y: auto;
  animation: drawerIn 0.28s ease;
}
@keyframes drawerIn {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
.drawer-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  background: var(--color-bg);
  z-index: 1;
}
.drawer-body  { padding: 20px; }

/* ─── Filter Bar ────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 0;
  margin-bottom: 16px;
}
.search-box {
  flex: 1;
  min-width: 180px;
  position: relative;
}
.search-box-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: 0.875rem;
  pointer-events: none;
}
.search-box .form-input { padding-left: 32px; }

/* ─── Stats Cards ───────────────────────────────────────────── */
.stat-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.stat-icon-blue   { background: var(--color-accent); }
.stat-icon-green  { background: var(--color-success-bg); }
.stat-icon-orange { background: var(--color-warning-bg); }
.stat-number { font-size: 1.5rem; font-weight: 700; line-height: 1; }
.stat-label  { font-size: 0.8125rem; color: var(--color-text-muted); margin-top: 2px; }

/* ─── Department Workspace Cards ────────────────────────────── */
.dept-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition-normal);
  display: flex;
  align-items: center;
  gap: 12px;
}
.dept-card:hover {
  border-color: var(--color-primary-2);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.dept-icon {
  font-size: 1.75rem;
  width: 48px;
  height: 48px;
  background: var(--color-accent);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dept-name    { font-weight: 600; font-size: 0.9375rem; }
.dept-count   { font-size: 0.8125rem; color: var(--color-text-muted); margin-top: 2px; }

/* ─── Blog / Vlog Cards ─────────────────────────────────────── */
.blog-hero {
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 24px;
  position: relative;
}
.blog-hero-slides { display: flex; transition: transform 0.4s ease; }
.blog-hero-slide  { min-width: 100%; position: relative; }
.blog-hero-img    {
  width: 100%;
  aspect-ratio: 21/8;
  object-fit: cover;
  background: var(--color-bg-3);
}
.blog-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 60%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
}
.blog-hero-title  { color: #fff; font-size: 1.375rem; font-weight: 700; text-shadow: 0 1px 4px rgba(0,0,0,0.4); }
.blog-hero-meta   { color: rgba(255,255,255,0.8); font-size: 0.8125rem; margin-top: 6px; }
.blog-hero-dots   {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}
.hero-dot {
  width: 6px; height: 6px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: var(--transition-fast);
}
.hero-dot.active { background: #fff; width: 18px; }

/* ─── Leadership Corner ─────────────────────────────────────── */
.leadership-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 20px;
}
.leadership-tab {
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition-fast);
}
.leadership-tab:hover { color: var(--color-primary); }
.leadership-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.leadership-featured {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-2) 100%);
  border-radius: var(--radius-xl);
  padding: 28px;
  color: #fff;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.leadership-featured::before {
  content: '"';
  position: absolute;
  top: -10px;
  right: 20px;
  font-size: 8rem;
  font-family: var(--font-display);
  color: rgba(255,255,255,0.1);
  line-height: 1;
}
.leadership-featured-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 8px; }
.leadership-featured-body  { font-size: 0.9375rem; opacity: 0.9; line-height: 1.7; }
.leadership-featured-meta  { margin-top: 16px; font-size: 0.8125rem; opacity: 0.7; }

.timeline-item {
  display: flex;
  gap: 16px;
  padding-bottom: 20px;
  position: relative;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 28px;
  bottom: 0;
  width: 1px;
  background: var(--color-border);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--color-accent-2);
  border: 2px solid var(--color-primary-2);
  flex-shrink: 0;
  margin-top: 4px;
}
.timeline-content { flex: 1; min-width: 0; }
.timeline-title { font-weight: 600; font-size: 0.9375rem; }
.timeline-date  { font-size: 0.75rem; color: var(--color-text-muted); margin-top: 2px; }
.timeline-body  { font-size: 0.875rem; color: var(--color-text-muted); margin-top: 6px; line-height: 1.6; }

/* ─── Video Player ──────────────────────────────────────────── */
.video-container {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  position: relative;
}
.video-container video {
  width: 100%;
  max-height: 70vh;
  display: block;
}

/* ─── PDF Viewer ────────────────────────────────────────────── */
.pdf-viewer {
  width: 100%;
  height: 80vh;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-bg-2);
}

/* ─── Empty State ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-muted);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.5; }
.empty-state-title { font-size: 1.0625rem; font-weight: 600; color: var(--color-text); margin-bottom: 6px; }
.empty-state-text  { font-size: 0.875rem; }

/* ─── Table ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-muted);
  background: var(--color-bg-2);
  border-bottom: 1px solid var(--color-border);
}
td {
  padding: 12px 14px;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--color-bg-2);
  vertical-align: middle;
}
tr:hover td { background: var(--color-bg-2); }
tr:last-child td { border-bottom: none; }

/* ─── Pagination ────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 20px 0;
}
.page-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}
.page-btn:hover  { background: var(--color-bg-2); color: var(--color-text); }
.page-btn.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── Completion Progress Bar ───────────────────────────────── */
.progress-bar-wrap {
  height: 6px;
  background: var(--color-bg-3);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary-2), var(--color-primary-3));
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

/* ─── Lightbox ──────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeOverlay 0.2s ease;
}
.lightbox-inner { position: relative; max-width: 1000px; width: 100%; }
.lightbox video { border-radius: var(--radius-md); }
.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: #fff;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.7;
  transition: var(--transition-fast);
}
.lightbox-close:hover { opacity: 1; }

/* ─── Quill editor overrides ────────────────────────────────── */
.ql-toolbar.ql-snow { border-radius: var(--radius-md) var(--radius-md) 0 0; border-color: var(--color-border); }
.ql-container.ql-snow { border-radius: 0 0 var(--radius-md) var(--radius-md); border-color: var(--color-border); font-family: inherit; font-size: 0.9375rem; min-height: 180px; }

/* ─── Responsive adjustments ────────────────────────────────── */
@media (max-width: 600px) {
  .modal { border-radius: var(--radius-lg); }
  .form-row { grid-template-columns: 1fr; }
  .leadership-featured { padding: 20px; }
  .blog-hero-img { aspect-ratio: 16/9; }
}
