/* /var/www/html/deeplaw/public/routes/social/social.css */

/* ---------------------------
   Base / Reset
---------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root{
  --bg: #f3f4f6;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --border-2: #d1d5db;
  --primary: #1d4ed8;
  --primary-2: #1e40af;
  --dark: #111827;
  --shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
  --r-lg: 16px;
  --r-md: 12px;
  --r-pill: 999px;
}

html, body {
  height: 100%;
}

body.social-body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  text-rendering: optimizeLegibility;
}

/* a11y */
:focus-visible{
  outline: 2px solid rgba(37,99,235,.35);
  outline-offset: 2px;
}

/* ---------------------------
   Header
---------------------------- */
.social-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--dark);
  color: #f9fafb;
  width: 100%;
}

.social-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.logo {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: .2px;
}

.social-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.nav-item {
  padding: 6px 10px;
  border-radius: var(--r-pill);
  font-size: 13px;
  text-decoration: none;
  color: #e5e7eb;
  border: 1px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.nav-item:hover {
  background: #1f2937;
  border-color: #374151;
}

.nav-item-active {
  background: #f9fafb;
  color: var(--dark);
  border-color: #f9fafb;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.nav-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--r-pill);
  object-fit: cover;
  border: 1px solid #374151;
  background: #0b1220;
}

.nav-user-name {
  color: #e5e7eb;
}

/* ---------------------------
   Layout
---------------------------- */
.social-layout {
  max-width: 1200px;
  margin: 16px auto;
  padding: 0 16px 24px;
}

.social-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.5fr);
  gap: 16px;
}

.social-card {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(229,231,235,.7);
}

.social-card-wide {
  grid-column: span 2;
}

/* ---------------------------
   Typography
---------------------------- */
h1, h2, h3 {
  margin: 0 0 10px;
  font-weight: 700;
}

h1 { font-size: 18px; }
h2 { font-size: 15px; }
h3 { font-size: 14px; }

.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

/* ---------------------------
   Buttons / Links
---------------------------- */
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: var(--r-pill);
  font-size: 13px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .05s ease;
  user-select: none;
}

.btn-primary {
  background: var(--primary);
  color: #f9fafb;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-2);
  border-color: var(--primary-2);
}

.btn-secondary {
  background: #f9fafb;
  color: var(--text);
  border-color: var(--border-2);
}

.btn-secondary:hover {
  background: #eef2f7;
  border-color: var(--border-2);
}

.btn-primary:active,
.btn-secondary:active {
  transform: translateY(1px);
}

.btn-link{
  border: none;
  background: transparent;
  color: var(--primary);
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  font-size: 13px;
}
.btn-link:hover{ text-decoration: underline; }

/* ---------------------------
   Forms
---------------------------- */
.social-form {
  margin-top: 8px;
}

.form-group {
  margin-bottom: 10px;
}

.form-group label {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
  color: var(--text);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border-2);
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  background: #f9fafb;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.form-group textarea { resize: vertical; }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background: #fff;
}

.form-actions {
  margin-top: 10px;
}

.form-section { margin-top: 16px; }
.form-section h2 { margin-bottom: 8px; }

.form-grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px 12px;
}

/* ---------------------------
   Alerts
---------------------------- */
.alert-success,
.alert-error,
.alert-warning,
.alert {
  padding: 9px 10px;
  border-radius: 12px;
  font-size: 13px;
  margin-bottom: 10px;
}

.alert-success {
  background: #ecfdf3;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fed7aa;
}

/* ---------------------------
   Chips / Tags
---------------------------- */
.home-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chip-link {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-2);
  background: #f9fafb;
  color: var(--text);
  text-decoration: none;
}

.chip-link:hover {
  background: #eef2f7;
}

.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.qa-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: #eff6ff;
  color: var(--primary);
  font-size: 11px;
  border: 1px solid rgba(29,78,216,.12);
}

/* ---------------------------
   Matches
---------------------------- */
.match-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.match-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.match-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.match-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--r-pill);
  object-fit: cover;
  border: 1px solid var(--border-2);
  background: #f3f4f6;
}

.match-name {
  font-size: 13px;
  font-weight: 700;
}

.match-specialties {
  font-size: 12px;
  color: #4b5563;
  margin-top: 2px;
}

.match-score {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.match-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ---------------------------
   Profile Image
---------------------------- */
.profile-image-block {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.profile-image-wrapper {
  width: 64px;
  height: 64px;
  border-radius: var(--r-pill);
  overflow: hidden;
  border: 2px solid var(--border);
  background: #f3f4f6;
}

.profile-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-image-button { cursor: pointer; }

/* ---------------------------
   Q&A
---------------------------- */
.qa-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.qa-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.qa-title {
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  color: var(--text);
}

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

.qa-meta {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}

.qa-body {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.75;
}

.qa-answers {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}

.qa-answer-item {
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}

.qa-answer-body {
  font-size: 13px;
  line-height: 1.75;
}

/* reactions */
.qa-reactions {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-reaction {
  border: 1px solid rgba(209,213,219,.9);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .12s ease, transform .05s ease, border-color .12s ease;
}

.btn-reaction:hover {
  background: #f9fafb;
  border-color: var(--border-2);
}

.reaction-count {
  font-size: 11px;
  color: #4b5563;
}

/* ---------------------------
   Ads / Projects list
---------------------------- */
.projects-list,
.feed-ads-list{
  list-style: none;
  margin: 0;
  padding: 0;
}

.project-item,
.feed-ad-item{
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.project-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.6;
}

.project-desc {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.75;
}

.ad-image-wrapper {
  margin-top: 10px;
  max-width: 360px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.ad-image {
  width: 100%;
  height: auto;
  display: block;
}

/* ---------------------------
   Videos (Fix + Minimal Cards)
---------------------------- */

/* صفحه videos.php از .video-list استفاده می‌کند */
.video-list,
.landing-video-list{
  list-style: none;
  margin: 0;
  padding: 0;
}

/* هر آیتم ویدئو به شکل کارت مینیمال */
.video-item{
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

/* هدر ویدئو */
.video-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.video-title{
  font-weight: 800;
  font-size: 14px;
  color: var(--text);
}

.video-meta{
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.6;
}

/* کادر پخش ویدئو: این بخش مشکل بیرون‌زدن را حل می‌کند */
.video-player-wrapper{
  margin-top: 8px;
  border-radius: 14px;
  overflow: hidden;
  background: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.25);
}

/* اگر مرورگر پشتیبانی کند، نسبت ثابت 16:9 */
.video-player{
  width: 100%;
  height: auto;
  display: block;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #0f172a;
}

/* توضیحات ویدئو */
.video-description,
.video-desc{
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--text);
}

/* ---------------------------
   Video Comments (Minimal + Clean)
---------------------------- */
.video-comments{
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.video-comment-form{
  display:flex;
  gap: 8px;
  align-items:center;
}

.video-comment-form input[type="text"]{
  flex: 1;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-2);
  padding: 9px 12px;
  font-size: 13px;
  background: #f9fafb;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.video-comment-form input[type="text"]:focus{
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background: #fff;
}

.video-comments-list{
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display:flex;
  flex-direction:column;
  gap: 10px;
}

.video-comment-item{
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
}

.video-comment-meta{
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}

/* ---------------------------
   Responsive
---------------------------- */
@media (max-width: 900px) {
  .social-main-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .social-card-wide {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {
  .social-header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .nav-user {
    align-self: stretch;
    justify-content: flex-start;
  }

  .form-grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .video-header{
    flex-direction: column;
    align-items: flex-start;
  }
}
/* =========================
   VIDEO – RESPONSIVE + MINIMAL
========================= */

.video-player-wrapper{
  margin-top: 10px;
  border-radius: 14px;
  overflow: hidden;
  background: #0b1220;
  border: 1px solid #e5e7eb;
  position: relative;
  aspect-ratio: 16 / 9; /* مهم: جلوگیری از بیرون‌زدگی */
}

.video-player{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain; /* مهم: نمایش درست داخل کادر */
  background: #0b1220;
}

/* ویدئوها مینیمال‌تر (کمتر از حالت قبلی) */
.video-item{
  padding: 14px 0;
}

.video-description{
  margin-top: 10px;
  font-size: 13px;
  color: #374151;
  line-height: 1.8;
}

/* Progress bar بهتر */
.upload-progress{
  margin-top: 10px;
  display: grid;
  gap: 6px;
}
.upload-progress progress{
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
}
#video-upload-progress-text{
  font-size: 12px;
  color: #6b7280;
}

/* =========================
   COMMENTS – CLEAN + VISIBLE
========================= */

.video-comments{
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #e5e7eb;
}

.video-comment-form{
  display: flex;
  gap: 8px;
  align-items: center;
}

.video-comment-form input[type="text"]{
  flex: 1;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  padding: 10px 12px;
  background: #f9fafb;
  font-size: 13px;
}

.video-comments-list{
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
  max-height: 260px;          /* کامنت‌ها دیده بشن */
  overflow: auto;             /* اسکرول تمیز */
}

.video-comment-item{
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 6px 16px rgba(15,23,42,0.04);
}

.video-comment-item .comment-head{
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.video-comment-item .comment-author{
  font-size: 13px;
  color: #111827;
}

.video-comment-item .comment-time{
  font-size: 11px;
  color: #6b7280;
  white-space: nowrap;
}

.video-comment-item .comment-body{
  margin-top: 6px;
  font-size: 13px;
  color: #374151;
  line-height: 1.8;
}

/* دکمه در حالت loading */
.is-loading{
  opacity: 0.75;
  pointer-events: none;
}
/* ===== Header badges ===== */
.nav-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  margin-right: 6px;
}

/* ===== Modal (Private Message) ===== */
.social-modal-backdrop{
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(17,24,39,0.55);
  z-index: 9999;
  padding: 16px;
}
.social-modal{
  width: min(720px, 100%);
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  overflow: hidden;
}
.social-modal-head{
  display:flex;
  justify-content: space-between;
  align-items:center;
  padding: 12px 14px;
  border-bottom: 1px solid #e5e7eb;
}
.social-modal-title{
  font-weight: 800;
  font-size: 14px;
}
.social-modal-body{
  padding: 12px 14px;
}
.social-chat-list{
  height: 320px;
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 10px;
  background: #f9fafb;
}
.social-chat-item{
  display:flex;
  flex-direction: column;
  margin-bottom: 10px;
}
.social-chat-item.is-me{ align-items: flex-start; }
.social-chat-item.is-them{ align-items: flex-end; }
.chat-bubble{
  max-width: 85%;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  background: #fff;
  font-size: 13px;
  line-height: 1.7;
}
.social-chat-item.is-them .chat-bubble{
  background: #eff6ff;
  border-color: rgba(29,78,216,.12);
}
.chat-time{
  margin-top: 4px;
  font-size: 11px;
  color: #6b7280;
}
.social-chat-form{
  display:flex;
  gap: 8px;
  margin-top: 10px;
}
.social-chat-form input[type="text"]{
  flex: 1;
}
body.modal-open{
  overflow: hidden;
}
