/* ==============================================================================
   BHARTIYA KISAN SANGH (भारतीय किसान संघ)
   Sangathan Web Portal & Admin Panel Stylesheet
============================================================================== */

.portal-wrapper {
  display: flex;
  min-height: 100vh;
  background-color: #F3F4F6;
}

/* ==============================================================================
   PORTAL SIDEBAR
============================================================================== */
.portal-sidebar {
  width: 260px;
  background-color: #1E293B;
  color: #E2E8F0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: var(--transition);
  z-index: 1050;
}

.portal-sidebar-header {
  padding: 20px 18px;
  background-color: #0F172A;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #334155;
}

.portal-sidebar-logo {
  width: 40px;
  height: 40px;
  background: var(--bks-saffron);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  font-weight: 800;
}

.portal-sidebar-title h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #F8FAFC;
  line-height: 1.2;
}

.portal-sidebar-title span {
  font-size: 0.72rem;
  color: #94A3B8;
  font-weight: 600;
}

.portal-sidebar-nav {
  padding: 15px 10px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
  overflow-y: auto;
}

.portal-nav-heading {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 12px 4px 12px;
}

.portal-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: #CBD5E1;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.portal-nav-item:hover {
  background-color: #334155;
  color: #FFF;
}

.portal-nav-item.active {
  background-color: var(--bks-saffron);
  color: #FFF;
  box-shadow: 0 2px 6px rgba(216, 67, 21, 0.4);
}

.portal-nav-item .icon {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
}

.portal-nav-badge {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.2);
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

/* ==============================================================================
   PORTAL MAIN CONTENT
============================================================================== */
.portal-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.portal-topbar {
  background-color: #FFFFFF;
  border-bottom: 1px solid #E2E8F0;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.portal-topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.portal-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #475569;
}

.portal-location-tag {
  background: var(--bks-green-light);
  color: var(--bks-green);
  border: 1px solid var(--bks-green-border);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
}

.portal-topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bks-saffron);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.user-details {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #1E293B;
}

.user-role-label {
  font-size: 0.75rem;
  color: var(--bks-saffron);
  font-weight: 600;
}

.portal-body {
  padding: 24px;
  flex-grow: 1;
}

/* ==============================================================================
   ACTIONABLE ALERTS (BLOCK & DISTRICT)
============================================================================== */
.alert-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.action-alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-weight: 600;
  font-size: 0.92rem;
  box-shadow: var(--shadow-sm);
}

.action-alert.warning {
  background-color: #FFFBEB;
  border-left: 4px solid #F59E0B;
  color: #B45309;
}

.action-alert.danger {
  background-color: #FEF2F2;
  border-left: 4px solid #EF4444;
  color: #B91C1C;
}

.action-alert.info {
  background-color: #EFF6FF;
  border-left: 4px solid #3B82F6;
  color: #1D4ED8;
}

.action-alert-text {
  display: flex;
  align-items: center;
  gap: 10px;
}

.action-alert-btn {
  background: #fff;
  border: 1px solid currentColor;
  color: inherit;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
}

.action-alert-btn:hover {
  background: currentColor;
  color: #fff;
}

/* ==============================================================================
   METRIC STAT CARDS
============================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid #E2E8F0;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-info span.label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748B;
  display: block;
  margin-bottom: 4px;
}

.stat-info span.value {
  font-size: 1.7rem;
  font-weight: 800;
  color: #0F172A;
}

.stat-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stat-icon-wrapper.saffron {
  background: var(--bks-saffron-light);
  color: var(--bks-saffron);
}

.stat-icon-wrapper.green {
  background: var(--bks-green-light);
  color: var(--bks-green);
}

.stat-icon-wrapper.blue {
  background: #EFF6FF;
  color: #2563EB;
}

.stat-icon-wrapper.amber {
  background: #FFFBEB;
  color: #D97706;
}

/* ==============================================================================
   DATA TABLES
============================================================================== */
.portal-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  border: 1px solid #E2E8F0;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
}

.portal-card-header {
  padding: 18px 22px;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.portal-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0F172A;
  display: flex;
  align-items: center;
  gap: 8px;
}

.portal-table-responsive {
  width: 100%;
  overflow-x: auto;
}

.portal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.portal-table th {
  background-color: #F8FAFC;
  color: #475569;
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid #E2E8F0;
  white-space: nowrap;
}

.portal-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #F1F5F9;
  color: #1E293B;
  vertical-align: middle;
}

.portal-table tr:hover {
  background-color: #F8FAFC;
}

/* Status Badges */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.status-pill.active,
.status-pill.approved,
.status-pill.completed,
.status-pill.resolved {
  background-color: var(--bks-green-light);
  color: var(--bks-green);
}

.status-pill.pending,
.status-pill.submitted,
.status-pill.upcoming {
  background-color: #FFFBEB;
  color: #B45309;
}

.status-pill.in_progress,
.status-pill.under_review,
.status-pill.verified {
  background-color: #EFF6FF;
  color: #1D4ED8;
}

.status-pill.rejected,
.status-pill.cancelled,
.status-pill.overdue,
.status-pill.vacant {
  background-color: #FEF2F2;
  color: #B91C1C;
}

/* ==============================================================================
   21 DYNAMIC POSTS BUILDER
============================================================================== */
.posts-builder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 20px;
}

.post-builder-card {
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-md);
  padding: 16px;
  background: #FFF;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: var(--transition);
}

.post-builder-card.occupied {
  border-left: 4px solid var(--bks-green);
}

.post-builder-card.vacant {
  border-left: 4px solid #EF4444;
  background: #FAFAFA;
}

.post-builder-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.post-title-text {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--bks-saffron);
}

/* ==============================================================================
   DIGITAL ID CARD (MEMBERSHIP CARD)
============================================================================== */
.idcard-wrapper {
  max-width: 440px;
  margin: 20px auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  background: #FFFFFF;
  border: 2px solid var(--bks-saffron);
  overflow: hidden;
}

.idcard-header {
  background: linear-gradient(90deg, #D84315 0%, #1B5E20 100%);
  color: #FFFFFF;
  padding: 14px 18px;
  text-align: center;
}

.idcard-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0;
}

.idcard-header p {
  font-size: 0.75rem;
  margin: 0;
  opacity: 0.9;
}

.idcard-body {
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: center;
}

.idcard-photo-box {
  width: 90px;
  height: 110px;
  border: 2px solid #CBD5E1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: #94A3B8;
  flex-shrink: 0;
}

.idcard-info {
  flex-grow: 1;
  font-size: 0.85rem;
  line-height: 1.4;
}

.idcard-info p {
  margin-bottom: 4px;
}

.idcard-info strong {
  color: #0F172A;
}

.idcard-footer {
  background: #F8FAFC;
  border-top: 1px dashed #CBD5E1;
  padding: 10px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: #64748B;
}

/* ==============================================================================
   PORTAL RESPONSIVE STYLES
============================================================================== */
@media (max-width: 991px) {
  .portal-sidebar {
    position: fixed;
    top: 0;
    left: -270px;
    height: 100%;
    box-shadow: var(--shadow-lg);
  }
  
  .portal-sidebar.open {
    left: 0;
  }
  
  .portal-menu-toggle {
    display: block;
  }
}

/* ==============================================================================
   SEO MANAGEMENT MODULE STYLES
============================================================================== */
.seo-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid #E2E8F0;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.seo-tab-btn {
  background: none;
  border: none;
  padding: 10px 18px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #64748B;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.seo-tab-btn:hover {
  color: var(--bks-saffron);
}

.seo-tab-btn.active {
  color: var(--bks-saffron);
  border-bottom-color: var(--bks-saffron);
  background: #FFF7ED;
  border-radius: 8px 8px 0 0;
}

/* SEO AUDIT METRICS */
.seo-score-hero {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 24px;
}

.seo-score-circle {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 6px solid #22C55E;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(34, 197, 94, 0.1);
  flex-shrink: 0;
}

.seo-score-val {
  font-size: 2.2rem;
  font-weight: 800;
  color: #4ADE80;
  line-height: 1;
}

.seo-score-grade {
  font-size: 0.78rem;
  font-weight: 700;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.seo-check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  transition: var(--transition);
}

.seo-check-item:hover {
  border-color: #CBD5E1;
  box-shadow: var(--shadow-sm);
}

.seo-check-badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}

.seo-check-badge.pass { background: #DCFCE7; color: #15803D; }
.seo-check-badge.warning { background: #FEF3C7; color: #B45309; }
.seo-check-badge.critical { background: #FEE2E2; color: #B91C1C; }

/* SERP PREVIEW BOX */
.serp-preview-card {
  background: #fff;
  border: 1px solid #DFE1E5;
  border-radius: 12px;
  padding: 18px 20px;
  font-family: Arial, sans-serif;
  max-width: 650px;
  box-shadow: 0 1px 6px rgba(32,33,36,0.12);
}

.serp-url-breadcrumb {
  font-size: 0.82rem;
  color: #202124;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.serp-title {
  color: #1A0DAB;
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 6px;
  cursor: pointer;
  text-decoration: none;
  display: block;
}

.serp-title:hover {
  text-decoration: underline;
}

.serp-snippet {
  font-size: 0.88rem;
  color: #4D5156;
  line-height: 1.5;
}

/* SOCIAL OG CARD PREVIEW */
.og-preview-card {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  overflow: hidden;
  max-width: 520px;
  box-shadow: var(--shadow-md);
}

.og-preview-img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  background: #E2E8F0;
  display: block;
}

.og-preview-content {
  padding: 16px;
  background: #F8FAFC;
  border-top: 1px solid #E2E8F0;
}

.og-preview-domain {
  font-size: 0.75rem;
  color: #64748B;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.og-preview-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 6px;
  line-height: 1.35;
}

.og-preview-desc {
  font-size: 0.84rem;
  color: #475569;
  line-height: 1.45;
}

/* XML CODE VIEWER */
.seo-code-box {
  background: #0F172A;
  color: #38BDF8;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.84rem;
  line-height: 1.6;
  padding: 16px;
  border-radius: 8px;
  max-height: 380px;
  overflow-y: auto;
  white-space: pre;
  border: 1px solid #334155;
}

.char-counter {
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-block;
  margin-top: 4px;
}
.char-counter.good { color: #16A34A; }
.char-counter.warn { color: #D97706; }
.char-counter.bad { color: #DC2626; }
