/* ==========================================================================
   Topluluk (Kişilerim ↔ Topluluk): sekmeler, kapı kartı, araç çubuğu, durum rozetleri, talepler paneli
   Renkler styles.css ile aynı (ink #17201d, teal #578a89, çizgi #d9e2db). Mantık: community.js
   ========================================================================== */

/* --- Başlıktaki sekmeler (masaüstü pencere) --- */
.um-tabs { display: flex; align-items: flex-end; gap: 6px; min-width: 0; }
.um-tab {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  margin: 0; padding: 6px 12px; background: none; border: none; border-bottom: 2px solid transparent;
  font: inherit; font-size: 1.2rem; font-weight: 700; color: #9aa69f; cursor: pointer; white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.um-tab:hover { color: #17201d; }
.um-tab.active { color: #17201d; border-bottom-color: #578a89; }
.um-tab:focus-visible { outline: 2px solid #578a89; outline-offset: 2px; border-radius: 6px; }
.um-tab-badge {
  min-width: 18px; padding: 0 6px; border-radius: 9px; background: #d9534f; color: #fff;
  font-size: 0.72rem; font-weight: 700; line-height: 18px; text-align: center;
}
.um-tab-badge[hidden] { display: none; }
/* İçerideki kopya yalnızca mobil panelde (içerik oraya taşınınca) görünür */
.um-tabs-inline { display: none; }
#ma-people-slot .um-tabs-inline { display: flex; gap: 0; margin: 0 0 14px; padding: 3px; background: #eef2ef; border-radius: 12px; }
#ma-people-slot .um-tabs-inline .um-tab {
  flex: 1; justify-content: center; padding: 8px 10px; border: none; border-radius: 9px;
  font-size: 0.95rem; font-weight: 600; color: #6d7a72;
}
#ma-people-slot .um-tabs-inline .um-tab.active { background: #fff; color: #17201d; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }

/* Moda göre gizle / göster */
body:not(.um-comm) [data-cm-only] { display: none !important; }
body.um-comm [data-mine-only] { display: none !important; }
/* Topluluk'ta kişiyi doğrudan aktif/pasif yapan anahtar yok: yayına alma yönetici onayıyla ("İncelemeye gönder") */
body.um-comm #um-active-row, body.um-comm .um-card-active-switch { display: none !important; }
/* Kapı kartı gösterilirken iki sütunlu düzen gizlenir */
body.um-gate #outfits-modal .auth-grid, body.um-gate #mobile-account .auth-grid { display: none !important; }

/* --- Sol sütun: araç çubuğu --- */
.cm-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin: 0 0 12px; }
.cm-toolbar[hidden], .cm-requests-panel[hidden], .cm-gate[hidden], .cm-notice[hidden] { display: none !important; }
.cm-toggle { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 0.86rem; font-weight: 500; color: #4a5550; cursor: pointer; user-select: none; }
.cm-toggle input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.cm-toggle-ui { position: relative; flex: none; width: 34px; height: 20px; border-radius: 10px; background: #cfd8d2; transition: background 0.2s ease; }
.cm-toggle-ui::after {
  content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: transform 0.2s ease;
}
.cm-toggle input:checked + .cm-toggle-ui { background: #578a89; }
.cm-toggle input:checked + .cm-toggle-ui::after { transform: translateX(14px); }
.cm-toggle input:focus-visible + .cm-toggle-ui { outline: 2px solid #578a89; outline-offset: 2px; }
.cm-reqs-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; background: #fff; color: #578a89;
  border: 1px solid #d9e2db; border-radius: 999px; font: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.cm-reqs-btn:hover { border-color: #578a89; background: #f3f8f6; }
.cm-reqs-count { min-width: 18px; padding: 0 6px; border-radius: 9px; background: #578a89; color: #fff; font-size: 0.72rem; font-weight: 700; line-height: 18px; text-align: center; }
.cm-reqs-count.attn { background: #d9534f; }
.cm-reqs-count[hidden] { display: none; }

/* Taleplerim açıkken liste yerine talepler gösterilir */
/* (anahtar ve "Taleplerim" düğmesinin burada işlevi yok: geri dönünce yeniden görünür) */
body.um-reqs .auth-grid-left > .um-search-wrap, body.um-reqs .auth-grid-left > #my-models-body, body.um-reqs .auth-grid-left > #show-new-person-form-btn,
body.um-reqs .auth-grid-left > #cm-toolbar { display: none !important; }

/* --- Rozetler --- */
.cm-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; background: #eef2ef; color: #6d7a72;
  font-size: 0.72rem; font-weight: 700; line-height: 1.5; white-space: nowrap; vertical-align: middle;
}
.cm-chip[hidden] { display: none; }
.cm-chip.live { background: #e3f4e8; color: #1e8a3e; }
.cm-chip.review { background: #fbf1dd; color: #9a6a14; }
.cm-chip.rejected { background: #fdeceb; color: #b3322c; }
.cm-chip.draft { background: #eef2ef; color: #6d7a72; }
.cm-chip.mine { background: #e7f1f0; color: #4a7776; }
.cm-chip.status-approved { background: #e3f4e8; color: #1e8a3e; }
.cm-chip.status-pending { background: #fbf1dd; color: #9a6a14; }
.cm-chip.status-rejected { background: #fdeceb; color: #b3322c; }
.cm-chip.status-cancelled { background: #eef2ef; color: #6d7a72; }

/* Kıyafet kutularındaki etiketler (onay bekliyor, silinecek…) */
.cm-tag { position: absolute; left: 4px; bottom: 4px; max-width: calc(100% - 8px); padding: 1px 5px; border-radius: 3px; color: #fff; font-size: 10px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-tag.amber { background: #b9811f; }
.cm-tag.red { background: #c9433e; }
.cm-tag.grey { background: #6d7a72; }
.cm-outfit.is-pending { border-style: dashed !important; border-color: #b9811f !important; }
.cm-card-meta { margin: 2px 0 0; font-size: 0.78rem; color: #9a6a14; }
.cm-card-meta[hidden] { display: none; }

/* --- Sağ sütun: bilgi notu ve alan ipuçları --- */
.cm-notice { margin: 0 0 16px; padding: 11px 14px; border-radius: 10px; background: #f3f8f6; border: 1px solid #dbe8e4; color: #3f5a55; font-size: 0.86rem; line-height: 1.5; }
.cm-notice.warn { background: #fbf4e3; border-color: #f0e0b8; color: #7d5a14; }
.cm-hint { display: flex; align-items: center; gap: 6px; margin: 5px 0 0; font-size: 0.78rem; font-weight: 600; color: #9a6a14; }
.cm-hint::before { content: "⏳"; font-size: 0.8rem; }
.cm-select { width: 100%; padding: 12px; border: 1px solid #d9e2db; border-radius: 6px; background: #fff; font: inherit; font-size: 1rem; }
.cm-submit-row { margin-top: 14px; padding-top: 14px; border-top: 1px dashed #d9e2db; }
.cm-submit-row[hidden] { display: none; }
.cm-submit-btn {
  width: 100%; padding: 12px; background: #fff; color: #578a89; border: 1.5px solid #578a89; border-radius: 6px;
  font: inherit; font-size: 1rem; font-weight: 700; cursor: pointer; transition: background 0.15s ease, color 0.15s ease;
}
.cm-submit-btn:hover:not(:disabled) { background: #578a89; color: #fff; }
.cm-submit-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* --- Kapı kartı (katılım isteği) --- */
.cm-gate { display: flex; justify-content: center; align-items: flex-start; flex: 1 1 auto; min-width: 0; min-height: 0; overflow-y: auto; padding: 8px 20px 28px; }
.cm-gate-card { width: 100%; max-width: 560px; padding: 28px 28px 26px; background: #fff; border: 1px solid #d9e2db; border-radius: 16px; box-shadow: 0 8px 28px rgba(23, 32, 29, 0.07); }
.cm-gate-card h3 { margin: 0 0 8px; font-size: 1.35rem; letter-spacing: -0.02em; color: #17201d; }
.cm-gate-card .lead { margin: 0 0 16px; font-size: 0.98rem; line-height: 1.55; color: #4a5550; }
.cm-gate-card ul { margin: 0 0 18px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 9px; }
.cm-gate-card li { position: relative; padding-left: 26px; font-size: 0.9rem; line-height: 1.5; color: #4a5550; }
.cm-gate-card li::before {
  content: ""; position: absolute; left: 0; top: 2px; width: 17px; height: 17px; border-radius: 50%; background: #e7f1f0 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23578a89' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 11px no-repeat;
}
.cm-accept { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 16px; font-size: 0.92rem; font-weight: 600; color: #17201d; cursor: pointer; }
.cm-accept input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: #578a89; flex: none; cursor: pointer; }
.cm-gate-card .um-save-btn { width: 100%; }
.cm-gate-card .cm-gate-note { margin: 14px 0 0; padding: 10px 12px; border-radius: 8px; background: #f7f9f5; border: 1px solid #e3e9e5; font-size: 0.88rem; color: #4a5550; line-height: 1.5; overflow-wrap: anywhere; }
.cm-gate-card .cm-secondary { margin-top: 10px; width: 100%; padding: 11px; background: #fff; color: #578a89; border: 1px solid #d9e2db; border-radius: 6px; font: inherit; font-weight: 700; cursor: pointer; }
.cm-gate-card .cm-secondary:hover { border-color: #578a89; background: #f3f8f6; }
.cm-gate-card .cm-gate-icon { display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; margin-bottom: 14px; border-radius: 50%; background: #e7f1f0; color: #578a89; font-size: 1.4rem; }
.cm-gate-card .cm-gate-icon.warn { background: #fbf1dd; color: #9a6a14; }
.cm-gate-card .cm-gate-icon.bad { background: #fdeceb; color: #b3322c; }

/* --- Taleplerim paneli --- */
.cm-requests-panel { margin: 0 0 14px; }
/* Masaüstü penceresinde sol sütunu kaydıran kutu kişi listesidir (styles.css #my-models-body); talepler açıkken o gizlenir,
   bu yüzden talep paneli kendisi kayar (yoksa uzun liste pencerenin altında kırpılıyordu). Başlık + "Listeye dön" üstte sabit kalır. */
@media (min-width: 768px) {
  #outfits-modal .cm-requests-panel { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin-bottom: 0; padding-right: 6px; }
  #outfits-modal .cm-requests-head { position: sticky; top: 0; z-index: 1; background: #fff; margin: 0; padding: 0 0 12px; }
}
.cm-req-more { text-align: center; color: #9aa69f; font-size: 0.85rem; min-height: 1px; padding: 4px 0 12px; }
.cm-requests-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; }
.cm-requests-head h3 { margin: 0; font-size: 1.05rem; }
.cm-link-btn { background: none; border: none; padding: 4px 0; color: #578a89; font: inherit; font-size: 0.88rem; font-weight: 700; cursor: pointer; }
.cm-link-btn:hover { text-decoration: underline; }
.cm-req-item { display: flex; flex-direction: column; gap: 5px; padding: 12px 14px; margin: 0 0 10px; background: #fff; border: 1px solid #e3e9e5; border-radius: 10px; }
.cm-req-item .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cm-req-item .kind { font-size: 0.9rem; font-weight: 700; color: #17201d; }
.cm-req-item .model { font-size: 0.88rem; color: #578a89; font-weight: 600; overflow-wrap: anywhere; }
.cm-req-item .what { font-size: 0.82rem; color: #6d7a72; line-height: 1.45; overflow-wrap: anywhere; }
.cm-req-item .note { font-size: 0.84rem; color: #7d4a1a; background: #fbf4e3; padding: 6px 9px; border-radius: 6px; overflow-wrap: anywhere; }
.cm-req-item .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.76rem; color: #9aa69f; }
.cm-empty-note { padding: 22px 14px; text-align: center; font-size: 0.9rem; line-height: 1.55; color: #6d7a72; }

@media (max-width: 768px) {
  .cm-gate { padding: 4px 4px 24px; }
  .cm-gate-card { padding: 22px 18px; }
}
