/* ============================================================
 * Anjuman E Ezzy - Bohra Premium UI Theme
 * Dawoodi Bohra inspired, modern private streaming aesthetic
 * ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Marcellus&family=Noto+Naskh+Arabic:wght@500;700&display=swap');

:root {
  --font-body: 'Manrope', sans-serif;
  --font-heading: 'Marcellus', serif;
  --font-arabic: 'Noto Naskh Arabic', serif;

  --bg-primary: #f7f2e7;
  --bg-secondary: #fffdf6;
  --bg-card: rgba(255, 253, 246, 0.76);
  --bg-card-hover: rgba(255, 250, 239, 0.9);
  --bg-input: rgba(255, 252, 245, 0.95);
  --bg-dark-panel: rgba(8, 39, 33, 0.82);

  --accent: #0b6d58;
  --accent-hover: #095947;
  --accent-soft: #0f8a78;
  --accent-subtle: rgba(11, 109, 88, 0.12);
  --accent-glow: rgba(11, 109, 88, 0.28);

  --gold: #b78a3a;
  --gold-deep: #9b722c;
  --turquoise: #1b8f97;

  --text-primary: #1b2b25;
  --text-secondary: #52645e;
  --text-muted: #6f817b;
  --text-disabled: #9aac9f;

  --border: rgba(26, 68, 56, 0.14);
  --border-strong: rgba(183, 138, 58, 0.3);
  --border-focus: rgba(11, 109, 88, 0.26);

  --shadow-sm: 0 6px 18px rgba(15, 43, 37, 0.08);
  --shadow-md: 0 18px 40px rgba(9, 37, 31, 0.14);
  --shadow-lg: 0 36px 80px rgba(7, 33, 28, 0.2);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.12s ease;

  --sidebar-width: 270px;
  --header-height: 68px;
  --player-ratio: 56.25%;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 14%, rgba(183, 138, 58, 0.18) 0%, transparent 36%),
    radial-gradient(circle at 92% 10%, rgba(27, 143, 151, 0.2) 0%, transparent 34%),
    linear-gradient(180deg, #fcf7eb 0%, #f3ecde 60%, #f9f4e7 100%);
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(45deg, rgba(183, 138, 58, 0.06) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(183, 138, 58, 0.06) 25%, transparent 25%);
  background-size: 34px 34px;
  background-position: 0 0, 17px 17px;
  z-index: 0;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-fast);
}

img { max-width: 100%; height: auto; }

/* Logo display helpers */
.site-title img,
.brand-mark img,
.brand-logo img {
  display: block;
  margin: 0 auto 10px;
  background: transparent;
  max-width: 120px;
  width: auto;
  height: auto;
}

.site-title h1 { margin-top: 6px; }

/* Strong logo sizing to avoid SVG rasterization issues */
.site-title img { width: 120px; height: 120px; object-fit: contain; }
.brand-mark img { width: 56px; height: 56px; object-fit: contain; }
.brand-logo img { width: 42px; height: 42px; object-fit: contain; }

::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: rgba(247, 242, 231, 0.6); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), var(--turquoise));
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent-hover); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.28;
  letter-spacing: 0.01em;
}

.text-accent { color: var(--accent) !important; }
.text-gold { color: var(--gold) !important; }
.text-muted-alt { color: var(--text-secondary); }

.btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  border-radius: 999px;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
}

.btn-primary-red,
.btn-danger {
  background: linear-gradient(135deg, var(--accent) 0%, var(--turquoise) 100%);
  color: #fff;
  box-shadow: 0 12px 24px rgba(11, 109, 88, 0.25);
}
.btn-primary-red:hover,
.btn-danger:hover {
  background: linear-gradient(135deg, var(--accent-hover) 0%, #11727c 100%);
  color: #fff;
  transform: translateY(-1px);
}

.btn-outline-red,
.btn-outline-light {
  background: rgba(255, 251, 242, 0.65);
  border: 1.2px solid var(--border-strong);
  color: var(--accent);
}
.btn-outline-red:hover,
.btn-outline-light:hover {
  background: rgba(11, 109, 88, 0.1);
  border-color: rgba(11, 109, 88, 0.34);
  color: var(--accent-hover);
}

.btn-dark {
  background: rgba(16, 44, 38, 0.9);
  color: #f4efe2;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.btn-dark:hover {
  background: rgba(9, 33, 28, 0.95);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-card-hover); }

.btn-success {
  background: linear-gradient(135deg, #0e7d49 0%, #12935d 100%);
  color: #fff;
}
.btn-success:hover { background: #0c6a3f; }

.btn-sm { padding: 7px 14px; font-size: 0.79rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-icon { padding: 10px; min-width: 42px; justify-content: center; }

.card-dark {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.card-dark:hover {
  border-color: rgba(183, 138, 58, 0.38);
  box-shadow: var(--shadow-md);
}

.card-glass {
  background: rgba(255, 252, 245, 0.48);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(183, 138, 58, 0.24);
  border-radius: var(--radius-lg);
}

.form-control-dark,
.form-select-dark {
  background: var(--bg-input) !important;
  border: 1.4px solid var(--border) !important;
  color: var(--text-primary) !important;
  border-radius: 14px !important;
  padding: 12px 16px !important;
  font-family: var(--font-body);
  font-size: 0.92rem !important;
  transition: var(--transition) !important;
}

.form-control-dark::placeholder { color: var(--text-muted) !important; }

.form-control-dark:focus,
.form-select-dark:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-subtle) !important;
  outline: none !important;
  background: #fff !important;
}

.form-label-dark {
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.badge-live {
  background: linear-gradient(135deg, #0b7e52 0%, var(--accent-soft) 100%);
  color: #fff;
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  animation: pulse-live 2s infinite;
}

.badge-offline {
  background: rgba(82, 100, 94, 0.15);
  color: var(--text-secondary);
  border: 1px solid rgba(82, 100, 94, 0.28);
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.badge-scheduled {
  background: rgba(183, 138, 58, 0.14);
  color: var(--gold-deep);
  border: 1px solid rgba(183, 138, 58, 0.34);
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
  display: inline-block;
  animation: blink-dot 1.2s ease-in-out infinite;
}

@keyframes pulse-live {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50% { box-shadow: 0 0 0 9px transparent; }
}

@keyframes blink-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

.skeleton {
  background: linear-gradient(90deg, rgba(255, 251, 242, 0.8) 25%, rgba(241, 233, 216, 0.85) 50%, rgba(255, 251, 242, 0.8) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.toast-container-custom {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}

.toast-custom {
  background: rgba(255, 252, 245, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: var(--shadow-md);
  animation: slideInRight 0.3s ease;
  position: relative;
  overflow: hidden;
}

.toast-custom::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
}

.toast-custom.toast-success::before { background: #0e7d49; }
.toast-custom.toast-error::before { background: #a95a32; }
.toast-custom.toast-info::before { background: var(--turquoise); }
.toast-custom.toast-warning::before { background: var(--gold); }

.toast-message { font-size: 0.82rem; color: var(--text-secondary); }
.toast-close { background: none; border: none; color: var(--text-muted); }
.toast-close:hover { color: var(--text-primary); }

@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(120%); opacity: 0; }
}

.player-wrapper {
  position: relative;
  width: 100%;
  padding-top: var(--player-ratio);
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(183, 138, 58, 0.34);
}

.player-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.player-offline {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, rgba(8, 39, 33, 0.95) 0%, rgba(18, 64, 54, 0.92) 100%);
}

.stream-info-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.stream-title {
  font-size: 1.1rem;
  font-weight: 800;
  flex: 1;
  min-width: 200px;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

.glow-text { text-shadow: 0 0 20px var(--accent-glow); }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.section-title {
  font-size: 1.42rem;
  font-weight: 700;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--accent));
  border-radius: 2px;
  margin-top: 8px;
}

.modal-dark .modal-content {
  background: rgba(255, 252, 245, 0.98);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
}

.modal-dark .modal-header,
.modal-dark .modal-footer {
  border-color: var(--border);
}

.modal-dark .btn-close {
  filter: none;
  opacity: 0.7;
}

.table-dark-custom {
  color: var(--text-primary) !important;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table-dark-custom thead th {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table-dark-custom tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--transition-fast);
}

.table-dark-custom tbody tr:hover { background: rgba(11, 109, 88, 0.06); }
.table-dark-custom tbody td { padding: 14px 16px; font-size: 0.875rem; vertical-align: middle; }

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(183, 138, 58, 0.32);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 16px;
}

.stat-icon.icon-red { background: rgba(183, 138, 58, 0.16); }
.stat-icon.icon-green { background: rgba(11, 109, 88, 0.14); }
.stat-icon.icon-blue { background: rgba(27, 143, 151, 0.14); }
.stat-icon.icon-gold { background: rgba(183, 138, 58, 0.14); }

.fade-in { animation: fadeIn 0.4s ease both; }
.slide-up { animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) both; }

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

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }
  .section-title { font-size: 1.2rem; }
  .player-wrapper { border-radius: var(--radius-md); }
  .stream-info-bar { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 576px) {
  .card-dark { padding: 16px; }
}
