/* ================================================================
   LinkedIn Audit Tool — Mobile Mode
   استثنائي · إبداعي · مصمم للهاتف المحمول
================================================================ */

/* ══ MOBILE TOGGLE BUTTON (always visible) ══════════════════════ */
.mobile-fab {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0A66C2, #0EA5E9);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 20px rgba(10,102,194,.5);
  z-index: 1000;
  transition: all .3s cubic-bezier(.34,1.56,.64,1);
  color: #fff;
}
.mobile-fab:hover { transform: scale(1.1); box-shadow: 0 6px 28px rgba(10,102,194,.65); }
.mobile-fab.active { background: linear-gradient(135deg, #7c3aed, #a855f7); }
@media (min-width: 769px) { .mobile-fab { display: flex; } }

/* ══════════════════════════════════════════════════════════════
   MOBILE MODE — بنية الصفحة
══════════════════════════════════════════════════════════════ */
body.mobile-mode {
  background: #0a0f1a;
  overflow-x: hidden;
}

/* Hide desktop sidebar, show mobile nav */
body.mobile-mode .app-wrapper {
  display: block;
  padding-bottom: 90px; /* space for bottom nav */
}
body.mobile-mode .sidebar {
  display: none !important;
}

/* ══ MOBILE TOP HEADER ══════════════════════════════════════════ */
.mob-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 900;
  background: rgba(10,15,26,.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(59,154,225,.15);
  padding: 10px 16px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
body.mobile-mode .mob-header { display: flex; }

.mob-logo {
  display: flex; align-items: center; gap: 8px;
}
.mob-logo-box {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 900; color: #fff;
  flex-shrink: 0;
}
.mob-logo-text { font-size: .82rem; font-weight: 800; color: var(--t1); line-height: 1.2; }
.mob-logo-sub  { font-size: .62rem; color: var(--t3); }

/* Compact mini score in header */
.mob-header-score {
  display: flex; align-items: center; gap: 6px;
  background: rgba(10,102,194,.15);
  border: 1px solid rgba(10,102,194,.25);
  border-radius: 20px;
  padding: 4px 12px 4px 8px;
}
.mob-header-ring {
  width: 28px; height: 28px; flex-shrink: 0;
}
.mob-header-score-num {
  font-size: .9rem; font-weight: 900;
  font-family: var(--mono);
  color: var(--primary-light);
}

/* ══ MOBILE MAIN CONTENT ══════════════════════════════════════════ */
body.mobile-mode .main-content {
  padding: 70px 0 0;
  background: #0a0f1a;
}

/* ══ MOBILE SCORE HERO ══════════════════════════════════════════ */
.mob-score-hero {
  display: none;
  padding: 20px 16px 16px;
  background: linear-gradient(160deg, #0D1628 0%, #111E36 100%);
  border-bottom: 1px solid rgba(59,154,225,.1);
  position: relative;
  overflow: hidden;
}
.mob-score-hero::before {
  content: '';
  position: absolute;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(10,102,194,.2) 0%, transparent 70%);
  top: -100px; right: -60px;
  pointer-events: none;
}
body.mobile-mode .mob-score-hero { display: block; }
body.mobile-mode .overview-grid  { display: none; }

.mob-hero-inner {
  display: flex; align-items: center; gap: 16px;
  position: relative; z-index: 1;
}
.mob-ring-wrap {
  flex-shrink: 0;
  width: 100px; height: 100px; position: relative;
}
.mob-ring-svg { width: 100px; height: 100px; }
.mob-ring-num {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.mob-ring-score { font-size: 1.4rem; font-weight: 900; font-family: var(--mono); color: #fff; line-height: 1; }
.mob-ring-of    { font-size: .55rem; color: rgba(255,255,255,.4); }
.mob-hero-info  { flex: 1; min-width: 0; }
.mob-hero-name  { font-size: 1.05rem; font-weight: 800; color: #fff; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mob-hero-label { font-size: .72rem; font-weight: 700; margin-bottom: 10px; }
.mob-stats-row  { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 14px; }
.mob-stat {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px; padding: 7px 4px; text-align: center;
}
.mob-stat-val { font-size: .95rem; font-weight: 900; font-family: var(--mono); line-height: 1; margin-bottom: 2px; }
.mob-stat-lbl { font-size: .52rem; color: rgba(255,255,255,.4); line-height: 1.2; }

/* ══ MOBILE SECTION PILLS ═══════════════════════════════════════ */
.mob-section-pills {
  display: none;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(10,15,26,.98);
  position: sticky;
  top: 56px;
  z-index: 800;
  border-bottom: 1px solid rgba(59,154,225,.1);
}
.mob-section-pills::-webkit-scrollbar { display: none; }
body.mobile-mode .mob-section-pills { display: flex; }

.mob-pill {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 14px;
  border-radius: 20px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  color: var(--t2);
  font-size: .75rem; font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: all .25s;
  flex-shrink: 0;
}
.mob-pill.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 3px 12px rgba(10,102,194,.4);
}

/* ══ MOBILE CRITERIA CARDS ══════════════════════════════════════ */
body.mobile-mode .criteria-grid {
  grid-template-columns: 1fr;
  gap: 0;
  padding: 0;
}
body.mobile-mode .criterion-card {
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  border-bottom: 1px solid rgba(59,154,225,.08);
  backdrop-filter: none;
  background: transparent;
  box-shadow: none;
  padding: 14px 16px;
  margin: 0;
  transition: background .15s;
}
body.mobile-mode .criterion-card:active { background: rgba(10,102,194,.06); }

/* Card top: more compact */
body.mobile-mode .crit-top { margin-bottom: 10px; gap: 10px; }
body.mobile-mode .crit-num { font-size: .7rem; width: 22px; height: 22px; border-radius: 6px; }
body.mobile-mode .crit-title { font-size: .88rem; line-height: 1.3; }
body.mobile-mode .crit-desc  { font-size: .7rem; }

/* Mobile score controls — large touch targets */
body.mobile-mode .score-controls { gap: 10px; }
body.mobile-mode .slider-row { gap: 10px; }

/* Big tap buttons for mobile */
body.mobile-mode .btn-row {
  gap: 6px;
}
body.mobile-mode .score-btn {
  flex: 1;
  height: 42px;
  font-size: .9rem;
  font-weight: 800;
  border-radius: 10px;
  min-width: 0;
}
body.mobile-mode .score-btn.zero { flex: 0 0 42px; }
body.mobile-mode .score-btn.max  { flex: 0 0 42px; }

/* Mobile slider — thicker track */
body.mobile-mode .score-slider {
  height: 6px;
  border-radius: 3px;
}
body.mobile-mode .score-slider::-webkit-slider-thumb {
  width: 26px; height: 26px;
}

/* Mobile notes — collapsed by default, tap to expand */
body.mobile-mode .notes-input {
  font-size: .82rem;
  min-height: 52px;
  border-radius: 8px;
}

/* ══ MOBILE SECTION HEADERS ══════════════════════════════════════ */
body.mobile-mode .section-header {
  margin: 0;
  padding: 14px 16px 10px;
  border-radius: 0;
  background: rgba(10,102,194,.06);
  border-left: none; border-right: none;
  border-top: 1px solid rgba(59,154,225,.12);
  border-bottom: 1px solid rgba(59,154,225,.08);
  position: sticky;
  top: calc(56px + 44px); /* header + pills */
  z-index: 700;
  backdrop-filter: blur(10px);
}
body.mobile-mode .section-icon { width: 32px; height: 32px; font-size: .85rem; border-radius: 8px; }
body.mobile-mode .section-title { font-size: .88rem; }

/* ══ MOBILE CHARTS — full-width scrollable ══════════════════════ */
body.mobile-mode .charts-section {
  grid-template-columns: 1fr;
  gap: 0;
  margin: 0;
  padding: 0;
}
body.mobile-mode .chart-card {
  border-radius: 0;
  border-left: none; border-right: none; border-top: none;
  border-bottom: 1px solid rgba(59,154,225,.1);
  padding: 16px;
  background: rgba(13,20,40,.8);
}
body.mobile-mode .chart-card:first-child { border-top: 1px solid rgba(59,154,225,.1); }
body.mobile-mode .chart-title { font-size: .82rem; margin-bottom: 12px; }

/* ══ MOBILE TOPBAR ══════════════════════════════════════════════ */
body.mobile-mode .topbar { display: none !important; }

/* Hide desktop company banner on mobile mode */
body.mobile-mode [data-mob="hide"] { display: none !important; }

/* ══ BOTTOM NAV BAR ══════════════════════════════════════════════
   Native app-like navigation at the bottom
══════════════════════════════════════════════════════════════ */
.mob-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 950;
  background: rgba(10,15,26,.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(59,154,225,.18);
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  justify-content: space-around;
  align-items: center;
}
body.mobile-mode .mob-nav { display: flex; }

.mob-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all .2s;
  border: none; background: transparent;
  color: var(--t3); font-family: var(--font);
  min-width: 56px;
  -webkit-tap-highlight-color: transparent;
}
.mob-nav-item .nav-ico { font-size: 1.3rem; line-height: 1; }
.mob-nav-item .nav-lbl { font-size: .58rem; font-weight: 700; line-height: 1; }
.mob-nav-item.active {
  color: var(--primary-light);
  background: rgba(10,102,194,.12);
}
.mob-nav-item.nav-generate {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff !important;
  border-radius: 14px;
  padding: 8px 20px;
  box-shadow: 0 4px 16px rgba(10,102,194,.45);
}

/* ══ MOBILE SLIDE DRAWER (settings/info) ════════════════════════ */
.mob-drawer {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 970;
  background: #111827;
  border-radius: 20px 20px 0 0;
  border-top: 1px solid rgba(59,154,225,.2);
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.32,.72,0,1);
  max-height: 85vh;
  overflow-y: auto;
  padding: 0 0 max(20px, env(safe-area-inset-bottom));
}
body.mobile-mode .mob-drawer { display: block; }
.mob-drawer.open { transform: translateY(0); }

.mob-drawer-handle {
  width: 36px; height: 4px; border-radius: 2px;
  background: rgba(255,255,255,.2);
  margin: 10px auto 14px;
}
.mob-drawer-title {
  font-size: .9rem; font-weight: 800;
  color: var(--t1); padding: 0 20px 12px;
  border-bottom: 1px solid rgba(59,154,225,.1);
  margin-bottom: 4px;
}
.mob-drawer-content { padding: 8px 0; }
.mob-drawer-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  cursor: pointer;
  transition: background .15s;
  color: var(--t1);
  border: none; background: transparent;
  font-family: var(--font); font-size: .88rem; font-weight: 600;
  width: 100%; text-align: right;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.mob-drawer-item:active { background: rgba(59,154,225,.08); }
.mob-drawer-item .di-ico { font-size: 1.1rem; flex-shrink: 0; }
.mob-drawer-item .di-lbl { flex: 1; }
.mob-drawer-item .di-badge {
  font-size: .68rem; padding: 2px 8px; border-radius: 10px;
  background: rgba(10,102,194,.2); color: var(--primary-light);
  font-weight: 700;
}

/* Drawer overlay */
.mob-drawer-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 960;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
}
body.mobile-mode .mob-drawer-overlay { display: block; }
.mob-drawer-overlay.visible { opacity: 1; pointer-events: all; }
.mob-drawer-overlay:not(.visible) { opacity: 0; pointer-events: none; }
.mob-drawer-overlay { transition: opacity .25s; }

/* ══ MOBILE FORM (in drawer) ═════════════════════════════════════ */
.mob-form-grid {
  padding: 8px 16px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.mob-form-grid .form-group { margin: 0; }
.mob-form-grid .form-label { font-size: .76rem; }
.mob-form-grid .form-input {
  font-size: .9rem;
  padding: 10px 12px;
  border-radius: 10px;
}

/* ══ LIVE CHART INDICATOR ════════════════════════════════════════ */
.chart-live-dot {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .68rem; font-weight: 700;
  color: var(--green); margin-bottom: 8px;
}
.chart-live-dot::before {
  content: '';
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  animation: livePulse 2s ease-in-out infinite;
}
@keyframes livePulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:.4; transform:scale(.7); }
}

/* ══ MOBILE REPORT SECTION ══════════════════════════════════════ */
body.mobile-mode .report-tabs {
  overflow-x: auto; scrollbar-width: none;
  flex-wrap: nowrap; padding-bottom: 2px;
}
body.mobile-mode .report-tabs::-webkit-scrollbar { display: none; }
body.mobile-mode .report-tab { white-space: nowrap; flex-shrink: 0; }
body.mobile-mode .report-section-wrapper { padding: 0 0 24px; }
body.mobile-mode .report-section-wrapper > div:last-of-type { border-radius: 0; }
body.mobile-mode .section-header[style*="margin-top:40px"] { margin-top: 24px !important; }

/* ══ SMOOTH SECTION TRANSITIONS ═════════════════════════════════ */
.mob-section-transition {
  animation: mobSectionIn .3s ease;
}
@keyframes mobSectionIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══ SWIPE HINT ══════════════════════════════════════════════════ */
.mob-swipe-hint {
  display: none;
  text-align: center;
  font-size: .7rem; color: var(--t3);
  padding: 10px;
  animation: fadeInOut 3s ease 1s both;
}
body.mobile-mode .mob-swipe-hint { display: block; }
@keyframes fadeInOut { 0%,100%{opacity:0} 20%,80%{opacity:1} }

/* ══ MISC MOBILE TWEAKS ══════════════════════════════════════════ */
body.mobile-mode .report-section-wrapper .section-header {
  position: static;
}
body.mobile-mode .topbar { display: none !important; }
body.mobile-mode .charts-section { margin-top: 0; border-top: 1px solid rgba(59,154,225,.1); }

/* Compact stat cards on mobile */
body.mobile-mode .stats-row { display: none; }
body.mobile-mode .score-ring-card { display: none; }

/* ══ PRINT: never show mobile UI ════════════════════════════════ */
@media print {
  .mobile-fab, .mob-header, .mob-nav, .mob-drawer, .mob-drawer-overlay,
  .mob-section-pills, .mob-score-hero { display: none !important; }
}
