/* style.css - Marketing Materials Gallery */

:root {
  --font-family: 'IBM Plex Sans Arabic', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Light mode palette */
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-muted: #f1f5f9;
  --bg-chip: #e2e8f0;
  --bg-chip-active: #0284c7;
  --text-chip-active: #ffffff;
  
  --border-subtle: #e2e8f0;
  --border-card: #cbd5e1;
  --border-focus: #0284c7;

  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #e0f2fe;

  --status-ready-bg: #dcfce7;
  --status-ready-text: #166534;
  --status-ready-border: #86efac;

  --status-draft-bg: #fef3c7;
  --status-draft-text: #92400e;
  --status-draft-border: #fcd34d;

  --status-published-bg: #e0e7ff;
  --status-published-text: #3730a3;
  --status-published-border: #a5b4fc;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

  --max-width: 1200px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-page: #090d16;
    --bg-surface: #111827;
    --bg-surface-elevated: #1e293b;
    --bg-muted: #1e293b;
    --bg-chip: #1e293b;
    --bg-chip-active: #38bdf8;
    --text-chip-active: #082f49;

    --border-subtle: #1e293b;
    --border-card: #334155;
    --border-focus: #38bdf8;

    --text-main: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-inverse: #0f172a;

    --primary: #38bdf8;
    --primary-hover: #7dd3fc;
    --primary-light: #082f49;

    --status-ready-bg: #064e3b;
    --status-ready-text: #a7f3d0;
    --status-ready-border: #059669;

    --status-draft-bg: #78350f;
    --status-draft-text: #fde68a;
    --status-draft-border: #d97706;

    --status-published-bg: #312e81;
    --status-published-text: #c7d2fe;
    --status-published-border: #4f46e5;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.4);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5), 0 2px 4px -2px rgb(0 0 0 / 0.5);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.6), 0 4px 6px -4px rgb(0 0 0 / 0.6);
  }
}

/* Reset and Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  overflow-x: hidden;
  padding: 0 0 4rem;
}

/* Focus indicator */
:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 1rem;
}

@media (min-width: 640px) {
  .container {
    padding-inline: 1.5rem;
  }
}

/* Top App Header */
.app-header {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-sm);
  padding: 1rem 0;
}

.header-inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .header-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.header-branding {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-badge {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.header-titles h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.header-titles p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.week-badge {
  background-color: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.week-badge svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

/* Filters Section */
.filters-section {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1rem 0;
  margin-bottom: 1.5rem;
}

.filters-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.filter-group-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.chips-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.chips-row::-webkit-scrollbar {
  height: 4px;
}
.chips-row::-webkit-scrollbar-thumb {
  background: var(--border-card);
  border-radius: 4px;
}

.filter-chip {
  background-color: var(--bg-chip);
  color: var(--text-secondary);
  border: 1px solid transparent;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.825rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease-in-out;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.filter-chip:hover {
  filter: brightness(0.95);
}

.filter-chip.active {
  background-color: var(--bg-chip-active);
  color: var(--text-chip-active);
  font-weight: 600;
}

.filter-chip .chip-count {
  font-size: 0.75rem;
  opacity: 0.85;
  background: rgba(0, 0, 0, 0.1);
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-full);
}

.filter-chip.active .chip-count {
  background: rgba(255, 255, 255, 0.2);
}

.filter-reset-btn {
  background: transparent;
  border: 1px dashed var(--border-card);
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  cursor: pointer;
  align-self: flex-start;
  margin-top: 0.25rem;
  font-family: inherit;
}

.filter-reset-btn:hover {
  color: var(--text-main);
  border-color: var(--text-muted);
}

/* Gallery Content */
.gallery-days {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.day-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.day-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-subtle);
}

.day-group-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.day-badge-counter {
  font-size: 0.8rem;
  background-color: var(--bg-muted);
  color: var(--text-muted);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

/* Grid of Cards */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

/* Item Card */
.item-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.item-card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 1rem 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.card-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.card-time {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.card-time svg {
  width: 14px;
  height: 14px;
}

.card-badges {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* Status Pill */
.status-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.status-ready {
  background-color: var(--status-ready-bg);
  color: var(--status-ready-text);
  border: 1px solid var(--status-ready-border);
}

.status-draft {
  background-color: var(--status-draft-bg);
  color: var(--status-draft-text);
  border: 1px solid var(--status-draft-border);
}

.status-published {
  background-color: var(--status-published-bg);
  color: var(--status-published-text);
  border: 1px solid var(--status-published-border);
}

/* Platform Badge */
.platform-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-muted);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.platform-linkedin_page,
.platform-linkedin_personal {
  background-color: rgba(10, 102, 194, 0.1);
  color: #0a66c2;
  border-color: rgba(10, 102, 194, 0.25);
}

.platform-facebook {
  background-color: rgba(24, 119, 242, 0.1);
  color: #1877f2;
  border-color: rgba(24, 119, 242, 0.25);
}

.platform-instagram {
  background-color: rgba(225, 48, 108, 0.1);
  color: #e1306c;
  border-color: rgba(225, 48, 108, 0.25);
}

.platform-tiktok {
  background-color: rgba(0, 0, 0, 0.1);
  color: var(--text-main);
  border-color: var(--border-card);
}

.platform-stories {
  background-color: rgba(247, 119, 55, 0.1);
  color: #f77737;
  border-color: rgba(247, 119, 55, 0.25);
}

.platform-ads {
  background-color: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
  border-color: rgba(139, 92, 246, 0.25);
}

/* Type Pill */
.type-pill {
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-muted);
  color: var(--text-muted);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
}

/* Media Preview Area */
.card-media {
  background-color: #000;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 220px;
  max-height: 380px;
}

.media-thumbnail-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

.media-thumbnail {
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
  display: block;
  transition: transform 0.2s ease;
}

.media-thumbnail-container:hover .media-thumbnail {
  transform: scale(1.015);
}

.zoom-overlay-hint {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

.zoom-overlay-hint svg {
  width: 14px;
  height: 14px;
}

/* Video */
.video-preview {
  width: 100%;
  max-height: 360px;
  background-color: #000;
}

/* Carousel Preview Strip */
.carousel-strip-container {
  width: 100%;
  background: #0b0f19;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.carousel-strip {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.carousel-slide-item {
  flex: 0 0 160px;
  height: 200px;
  scroll-snap-align: start;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  background: #1e293b;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.carousel-slide-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-slide-index {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
}

/* Card Body */
.card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex-grow: 1;
}

/* Caption block */
.caption-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background-color: var(--bg-muted);
  border-radius: var(--radius-md);
  padding: 0.85rem;
}

.caption-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.caption-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.btn-copy {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.15s ease;
}

.btn-copy:hover {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.btn-copy svg {
  width: 14px;
  height: 14px;
}

.caption-text {
  font-size: 0.9rem;
  color: var(--text-main);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}

/* Hashtags block */
.hashtags-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background-color: var(--bg-muted);
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  color: var(--primary);
  direction: ltr;
  text-align: left;
}

.hashtags-content {
  flex-grow: 1;
  word-break: break-all;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

/* Notes block */
.notes-block {
  background-color: rgba(245, 158, 11, 0.08);
  border-right: 3px solid #f59e0b;
  padding: 0.6rem 0.85rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.825rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.notes-label {
  font-weight: 600;
  color: #d97706;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Card Files Actions */
.card-files {
  border-top: 1px solid var(--border-subtle);
  padding: 0.85rem 1rem;
  background-color: var(--bg-surface-elevated);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.files-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.files-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.files-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-file-download,
.btn-download-all {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.825rem;
  font-weight: 600;
  text-decoration: none;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.btn-file-download {
  background-color: var(--bg-muted);
  color: var(--text-main);
  border-color: var(--border-card);
}

.btn-file-download:hover {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.btn-download-all {
  background-color: var(--primary);
  color: #fff;
}

.btn-download-all:hover {
  background-color: var(--primary-hover);
}

.btn-file-pdf {
  background-color: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-file-pdf:hover {
  background-color: rgba(239, 68, 68, 0.2);
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background-color: #0f172a;
  color: #ffffff;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toast.fade-out {
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transition: all 0.25s ease;
}

/* Lightbox Modal */
.lightbox {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.92);
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  backdrop-filter: blur(8px);
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 82vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  user-select: none;
}

.lightbox-topbar {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  left: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  z-index: 10;
}

.lightbox-title {
  font-size: 0.95rem;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lightbox-counter {
  font-size: 0.85rem;
  color: #94a3b8;
}

.lightbox-close-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

.lightbox-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
  z-index: 10;
}

.lightbox-nav-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}

.lightbox-prev-btn {
  right: 1.5rem;
}

.lightbox-next-btn {
  left: 1.5rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  background-color: var(--bg-surface);
  border: 1px dashed var(--border-card);
  border-radius: var(--radius-lg);
  margin-top: 1.5rem;
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.empty-state-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.empty-state-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
}
