/* ============================================================
   NEWZQUEST & NSHORT - REPLICATED INSHORTS DESIGN SYSTEM v3.0
   ============================================================ */

:root {
  /* Brand Tokens */
  --primary: #D90429;
  --primary-dark: #B80323;
  --primary-glow: rgba(217, 4, 41, 0.25);
  
  /* Neutral Color Palette */
  --bg-app: #E2E8F0;
  --bg-card: #FFFFFF;
  --bg-surface: #F8FAFC;
  --text-main: #0F172A;
  --text-muted: #475569;
  --text-subtle: #94A3B8;
  --border-color: #E2E8F0;

  /* Typography */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-deva: 'Noto Sans Devanagari', 'Inter', sans-serif;
  
  /* Dimensions */
  --header-height: 54px;
  --nav-height: 56px;
  --radius-card: 14px;
}

/* Dark Theme */
html[data-theme="dark"] {
  --bg-app: #090D16;
  --bg-card: #131C2E;
  --bg-surface: #1E293B;
  --text-main: #F8FAFC;
  --text-muted: #CBD5E1;
  --text-subtle: #64748B;
  --border-color: #1E293B;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-deva);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  user-select: none;
}

/* Mobile Application Shell */
#app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 480px; /* Standard Inshorts Mobile Aspect Ratio */
  margin: 0 auto;
  background-color: var(--bg-app);
  position: relative;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

/* Top App Header */
.app-header {
  height: var(--header-height);
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  position: relative;
  z-index: 100;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-zone {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.brand-logo-img {
  width: 32px !important;
  height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  object-fit: contain !important;
  flex-shrink: 0;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.brand-title span {
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lang-toggle-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--primary);
  font-weight: 800;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
}

/* Category Horizontal Scroller Pill Bar */
.category-bar {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  overflow-x: auto;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  scrollbar-width: none;
  flex-shrink: 0;
}

.category-bar::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  flex: 0 0 auto;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  cursor: pointer;
  white-space: nowrap;
}

.cat-pill.active {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  font-weight: 700;
}

/* App Main Viewport */
.app-view-body {
  flex: 1;
  overflow-y: auto;
  position: relative;
}

.tab-view {
  display: none;
  min-height: 100%;
}

.tab-view.active-tab {
  display: block;
}

/* ------------------------------------------------------------
   TAB 1: HOME FEED VIEW
   ------------------------------------------------------------ */
.feed-container {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-news-card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-color);
  overflow: hidden;
  cursor: pointer;
}

.hero-img-wrap {
  width: 100%;
  height: 190px;
  max-height: 190px;
  position: relative;
  background: var(--bg-surface);
  overflow: hidden;
}

.hero-img-wrap img {
  width: 100% !important;
  height: 100% !important;
  max-height: 190px !important;
  object-fit: cover !important;
}

.hero-content {
  padding: 12px 14px;
}

.hero-title {
  font-family: var(--font-deva);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--text-main);
  margin-bottom: 6px;
}

.dense-news-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.news-card-item {
  display: flex;
  gap: 10px;
  background: var(--bg-card);
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  cursor: pointer;
}

.news-card-thumb {
  width: 84px !important;
  height: 84px !important;
  max-width: 84px !important;
  max-height: 84px !important;
  border-radius: 8px;
  object-fit: cover !important;
  flex-shrink: 0;
  background: var(--bg-surface);
}

.news-card-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
}

.news-card-title {
  font-family: var(--font-deva);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-subtle);
}

/* ------------------------------------------------------------
   TAB 2: NSHORT SWIPEABLE CARD DECK (INSHORTS EXACT WIREFRAME)
   ------------------------------------------------------------ */
#tab-nshort {
  height: calc(100vh - var(--header-height) - var(--nav-height));
  position: relative;
  overflow: hidden;
}

.nshort-deck {
  height: 100%;
  width: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.nshort-deck::-webkit-scrollbar {
  display: none;
}

.nshort-card {
  height: 100%;
  width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  position: relative;
}

.nshort-media-wrapper {
  height: 46%;
  max-height: 46%;
  width: 100%;
  position: relative;
  background: var(--bg-surface);
  overflow: hidden;
  flex-shrink: 0;
}

.nshort-media-wrapper img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

.nshort-cat-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(15, 23, 42, 0.85);
  color: #FFFFFF;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.nshort-body-wrapper {
  flex: 1;
  padding: 14px 16px 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.nshort-headline {
  font-family: var(--font-deva);
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--text-main);
  margin-bottom: 6px;
}

.nshort-byline {
  font-size: 0.72rem;
  color: var(--text-subtle);
  margin-bottom: 8px;
}

.nshort-byline strong {
  color: var(--text-muted);
}

.nshort-summary {
  font-family: var(--font-deva);
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
  overflow-y: auto;
}

/* Inshorts Signature Footer Backlink Bar */
.nshort-footer-bar {
  height: 48px;
  background: #0F172A;
  color: #FFFFFF;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  flex-shrink: 0;
}

.nshort-footer-left {
  display: flex;
  flex-direction: column;
}

.nshort-footer-label {
  font-size: 0.65rem;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nshort-footer-link-text {
  font-size: 0.8rem;
  font-weight: 700;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nshort-footer-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nshort-action-icon {
  color: #94A3B8;
  font-size: 1.1rem;
  cursor: pointer;
}

.nshort-action-icon:hover {
  color: #FFFFFF;
}

/* ------------------------------------------------------------
   INSHORTS SIDE DRAWER OVERLAY & MENU
   ------------------------------------------------------------ */
.side-drawer-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 400;
  display: none;
  backdrop-filter: blur(4px);
}

.side-drawer-overlay.active {
  display: block;
}

.side-drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 270px;
  background: var(--bg-card);
  z-index: 450;
  transform: translateX(-100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.side-drawer.active {
  transform: translateX(0);
}

.drawer-header {
  padding: 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-header img {
  width: 36px !important;
  height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
  object-fit: contain !important;
}

.drawer-menu-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.drawer-item {
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
}

.drawer-item:hover, .drawer-item.active {
  background: var(--bg-surface);
  color: var(--primary);
}

.drawer-item i {
  width: 20px;
  color: var(--text-muted);
}

.drawer-item.active i {
  color: var(--primary);
}

/* ------------------------------------------------------------
   ARTICLE READ MODAL
   ------------------------------------------------------------ */
.article-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-card);
  z-index: 500;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  animation: slideUp 0.25s ease-out forwards;
}

.article-modal.active {
  display: flex;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.article-modal-header {
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}

.article-modal-body {
  padding: 16px;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.article-headline {
  font-family: var(--font-deva);
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 10px;
}

.article-hero-img {
  width: 100% !important;
  max-height: 240px !important;
  object-fit: cover !important;
  border-radius: 12px;
  margin-bottom: 14px;
}

.article-prose {
  font-size: 0.96rem;
  line-height: 1.7;
  color: var(--text-main);
}

.article-prose p {
  margin-bottom: 14px;
}

/* Bottom Navigation Bar */
.bottom-nav-bar {
  height: var(--nav-height);
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-around;
  position: relative;
  z-index: 200;
  flex-shrink: 0;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  flex: 1;
  height: 100%;
}

.nav-item i {
  font-size: 1.15rem;
}

.nav-item.active {
  color: var(--primary);
  font-weight: 700;
}

/* Social Share Sheet */
.share-modal-sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg-card);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  padding: 18px 16px;
  box-shadow: 0 -10px 30px rgba(0,0,0,0.2);
  z-index: 600;
  display: none;
}

.share-modal-sheet.active {
  display: block;
}

.share-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
  text-align: center;
}

.share-option-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.share-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #FFF;
}

.share-whatsapp { background: #25D366; }
.share-telegram { background: #229ED9; }
.share-twitter { background: #1DA1F2; }
.share-facebook { background: #1877F2; }

.cta-button {
  background: var(--primary);
  color: #FFFFFF;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  display: block;
  text-align: center;
  box-shadow: 0 4px 12px var(--primary-glow);
  margin-top: 10px;
}

.settings-group {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}

.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  transition: .3s; border-radius: 22px;
}
.slider:before {
  position: absolute; content: "";
  height: 16px; width: 16px;
  left: 2px; bottom: 2px;
  background-color: var(--text-muted);
  transition: .3s; border-radius: 50%;
}
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(20px); background-color: #FFF; }
