/* ═══════════════════════════════════════════════════════════════════════════
   TAIBA MOSCHEE – BAYRAM ESSENSLISTE
   Farben: Dunkelgrün · Gold · Weiß
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --green-900: #0f3d24;
  --green-800: #1a5c38;
  --green-700: #236b44;
  --green-600: #2d7a4f;
  --green-100: #e8f5ee;
  --green-50:  #f2faf5;

  --gold-600:  #b8860b;
  --gold-500:  #c9a227;
  --gold-400:  #d4af37;
  --gold-100:  #fef5d4;
  --gold-50:   #fffbea;

  --red-600:   #c0392b;
  --red-100:   #fdecea;

  --gray-900:  #1a1a1a;
  --gray-700:  #4a4a4a;
  --gray-500:  #6c757d;
  --gray-300:  #dee2e6;
  --gray-100:  #f4f6f8;
  --white:     #ffffff;

  --shadow-sm: 0 1px 4px rgba(0,0,0,0.08);
  --shadow:    0 2px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 6px 28px rgba(0,0,0,0.14);

  --radius:    14px;
  --radius-sm: 8px;
  --radius-xs: 5px;
  --ease:      0.2s ease;
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--gray-100);
  color: var(--gray-900);
  line-height: 1.6;
  min-height: 100vh;
}

/* ─── Header ─────────────────────────────────────────────────────────────── */
.header {
  background: linear-gradient(135deg, var(--green-900) 0%, var(--green-700) 100%);
  color: var(--white);
  padding: 0.9rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  box-shadow: 0 3px 12px rgba(0,0,0,0.25);
  position: sticky;
  top: 0;
  z-index: 200;
}

.header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-500), var(--gold-400), var(--gold-500));
}

.header-content {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.mosque-emblem {
  width: 46px;
  height: 46px;
  background: rgba(255,255,255,0.12);
  border: 2px solid rgba(201,162,39,0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.emblem-icon { font-size: 1.5rem; }

.header-text h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.header-subtitle {
  font-size: 0.78rem;
  color: var(--gold-100);
  letter-spacing: 0.04em;
  opacity: 0.9;
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.65rem 1.25rem;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--ease);
  white-space: nowrap;
  line-height: 1;
  user-select: none;
}

.btn:active { transform: scale(0.96); }

.btn-primary {
  background: var(--green-800);
  color: var(--white);
  border-color: var(--green-800);
}
.btn-primary:hover { background: var(--green-700); border-color: var(--green-700); }

.btn-gold {
  background: var(--gold-500);
  color: var(--gray-900);
  border-color: var(--gold-500);
}
.btn-gold:hover { background: var(--gold-600); color: var(--white); border-color: var(--gold-600); }

.btn-outline-gold {
  background: transparent;
  color: var(--gold-100);
  border-color: var(--gold-500);
}
.btn-outline-gold:hover { background: var(--gold-500); color: var(--gray-900); }

.btn-secondary {
  background: var(--white);
  color: var(--gray-700);
  border-color: var(--gray-300);
}
.btn-secondary:hover { background: var(--gray-100); }

.btn-danger {
  background: var(--red-600);
  color: var(--white);
  border-color: var(--red-600);
}
.btn-danger:hover { background: #a93226; }

.btn-danger-outline {
  background: transparent;
  color: #f8a0a0;
  border-color: #e07070;
}
.btn-danger-outline:hover { background: var(--red-600); color: var(--white); border-color: var(--red-600); }

.btn-lg { padding: 0.85rem 2rem; font-size: 1.05rem; border-radius: var(--radius-sm); }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* Admin-Button im Header */
.admin-btn { font-size: 0.82rem; padding: 0.5rem 0.9rem; }

/* Sprach-Toggle-Button */
.header-actions { display: flex; align-items: center; gap: 0.5rem; }

.btn-lang {
  background: rgba(255,255,255,0.1);
  color: var(--white);
  border: 1.5px solid rgba(255,255,255,0.35);
  font-size: 0.78rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.btn-lang:hover {
  background: rgba(255,255,255,0.2);
  border-color: var(--gold-400);
}

/* ─── Notice Bar ─────────────────────────────────────────────────────────── */
.notice-bar {
  background: linear-gradient(90deg, var(--gold-50), var(--gold-100), var(--gold-50));
  border-bottom: 2px solid var(--gold-400);
  padding: 0.55rem 1rem;
  text-align: center;
}

.notice-inner {
  max-width: 900px;
  margin: 0 auto;
  font-size: 0.84rem;
  color: var(--green-800);
  font-style: italic;
}

/* ─── Admin Banner ───────────────────────────────────────────────────────── */
.admin-banner {
  background: linear-gradient(135deg, var(--green-900), var(--green-800));
  color: var(--white);
  padding: 0.65rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  border-bottom: 2px solid var(--gold-500);
}

.admin-label { font-size: 0.9rem; font-weight: 600; }
.admin-controls { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ─── Container ──────────────────────────────────────────────────────────── */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.1rem 1rem 2rem;
}

/* ─── Stats Bar ──────────────────────────────────────────────────────────── */
.stats-bar {
  display: flex;
  align-items: center;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 5px solid var(--gold-500);
  padding: 0.9rem 1.25rem;
  margin-bottom: 1.25rem;
  gap: 0;
}

.stat-item {
  flex: 1;
  text-align: center;
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--gray-300);
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--green-800);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gray-500);
  margin-top: 0.15rem;
}

/* ─── Card ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.card-header {
  background: linear-gradient(135deg, var(--green-800), var(--green-700));
  color: var(--white);
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  transition: background var(--ease);
}
.card-header:hover { background: linear-gradient(135deg, var(--green-700), var(--green-600)); }

.card-header-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.card-header-left h2 { font-size: 1rem; font-weight: 600; }
.card-header-icon { font-size: 1.1rem; }
.toggle-arrow { font-size: 0.8rem; opacity: 0.8; transition: transform var(--ease); }

.card-body { padding: 1.25rem; }

/* ─── Form ───────────────────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-group-full { grid-column: 1 / -1; }

label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
}

.req { color: var(--red-600); }
.opt { color: var(--gray-500); font-weight: 400; font-size: 0.78rem; }

input[type="text"],
input[type="tel"],
input[type="password"],
input[type="search"],
textarea,
select {
  padding: 0.72rem 0.95rem;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  color: var(--gray-900);
  background: var(--white);
  width: 100%;
  transition: border-color var(--ease), box-shadow var(--ease);
  appearance: none;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px rgba(35,107,68,0.12);
}

textarea { resize: vertical; min-height: 64px; }

.field-error {
  font-size: 0.8rem;
  color: var(--red-600);
  min-height: 1.1em;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-300);
}

.required-hint { font-size: 0.8rem; color: var(--gray-500); }

.form-msg {
  margin-top: 0.85rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
}
.form-msg.success { background: var(--green-100); color: var(--green-800); border: 1.5px solid var(--green-600); }
.form-msg.error   { background: var(--red-100); color: var(--red-600); border: 1.5px solid var(--red-600); }

/* ─── Search ─────────────────────────────────────────────────────────────── */
.search-wrap {
  position: relative;
  margin-bottom: 1.1rem;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  pointer-events: none;
}

.search-wrap input {
  padding-left: 2.6rem;
  border-radius: 50px;
  border-color: var(--gray-300);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  font-size: 0.95rem;
}

.search-wrap input:focus {
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px rgba(35,107,68,0.12);
}

/* ─── Section Title ──────────────────────────────────────────────────────── */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.section-title h2 { font-size: 0.95rem; font-weight: 600; color: var(--gray-700); }
.filter-hint { font-size: 0.8rem; color: var(--gray-500); }

/* ─── Entries Grid ───────────────────────────────────────────────────────── */
.entries-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

/* ─── Entry Card ─────────────────────────────────────────────────────────── */
.entry-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1rem 1.1rem;
  border-left: 5px solid var(--green-700);
  transition: box-shadow var(--ease), transform var(--ease);
}
.entry-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

@keyframes pulse-gold {
  0%   { background-color: var(--gold-50); }
  50%  { background-color: var(--gold-100); }
  100% { background-color: var(--white); }
}
.entry-card.new-entry { animation: pulse-gold 2s ease; }

.entry-row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.entry-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green-800);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.entry-dish {
  font-size: 1rem;
  color: var(--gray-900);
  margin-top: 0.2rem;
}

.entry-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: flex-start; }

.badge {
  display: inline-block;
  padding: 0.22rem 0.7rem;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-green  { background: var(--green-100); color: var(--green-800); }
.badge-gold   { background: var(--gold-100);  color: var(--gold-600); }

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-top: 0.5rem;
}

.entry-note {
  margin-top: 0.55rem;
  font-size: 0.84rem;
  color: var(--gray-700);
  font-style: italic;
  background: var(--gray-100);
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-xs);
}

.entry-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-300);
}

/* ─── Empty State ────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3.5rem 1rem;
  color: var(--gray-500);
}
.empty-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.empty-state p { font-size: 1rem; line-height: 1.7; }

/* ─── Modal ──────────────────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
}

.modal-box {
  position: relative;
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-sm { max-width: 380px; }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--green-100);
}

.modal-head h3 { font-size: 1.05rem; font-weight: 700; color: var(--green-800); }

.modal-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--gray-500);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-xs);
  line-height: 1;
  transition: background var(--ease);
}
.modal-close:hover { background: var(--gray-100); }

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-300);
}

.inline-error { font-size: 0.85rem; color: var(--red-600); margin-bottom: 0.75rem; padding: 0.4rem 0; }

.delete-question { font-size: 0.95rem; color: var(--gray-700); margin-bottom: 0.75rem; }
.delete-target {
  font-weight: 700;
  color: var(--green-800);
  background: var(--green-100);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-xs);
  margin-bottom: 0.25rem;
  text-align: center;
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 1.75rem 1rem;
  font-size: 0.85rem;
  color: var(--gray-500);
  border-top: 1px solid var(--gray-300);
  margin-top: 1rem;
}

/* ─── Utility ────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ─── Print ──────────────────────────────────────────────────────────────── */
.print-only { display: none; }

@media print {
  .header, .notice-bar, .admin-banner, .stats-bar,
  .card, .search-wrap, .section-title, .entries-grid,
  .empty-state, .footer, .modal, .entry-actions { display: none !important; }

  .print-only { display: block; }
  body { background: white; font-size: 11pt; }

  .print-head {
    text-align: center;
    margin-bottom: 1.2rem;
    padding-bottom: 0.7rem;
    border-bottom: 3px solid #1a5c38;
  }
  .print-head h1 { font-size: 16pt; color: #1a5c38; }
  .print-head p  { font-size: 10pt; color: #555; margin-top: 0.3rem; }

  #printTable { width: 100%; border-collapse: collapse; font-size: 9pt; }
  #printTable th {
    background: #1a5c38;
    color: white;
    padding: 6px 8px;
    text-align: left;
    font-size: 9pt;
  }
  #printTable td { padding: 5px 8px; border-bottom: 1px solid #ddd; }
  #printTable tr:nth-child(even) td { background: #f2faf5; }
}

/* ─── Responsive: Tablet ──────────────────────────────────────────────────── */
@media (min-width: 580px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .entries-grid { grid-template-columns: 1fr 1fr; }
}

/* ─── Responsive: Desktop ─────────────────────────────────────────────────── */
@media (min-width: 900px) {
  .container { padding: 1.5rem 1.5rem 3rem; }
  .entries-grid { grid-template-columns: repeat(3, 1fr); }
  .header-text h1 { font-size: 1.3rem; }
  .header-subtitle { font-size: 0.82rem; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RTL – Arabisch (dir="rtl" auf dem <html>-Element)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Bessere arabische Schrift */
[dir="rtl"] {
  font-family: Tahoma, 'Segoe UI', Arial, sans-serif;
  line-height: 1.75;
}

/* Eintragskarten: Border von links nach rechts */
[dir="rtl"] .entry-card {
  border-left: none;
  border-right: 5px solid var(--green-700);
}

/* Statistikleiste: Border von links nach rechts */
[dir="rtl"] .stats-bar {
  border-left: none;
  border-right: 5px solid var(--gold-500);
}

/* Suchfeld: Icon-Abstand spiegeln */
[dir="rtl"] .search-icon {
  left: auto;
  right: 1rem;
}
[dir="rtl"] .search-wrap input {
  padding-left: 0.95rem;
  padding-right: 2.6rem;
}

/* Drucktabelle: Textausrichtung rechts */
@media print {
  [dir="rtl"] #printTable th,
  [dir="rtl"] #printTable td {
    text-align: right;
  }
}
