/* ============================================================================
   tm-file-upload.css — Ortak themed dosya yükleme bileşeni  (2026-06-23)
   ----------------------------------------------------------------------------
   Marketplace komisyon/kâr ailesinde (commission / plus_commission /
   marketplace_profit / _campaign / _flash / _advantage) TEK TİP, markalı
   "Dosya Seç" deneyimi. Tarayıcının varsayılan <input type=file> görseli
   yerine token-temelli markalı buton + dosya adı gösterir.

   KURAL: yalnızca global token kullanır (theme-variables.css). Hardcoded
   renk / hex YOKTUR. Light + dark otomatik (token'lar mode-aware).

   Kullanım (Jinja):
     <label class="tmfu">
       <input type="file" class="tmfu__input" accept=".xlsx,.xls">
       <span class="tmfu__btn">
         <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
              stroke-linecap="round" stroke-linejoin="round">
           <path d="M4 16v2a2 2 0 002 2h12a2 2 0 002-2v-2"/><path d="M7 10l5 5 5-5"/><path d="M12 15V4"/>
         </svg>
         Dosya Seç
       </span>
       <span class="tmfu__name" data-empty="Henüz dosya seçilmedi">Henüz dosya seçilmedi</span>
     </label>

   JS davranışı: input change → en yakın .tmfu'ya .has-file ekle, .tmfu__name'i
   güncelle (tmInitFileUpload() global helper'ı, tm-file-upload.js).
   ============================================================================ */

.tmfu {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  position: relative;
  padding: 0.45rem 0.85rem 0.45rem 0.5rem;
  background: var(--tm-bg-input);
  border: 1.5px dashed var(--tm-border);
  border-radius: var(--radius-token-md, 14px);
  cursor: pointer;
  max-width: 100%;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.tmfu:hover,
.tmfu:focus-within,
.tmfu.is-dragover {
  border-color: var(--tm-primary);
  background: var(--color-primary-soft);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.12);
}

/* Native input görünmez ama erişilebilir (label tıklaması tetikler) */
.tmfu__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.tmfu__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  background: linear-gradient(135deg, var(--tm-primary), var(--color-primary-hover));
  color: var(--tm-fg-on-brand, #fff);
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1;
  border-radius: 10px;
  white-space: nowrap;
  box-shadow: var(--tm-shadow-sm);
  transition: filter 0.15s ease;
}

.tmfu:hover .tmfu__btn { filter: brightness(1.04); }

.tmfu__btn svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.tmfu__name {
  font-size: 0.85rem;
  color: var(--tm-text-secondary);
  font-weight: 500;
  min-width: 0;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Dosya seçildiğinde: yeşil onay tonu (token) */
.tmfu.has-file {
  border-style: solid;
  border-color: var(--tm-success-border);
  background: var(--tm-success-bg);
}
.tmfu.has-file .tmfu__name {
  color: var(--tm-text-primary);
  font-weight: 600;
}
.tmfu.has-file .tmfu__btn {
  background: linear-gradient(135deg, var(--tm-success), var(--tm-success));
}

/* Disabled durumu */
.tmfu.is-disabled,
.tmfu[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* ----------------------------------------------------------------------------
   Ortak satır düzeni: dosya seç + aksiyon butonu + durum metni tek hizada.
   marketplace_* ailesindeki .mp-upload-row / .mc-* / .mf-* / .ma-* yerine
   tek kanonik düzen. (Sayfalar bu sınıfı ekleyerek hizalanır.)
   ---------------------------------------------------------------------------- */
.tmfu-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}
.tmfu-row__status {
  font-size: 0.78rem;
  color: var(--tm-text-muted);
}

/* ----------------------------------------------------------------------------
   Blok varyantı (.tmfu--block): tam genişlik, dikey drop alanı.
   commission_analysis / plus_commission gibi sayfalardaki büyük "Dosya Seçimi"
   bırakma alanı için. Satır varyantıyla aynı token/marka dilini paylaşır.
   ---------------------------------------------------------------------------- */
.tmfu--block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 7.5rem;
  padding: 1.25rem 1rem;
  text-align: center;
}
.tmfu--block .tmfu__btn {
  padding: 0.6rem 1.15rem;
  font-size: 0.9rem;
}
.tmfu--block .tmfu__name {
  max-width: 100%;
}
.tmfu--block .tmfu__hint {
  font-size: 0.8rem;
  color: var(--tm-text-muted);
  font-weight: 500;
}
.tmfu--block.has-file .tmfu__hint { color: var(--tm-success); }
