/* Worship News Master Panel - Stylesheet */

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

body {
  font-family: 'Segoe UI', 'Mukta', 'Noto Sans Devanagari', system-ui, -apple-system, sans-serif;
  background: #F7F8FA;
  color: #1f2937;
  line-height: 1.5;
  font-size: 14px;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }

/* TOP BAR */
.top-bar {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-bar-left .brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.top-bar-left .brand i {
  width: 32px; height: 32px;
  background: #E6F1FB;
  color: #185FA5;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.brand-name { font-weight: 600; font-size: 14px; }
.brand-sub { font-size: 11px; color: #6b7280; }

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-form {
  position: relative;
}
.search-form i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 12px;
}
.search-form input {
  padding: 8px 12px 8px 30px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  width: 280px;
  font-size: 13px;
  font-family: inherit;
}
.search-form input:focus {
  outline: none;
  border-color: #185FA5;
  box-shadow: 0 0 0 3px rgba(24,95,165,0.1);
}

.live-badge {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  background: #ECFDF5;
  color: #065F46;
  font-size: 11px;
  border-radius: 6px;
  font-weight: 500;
}
.live-badge .dot {
  width: 6px; height: 6px;
  background: #10B981;
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.user-menu {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px;
  color: #4b5563;
}
.logout-btn {
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  color: #6b7280;
  font-size: 12px;
}
.logout-btn:hover { background: #f3f4f6; color: #b91c1c; }

/* NAVIGATION */
.main-nav {
  background: white;
  padding: 0 20px;
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #e5e7eb;
  overflow-x: auto;
}
.main-nav a {
  padding: 10px 16px;
  font-size: 13px;
  color: #4b5563;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-weight: 500;
  transition: all 0.15s;
}
.main-nav a:hover { color: #185FA5; }
.main-nav a.active {
  color: #185FA5;
  border-bottom-color: #185FA5;
}
.main-nav a i { margin-right: 6px; }

/* MAIN CONTENT */
.main-content {
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

/* PAGE HEADER */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header h1 {
  font-size: 22px;
  font-weight: 600;
  color: #111827;
}
.page-header p {
  margin-top: 4px;
  font-size: 13px;
  color: #6b7280;
}

/* CARDS */
.card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 16px;
}

/* STAT CARDS */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
}
.stat-card-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.stat-card-head i {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.stat-card-label { font-size: 12px; color: #6b7280; }
.stat-card-sub { font-size: 11px; color: #9ca3af; margin-top: 2px; }
.stat-card-value { font-size: 28px; font-weight: 600; margin-top: 6px; }

/* SITES GRID */
.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.site-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 18px;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.site-card:hover {
  border-color: #185FA5;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.site-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.site-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.site-live-badge {
  display: flex; align-items: center; gap: 4px;
  font-size: 10px;
  color: #065F46;
}
.site-live-badge .dot {
  width: 6px; height: 6px;
  background: #10B981;
  border-radius: 50%;
}
.site-name { font-size: 14px; font-weight: 600; }
.site-domain { font-size: 11px; color: #6b7280; margin: 2px 0 10px; }
.site-stats { font-size: 11px; color: #6b7280; }

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  color: #374151;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.15s;
  text-decoration: none;
}
.btn:hover { background: #f9fafb; }
.btn-primary {
  background: #185FA5;
  color: white;
  border-color: #185FA5;
}
.btn-primary:hover { background: #154E89; }
.btn-success {
  background: #10B981;
  color: white;
  border-color: #10B981;
}
.btn-success:hover { background: #059669; }
.btn-danger {
  background: #DC2626;
  color: white;
  border-color: #DC2626;
}
.btn-warning {
  background: #F59E0B;
  color: white;
  border-color: #F59E0B;
}
.btn-sm { padding: 5px 10px; font-size: 11px; }
.btn-lg { padding: 12px 20px; font-size: 14px; }
.btn-block { width: 100%; justify-content: center; }

/* FORMS */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 5px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.form-label.required { color: #DC2626; }
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: white;
}
.form-control:focus {
  outline: none;
  border-color: #185FA5;
  box-shadow: 0 0 0 3px rgba(24,95,165,0.1);
}
.form-control-lg { font-size: 16px; padding: 11px 14px; font-weight: 500; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* TABLES */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table thead th {
  background: #F9FAFB;
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 1px solid #e5e7eb;
}
.data-table tbody td {
  padding: 12px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 13px;
  vertical-align: middle;
}
.data-table tbody tr:hover { background: #FAFBFC; }

/* BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}
.badge-live { background: #ECFDF5; color: #065F46; }
.badge-scheduled { background: #EFF6FF; color: #1E40AF; }
.badge-draft { background: #FEF3C7; color: #92400E; }
.badge-breaking { background: #FEE2E2; color: #991B1B; }
.badge-trending { background: #FEF3C7; color: #92400E; }

/* LOGIN */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #E6F1FB 0%, #F7F8FA 100%);
}
.login-card {
  background: white;
  padding: 36px;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.08);
  width: 100%;
  max-width: 380px;
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo i {
  width: 56px; height: 56px;
  background: #E6F1FB;
  color: #185FA5;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 12px;
}
.login-logo h1 { font-size: 20px; font-weight: 600; }
.login-logo p { font-size: 12px; color: #6b7280; margin-top: 4px; }
.login-error {
  background: #FEE2E2;
  color: #991B1B;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 12px;
  margin-bottom: 14px;
}
.login-success {
  background: #D1FAE5;
  color: #065F46;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 12px;
  margin-bottom: 14px;
}

/* SITE ADMIN LAYOUT (when inside a site) */
.site-admin-wrapper {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  margin-top: 16px;
}
.site-sidebar {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px 0;
  align-self: start;
}
.site-sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13px;
  color: #4b5563;
  border-left: 3px solid transparent;
}
.site-sidebar a:hover { background: #F9FAFB; }
.site-sidebar a.active {
  background: var(--site-bg, #E6F1FB);
  color: var(--site-color, #185FA5);
  border-left-color: var(--site-color, #185FA5);
  font-weight: 600;
}
.site-sidebar a i { width: 16px; text-align: center; }

.site-header-bar {
  background: var(--site-bg, #E6F1FB);
  padding: 12px 16px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}
.site-header-bar-left {
  display: flex; align-items: center; gap: 12px;
}
.site-header-icon {
  width: 34px; height: 34px;
  background: var(--site-color, #185FA5);
  color: white;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}

/* LIVE FEED */
.feed-item {
  display: grid;
  grid-template-columns: 90px 130px 1fr 90px 90px;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  align-items: center;
}
.feed-item:hover { background: #FAFBFC; }
.feed-item:last-child { border-bottom: none; }
.feed-item-new { background: #ECFDF5; }

.feed-time { font-size: 12px; font-weight: 500; }
.feed-time-rel { font-size: 10px; color: #9ca3af; margin-top: 2px; }

.site-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
}

.feed-title { font-size: 13px; line-height: 1.5; }
.feed-cat { font-size: 11px; color: #9ca3af; margin-top: 3px; }

/* FILTER BAR */
.filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}
.filter-label {
  font-size: 11px;
  color: #6b7280;
  font-weight: 500;
  margin-right: 4px;
}
.filter-btn {
  padding: 5px 12px;
  font-size: 11px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  color: #4b5563;
  font-weight: 500;
}
.filter-btn:hover { background: #f9fafb; }
.filter-btn.active {
  background: #185FA5;
  color: white;
  border-color: #185FA5;
}

/* RICH TEXT EDITOR */
.ck-editor__editable_inline {
  min-height: 200px !important;
}

/* IMAGE UPLOAD */
.image-upload-zone {
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  padding: 18px;
  text-align: center;
  cursor: pointer;
  background: #F9FAFB;
  transition: all 0.15s;
}
.image-upload-zone:hover {
  border-color: #185FA5;
  background: #EFF6FF;
}
.image-upload-zone i {
  font-size: 28px;
  color: #9ca3af;
  margin-bottom: 6px;
}
.image-upload-zone p {
  font-size: 12px;
  color: #6b7280;
}
.image-preview {
  max-width: 100%;
  max-height: 150px;
  border-radius: 6px;
  margin-bottom: 8px;
}

/* CHARTS */
.chart-container {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
}
.chart-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

/* FORM ROW */
.form-row {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
}
@media (max-width: 900px) {
  .form-row { grid-template-columns: 1fr; }
  .site-admin-wrapper { grid-template-columns: 1fr; }
  .feed-item { grid-template-columns: 1fr; gap: 6px; padding: 12px; }
}

/* FOOTER */
.main-footer {
  text-align: center;
  padding: 20px;
  font-size: 11px;
  color: #9ca3af;
}

/* CHECKBOX/RADIO custom */
input[type="checkbox"], input[type="radio"] {
  width: 16px; height: 16px;
  accent-color: #185FA5;
  cursor: pointer;
}
label.check-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
}

/* ALERTS */
.alert {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 13px;
  border: 1px solid;
}
.alert-success { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.alert-error { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }
.alert-warning { background: #FFFBEB; border-color: #FDE68A; color: #92400E; }
.alert-info { background: #EFF6FF; border-color: #BFDBFE; color: #1E40AF; }

/* EMPTY STATE */
.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: #9ca3af;
}
.empty-state i {
  font-size: 36px;
  margin-bottom: 12px;
  opacity: 0.4;
}

/* QUICK ACTIONS */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.quick-action-btn {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  color: inherit;
}
.quick-action-btn:hover {
  border-color: #185FA5;
  transform: translateY(-1px);
}
.quick-action-btn i {
  font-size: 20px;
  margin-bottom: 8px;
  display: block;
}
.quick-action-btn h4 { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.quick-action-btn p { font-size: 11px; color: #6b7280; }
