/* --- CSS POUR CATALOGUE FILMS (FILMOTHÈQUE) --- */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;700&display=swap');

body.detail-page {
  font-family: 'Tajawal', Tahoma, sans-serif;
  line-height: 1.5;
  color: #333;
  background-color: #f0f4f8;
  margin: 0;
  padding: 20px;
}

.detail-container {
  max-width: 210mm;
  margin: 0 auto;
  background: white;
  padding: 40px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  border-radius: 4px;
}

/* Header */
.sheet-header {
  display: flex;
  align-items: center;
  border-bottom: 3px solid #673ab7;
  padding-bottom: 20px;
  margin-bottom: 20px;
  gap: 15px;
}
.header-icon { font-size: 3em; }
.header-text h1 { margin: 0; font-size: 22pt; color: #512da8; }
.subtitle { margin: 5px 0 0 0; color: #7e57c2; }
.btn-print {
  margin-right: auto;
  background: #ede7f6; color: #512da8;
  border: 1px solid #673ab7; padding: 10px 20px;
  border-radius: 5px; cursor: pointer;
  font-family: inherit; font-weight: bold;
}
.btn-print:hover { background: #d1c4e9; }

/* Intro */
.intro-box {
  background: #fff3e0;
  border-right: 4px solid #ff9800;
  padding: 15px;
  margin-bottom: 30px;
  font-size: 0.95em;
  color: #5d4037;
}

/* Category Block */
.category-block { margin-bottom: 30px; }
.cat-title {
  color: #2c3e50;
  border-bottom: 2px solid #eee;
  padding-bottom: 10px;
  margin-bottom: 15px;
  font-size: 1.4em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cat-title .icon { font-size: 1.2em; }

/* Films Grid */
.films-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
}

/* Film Card */
.film-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  background: white;
  transition: transform 0.2s;
  break-inside: avoid; /* Prevent split on print */
}
.film-card:hover { transform: translateY(-3px); box-shadow: 0 4px 8px rgba(0,0,0,0.1); }

.film-header {
  background: #f5f5f5;
  padding: 10px 15px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.film-title { font-weight: bold; color: #333; font-size: 1.1em; }
.film-meta { font-size: 0.85em; color: #666; }

.film-card.arabic .film-header { background: #e8f5e9; border-bottom-color: #c8e6c9; }
.film-card.arabic .film-title { color: #2e7d32; }

.film-body { padding: 15px; }
.film-body p { margin: 0 0 10px 0; font-size: 0.9em; color: #555; line-height: 1.4; }

/* Tags */
.tags { display: flex; gap: 5px; flex-wrap: wrap; }
.tag {
  font-size: 0.75em;
  padding: 3px 8px;
  border-radius: 12px;
  color: white;
  font-weight: bold;
}
.tag.blue { background: #2196f3; }
.tag.green { background: #4caf50; }
.tag.red { background: #f44336; }
.tag.orange { background: #ff9800; }
.tag.purple { background: #9c27b0; }
.tag.gold { background: #ffc107; color: #333; }

/* Tips Box */
.tips-box {
  background: #e3f2fd;
  border: 1px dashed #2196f3;
  padding: 20px;
  border-radius: 8px;
  margin-top: 40px;
}
.tips-title { margin-top: 0; color: #1565c0; font-size: 1.2em; }
.tips-list { list-style: none; padding: 0; margin: 0; }
.tips-list li { margin-bottom: 8px; font-weight: bold; color: #0d47a1; }

/* Resources */
.resources-box {
  text-align: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}
.links-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.link-badge {
  background: #eee;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.9em;
  color: #555;
  border: 1px solid #ddd;
}

/* Print Rules */
@media print {
  body { background: white; padding: 0; }
  .detail-container { box-shadow: none; padding: 0; border: none; width: 100%; }
  .btn-print, .no-print { display: none; }
  .film-card { border: 1px solid #999; box-shadow: none; }
  .film-header { background-color: #eee !important; -webkit-print-color-adjust: exact; }
  .tag { border: 1px solid #000; color: #000 !important; background: none !important; }
}