/* Church of God - Three Angels Message */
/* Bilingual (Persian default + English) | Mobile-first */

:root {
  --primary: #0a2540;
  --primary-light: #1a3a5c;
  --accent: #c9a227;
  --accent-soft: #e8d48b;
  --bg: #f8f6f1;
  --bg-card: #ffffff;
  --text: #1a1a1a;
  --text-muted: #5a5a5a;
  --success: #2e7d32;
  --danger: #c62828;
  --border: #e0dcd3;
  --shadow: 0 4px 20px rgba(10, 37, 64, 0.08);
  --radius: 12px;
  --font-fa: 'Vazirmatn', 'Tahoma', sans-serif;
  --font-en: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-fa);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  direction: rtl;
}

body.lang-en {
  font-family: var(--font-en);
  direction: ltr;
}

/* HEADER */
.header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  padding: 0.75rem 1rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: white;
  font-weight: 700;
  font-size: 1.15rem;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--primary);
}

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

.nav a, .nav button {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font-size: 0.92rem;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.nav a:hover, .nav button:hover, .nav a.active {
  background: rgba(255,255,255,0.15);
  color: white;
}

.lang-toggle {
  background: var(--accent) !important;
  color: var(--primary) !important;
  font-weight: 600;
  padding: 0.4rem 0.9rem !important;
}

.live-badge {
  background: #e53935;
  color: white;
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  animation: pulse 1.5s infinite;
  font-weight: 600;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* HERO */
.hero {
  background: linear-gradient(160deg, var(--primary) 0%, #163a5f 60%, #1e4a73 100%);
  color: white;
  padding: 3.5rem 1.5rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 30%, rgba(201,162,39,0.15) 0%, transparent 50%),
              radial-gradient(circle at 80% 70%, rgba(201,162,39,0.1) 0%, transparent 40%);
  pointer-events: none;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  margin-bottom: 0.8rem;
  font-weight: 700;
}

.hero p {
  font-size: 1.1rem;
  opacity: 0.92;
  margin-bottom: 1.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.angels-row {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.angel-card {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  width: 200px;
  transition: transform 0.25s;
}

.angel-card:hover { transform: translateY(-4px); }

.angel-num {
  font-size: 1.8rem;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.angel-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.angel-text {
  font-size: 0.8rem;
  opacity: 0.85;
  line-height: 1.4;
}

/* MAIN */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.section-title {
  font-size: 1.5rem;
  margin-bottom: 1.2rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 1.4rem;
  background: var(--accent);
  border-radius: 2px;
}

/* FILTERS */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
  align-items: center;
}

.filters select, .filters input {
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  background: white;
  min-width: 140px;
}

.filters select:focus, .filters input:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
}

/* MEDIA GRID */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.3rem;
}

.media-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.media-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(10, 37, 64, 0.12);
}

.media-thumb {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #e8e4dc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--primary-light);
}

.media-thumb img, .media-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-body {
  padding: 1rem 1.1rem 1.2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.media-book {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.3rem;
}

.media-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--primary);
  line-height: 1.35;
}

.media-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.media-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.7rem;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); }
.btn-accent { background: var(--accent); color: var(--primary); }
.btn-accent:hover { background: var(--accent-soft); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.82rem; }

/* LIVE */
.live-section {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: white;
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2rem;
  text-align: center;
}

.live-section.hidden { display: none; }

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #e53935;
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.live-dot {
  width: 10px;
  height: 10px;
  background: white;
  border-radius: 50%;
  animation: pulse 1.2s infinite;
}

.live-iframe {
  width: 100%;
  max-width: 720px;
  aspect-ratio: 16/9;
  border: none;
  border-radius: 10px;
  margin: 1rem auto 0;
  display: block;
  background: #000;
}

/* COMMENTS */
.comments-box {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 0.9rem;
}

.comment {
  background: #f5f3ee;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  margin-bottom: 0.6rem;
  font-size: 0.9rem;
}

.comment-author {
  font-weight: 600;
  color: var(--primary);
  font-size: 0.82rem;
}

.comment-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-right: 0.5rem;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.comment-form input, .comment-form textarea {
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
}

.comment-form textarea { min-height: 70px; }

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: white;
  border-radius: 14px;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}

body.lang-en .modal-close {
  left: auto;
  right: 1rem;
}

.modal-media {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 1rem;
  background: #111;
}

/* CONTACT */
.contact-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  max-width: 420px;
  margin: 0 auto;
  text-align: center;
}

.contact-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  margin: 1rem 0;
  font-size: 1.05rem;
}

.contact-item a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.contact-item a:hover { color: var(--accent); }

/* FOOTER */
.footer {
  background: var(--primary);
  color: rgba(255,255,255,0.85);
  text-align: center;
  padding: 1.8rem 1rem;
  font-size: 0.9rem;
  margin-top: 2rem;
}

.footer a { color: var(--accent-soft); }

/* ADMIN */
.admin-login {
  max-width: 380px;
  margin: 4rem auto;
  background: white;
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}

.admin-login input {
  width: 100%;
  padding: 0.7rem 1rem;
  margin: 0.8rem 0 1.2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
}

.admin-panel { max-width: 900px; margin: 0 auto; }
.admin-panel.hidden { display: none; }

.form-group { margin-bottom: 1.1rem; }

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
  color: var(--primary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
}

.form-group textarea {
  min-height: 90px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
  background: #faf9f6;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent);
  background: #fdf8e8;
}

.upload-zone input { display: none; }

.admin-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.admin-tabs button {
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--border);
  background: white;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
}

.admin-tabs button.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.live-controls {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: var(--radius);
  padding: 1.2rem;
  margin-bottom: 1.5rem;
}

.status-msg {
  padding: 0.7rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.status-msg.success { background: #e8f5e9; color: var(--success); }
.status-msg.error { background: #ffebee; color: var(--danger); }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }

@media (max-width: 700px) {
  .header-inner { flex-direction: column; align-items: flex-start; }
  .nav { width: 100%; justify-content: flex-start; }
  .hero { padding: 2.5rem 1rem 3rem; }
  .angels-row { gap: 1rem; }
  .angel-card { width: 100%; max-width: 280px; }
  .media-grid { grid-template-columns: 1fr; }
}
