/* ============================================================
   MeriSarkariYojana.in - msy-custom.css
   Child theme folder me daal do: /wp-content/themes/your-child/msy-custom.css
   ============================================================ */

/* ── Root Variables ─────────────────────────────────────── */
:root {
  --msy-orange:    #FF6B00;
  --msy-green:     #1A8C3E;
  --msy-dark:      #0D1B2A;
  --msy-light:     #F5F7FA;
  --msy-white:     #FFFFFF;
  --msy-border:    #E2E8F0;
  --msy-text:      #1A202C;
  --msy-muted:     #718096;
  --msy-radius:    8px;
  --msy-shadow:    0 2px 12px rgba(0,0,0,0.08);
  --msy-shadow-lg: 0 8px 32px rgba(0,0,0,0.15);
  --msy-wa-green:  #25D366;
}

/* ── Last Updated Bar ────────────────────────────────────── */
.msy-update-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  background: linear-gradient(135deg, #FFF8F0 0%, #FFF3E0 100%);
  border: 1px solid #FFD580;
  border-left: 4px solid var(--msy-orange);
  border-radius: var(--msy-radius);
  padding: 10px 16px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--msy-text);
  font-weight: 500;
}
.msy-update-bar span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Language Switcher ───────────────────────────────────── */
.msy-lang-switcher {
  display: flex;
  gap: 4px;
  align-items: center;
}
.msy-lang-btn {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.5);
  color: #fff;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.msy-lang-btn:hover,
.msy-lang-btn.active {
  background: var(--msy-orange);
  border-color: var(--msy-orange);
  color: #fff;
}

/* ── WhatsApp Popup ──────────────────────────────────────── */
.msy-wa-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 99998;
  backdrop-filter: blur(3px);
}
.msy-wa-popup {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: min(420px, 95vw);
  background: var(--msy-white);
  border-radius: 20px 20px 0 0;
  z-index: 99999;
  padding: 28px 24px 32px;
  text-align: center;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.2);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.msy-wa-popup.open {
  transform: translateX(-50%) translateY(0);
}
.msy-wa-popup::before {
  content: '';
  display: block;
  width: 40px;
  height: 4px;
  background: var(--msy-border);
  border-radius: 2px;
  margin: 0 auto 20px;
}
.msy-wa-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: var(--msy-light);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--msy-muted);
  transition: background 0.2s;
}
.msy-wa-close:hover { background: var(--msy-border); }
.msy-wa-icon {
  background: #E8FFF0;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  animation: msyPulse 2s infinite;
}
@keyframes msyPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37,211,102,0.4); }
  50%       { box-shadow: 0 0 0 12px rgba(37,211,102,0); }
}
.msy-wa-popup h3 {
  font-size: 22px;
  font-weight: 800;
  color: var(--msy-dark);
  margin: 0 0 8px;
  line-height: 1.3;
}
.msy-wa-popup p {
  font-size: 14px;
  color: var(--msy-muted);
  margin: 0 0 20px;
  line-height: 1.6;
}
.msy-wa-join-btn {
  display: block;
  width: 100%;
  background: linear-gradient(135deg, #25D366 0%, #1DA851 100%);
  color: #fff !important;
  text-decoration: none !important;
  font-size: 16px;
  font-weight: 700;
  padding: 14px 20px;
  border-radius: 50px;
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(37,211,102,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  letter-spacing: 0.3px;
}
.msy-wa-join-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(37,211,102,0.5);
}
.msy-wa-skip {
  background: none;
  border: none;
  color: var(--msy-muted);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px;
}

/* ── Disclaimer / T&C Pages ──────────────────────────────── */
.msy-legal-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 24px;
  font-family: inherit;
}
.msy-legal-page h1 {
  font-size: 32px;
  font-weight: 800;
  color: var(--msy-dark);
  margin-bottom: 8px;
}
.msy-legal-page .msy-legal-meta {
  font-size: 13px;
  color: var(--msy-muted);
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--msy-border);
}
.msy-legal-page h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--msy-dark);
  margin: 32px 0 12px;
  padding-left: 12px;
  border-left: 4px solid var(--msy-orange);
}
.msy-legal-page p, .msy-legal-page li {
  font-size: 15px;
  line-height: 1.8;
  color: #374151;
}
.msy-legal-page ul {
  padding-left: 20px;
  margin: 8px 0 16px;
}
.msy-legal-page a { color: var(--msy-orange); }
.msy-legal-highlight {
  background: #FFF8F0;
  border: 1px solid #FFD580;
  border-radius: var(--msy-radius);
  padding: 16px 20px;
  margin: 20px 0;
  font-weight: 500;
}

/* ── Author Card (Author Pages) ──────────────────────────── */
.msy-author-card {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: var(--msy-white);
  border: 1px solid var(--msy-border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: var(--msy-shadow);
}
.msy-author-avatar img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--msy-orange);
}
.msy-author-info h2 {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 4px;
}
.msy-author-role {
  font-size: 13px;
  color: var(--msy-orange);
  font-weight: 600;
  margin-bottom: 8px;
  display: block;
}
.msy-author-bio {
  font-size: 14px;
  color: var(--msy-muted);
  line-height: 1.7;
  margin: 0;
}
.msy-author-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.msy-badge {
  background: var(--msy-light);
  color: var(--msy-dark);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--msy-border);
}
.msy-badge.verified {
  background: #E8FFF0;
  color: var(--msy-green);
  border-color: #B7F5CC;
}

/* ── Post Card Thumbnail Fix ─────────────────────────────── */
.post-thumbnail img,
.msy-post-thumb img,
article .wp-post-image {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--msy-radius);
  display: block;
}

/* ── Ticker (Latest Posts) ───────────────────────────────── */
.msy-ticker-wrap {
  background: var(--msy-dark);
  color: #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
  height: 36px;
}
.msy-ticker-label {
  background: var(--msy-orange);
  padding: 0 14px;
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
  height: 100%;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.msy-ticker-content {
  display: flex;
  animation: msyTicker 40s linear infinite;
  white-space: nowrap;
  align-items: center;
  height: 100%;
}
.msy-ticker-content:hover { animation-play-state: paused; }
.msy-ticker-item {
  padding: 0 24px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}
.msy-ticker-item a {
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.msy-ticker-item a:hover { color: #FFD580; }
.msy-ticker-time {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  font-weight: 400;
}
.msy-ticker-sep {
  color: var(--msy-orange);
  font-size: 16px;
}
@keyframes msyTicker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── Home Speed - Lazy Load Placeholders ─────────────────── */
img[loading="lazy"] {
  min-height: 150px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: msySkeleton 1.5s infinite;
}
@keyframes msySkeleton {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Mobile Responsive ───────────────────────────────────── */
@media (max-width: 768px) {
  .msy-author-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .msy-author-badges { justify-content: center; }
  .msy-legal-page h1 { font-size: 24px; }
  .msy-lang-btn { padding: 3px 8px; font-size: 11px; }
  .msy-wa-popup { padding: 20px 16px 24px; }
  .msy-wa-popup h3 { font-size: 18px; }
}

/* ============================================================
   MSY v5 ADDITIONS - Lang Switcher, Popup, Last Updated Time
   ============================================================ */

/* ── Lang Switcher in Header ─────────────────────────────── */
.msy-lang-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 3px;
  border: 1px solid rgba(255,255,255,0.2);
}
.msy-lang-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.75);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 16px;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.msy-lang-btn.active {
  background: #FF6B00;
  color: #fff;
}
.msy-lang-btn:hover:not(.active) { color: #fff; background: rgba(255,255,255,0.15); }

/* ── WhatsApp Popup Enhancements ─────────────────────────── */
.msy-wa-popup {
  position: fixed;
  bottom: 30px;
  right: 24px;
  width: 320px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  z-index: 99999;
  transform: translateY(30px);
  opacity: 0;
  transition: transform .4s cubic-bezier(.34,1.56,.64,1), opacity .3s;
}
.msy-wa-popup.open { transform: translateY(0); opacity: 1; }
.msy-wa-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99998;
  backdrop-filter: blur(2px);
}
.msy-wa-popup-inner {
  padding: 24px 20px 20px;
  text-align: center;
}
.msy-wa-close {
  position: absolute; top: 10px; right: 14px;
  background: #f1f1f1; border: none; border-radius: 50%;
  width: 28px; height: 28px;
  cursor: pointer; font-size: 14px; line-height: 28px;
  color: #555;
}
.msy-wa-badge {
  background: linear-gradient(90deg,#FF6B00,#ff8c00);
  color: #fff; border-radius: 20px;
  font-size: 11px; font-weight: 700;
  padding: 4px 12px; margin-bottom: 10px;
  display: inline-block;
}
.msy-wa-popup h3 { font-size: 16px; font-weight: 700; margin: 8px 0 6px; color: #1a1a1a; }
.msy-wa-popup p  { font-size: 13px; color: #555; margin-bottom: 12px; }
.msy-wa-features {
  display: flex; justify-content: center; gap: 8px;
  flex-wrap: wrap; margin-bottom: 14px;
}
.msy-wa-features span { font-size: 11px; color: #25D366; font-weight: 600; }
.msy-wa-join-btn {
  display: block;
  background: linear-gradient(135deg,#25D366,#128C7E);
  color: #fff; text-decoration: none;
  padding: 12px; border-radius: 10px;
  font-size: 15px; font-weight: 700;
  margin-bottom: 8px;
  transition: transform .2s, box-shadow .2s;
}
.msy-wa-join-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(37,211,102,0.4); color:#fff; }
.msy-wa-tg-btn {
  display: block;
  background: linear-gradient(135deg,#229ED9,#0088cc);
  color: #fff; text-decoration: none;
  padding: 10px; border-radius: 10px;
  font-size: 13px; font-weight: 600;
  margin-bottom: 10px;
}
.msy-wa-tg-btn:hover { color:#fff; opacity:.9; }
.msy-wa-skip {
  background: none; border: none;
  color: #aaa; font-size: 12px;
  cursor: pointer; text-decoration: underline;
}

/* ── Last Updated with TIME highlight ────────────────────── */
.msy-last-updated { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 13px; color: #555; padding: 8px 12px; background: #f9f9f9; border-radius: 8px; margin-bottom: 12px; border-left: 3px solid #FF6B00; }
.msy-lu-highlight { color: #e65c00; font-weight: 500; }
.msy-lu-highlight strong { color: #c0392b; }
.msy-lu-sep { color: #ccc; }
.msy-lu-read { color: #888; }

/* ── Thumbnail fix ───────────────────────────────────────── */
.msy-feat-img { border-radius: 12px; overflow: hidden; margin-bottom: 22px; }
.msy-feat-img img { width: 100%; height: auto; display: block; object-fit: cover; }
.msy-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Mobile lang switcher */
@media(max-width:768px) {
  .msy-lang-switcher { order: -1; }
  .msy-lang-btn { font-size: 10px; padding: 3px 6px; }
  .msy-wa-popup { right: 12px; left: 12px; width: auto; }
}
