/* ============================================================
   Upload UI (Dropzone + Filelist)
============================================================ */

.dropzone{
  border-radius: 8px;
  border: 1px dashed #cfd4dc;
  background: linear-gradient(180deg, #f4f4f4, #f2f2f2);
  padding: 35px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  user-select: none;
}
.dropzone:hover{ border-color: #0064ff; }
.dropzone.dragover{
  border-color: #7aa7ff;
  box-shadow: 0 18px 44px rgba(0,0,0,0.10);
}
.dropzone.disabled{
  opacity: .65;
  cursor: not-allowed;
  pointer-events: none;
}

.dz-inner{
  display: grid;
  gap: 6px;
  justify-items: center;
  text-align: center;
}
.dz-icon{
  width: 54px;
  height: 54px;
  border-radius: 8px;
  border: 1px solid #e7e7e7;
  background: #fff;
  display: grid;
  place-items: center;
}
.dz-icon i{
  font-size: 22px;
  color: #667085;
}
.dz-title{
  font-weight: 900;
  letter-spacing: .2px;
  font-size: 18px;
  color: #111;
}
.dz-sub{
  color: #667085;
  font-size: 13px;
}
.dz-meta{
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.dz-pill{
  font-size: 12px;
  color: #344054;
  background: #fff;
  border: 1px solid #eceff3;
  border-radius: 8px;
  padding: 6px 10px;
}

/* Actions */

.upload-actions{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 25px;
}
.upload-actions .spacer{ flex: 1; }

.upload-main button{
  border: none;
  border-radius: 8px !important;
  padding: 10px 12px;
  border: 1px solid #acacac;
  font-weight: 800;
  cursor: pointer;
  align-items: center;
  gap: 8px;
}
.upload-main button:disabled{
  border: 1px solid #e7e7e7;
  opacity: .55;
  cursor: not-allowed;
  box-shadow: none !important;
  transform: none !important;
}

.btn-primary{
  background: #1a56ff;
  color: #fff;
  border-radius: 1px !important;
}
.btn-primary:hover{ background-color: #0034c6; }

.btn-secondary{
  background: #fff;
  color: #111;
  border: 1px solid #acacac;
}
.btn-secondary:hover{ border: 1px solid #484848; }

/* Filelist */

.filelist-head{
  margin-top: 18px;
  display:flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.filelist-title{
  font-weight: 900;
  color:#111;
}
.filelist-sub{
  font-size: 12px;
  color:#667085;
}
.filelist{
  margin-top: 10px;
  display: block;
  gap: 10px;
}

/* file-row: zusammengeführt (Basis + Fade-out Transition) */
.file-row{
  display:flex;
  align-items:center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #acacac;
  background: #fff;
  margin-bottom: 12px;

  transition: opacity .45s ease, transform .45s ease, max-height .45s ease, margin .45s ease, padding .45s ease;
}
.file-row.row-out{
  opacity: 0;
  transform: translateX(22px);
  max-height: 0;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
}

.file-icon{
  width: 42px;
  height: 42px;
  border-radius: 8px;
  border: 1px solid #eceff3;
  background: #fafafa;
  display:grid;
  place-items:center;
  flex: 0 0 auto;
}
.file-icon i{ color:#667085; }

.file-main{
  min-width: 0;
  flex: 1;
}
.file-name{
  font-weight: 900;
  color:#111;
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-meta{
  margin-top: 4px;
  font-size: 12px;
  color:#667085;
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* file-status: zusammengeführt (Base + Icon-Layout) */
.file-status{
  font-size: 12px;
  font-weight: 800;
  padding: 10px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  white-space: nowrap;

  display:flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
}
.file-status i{ font-size: 14px; }

.status-ready{ background:#f6f7f9; border-color:#eceff3; color:#111; }
.status-blocked{ background:#ffe9ea; border-color:#ffb7bc; color:#8a0f17; }
.status-uploading{ background:#fff6e5; border-color:#ffe2a8; color:#7a4b00; }
.status-done{ background:#e9f8ee; border-color:#bfe9cc; color:#116b2c; }

.file-actions{
  display:flex;
  gap: 8px;
  flex: 0 0 auto;
}

.icon-btn, .icon-btn-private{
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid #ececec;
  background: #fff;
  display:grid;
  place-items:center;
  cursor:pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.icon-btn i{ color:#667085; }

.icon_red { color: red !important; }
.icon_orange{ color: #ff8f00 !important; }
.icon_blue, .icon_song { color: #1a56ff !important; }
.icon_jingle { color: #30ac03 !important; }
.icon_moderation { color: #c65d00 !important; }

.fileActionBtn:hover { border: 1px solid #ff3a3a; }
.icon-btn-private:hover { border: 1px solid #1a56ff; }
.fileEditBtn:hover { border: 1px solid #ff8f00; }

/* TomSelect control for #teType */
#teType-ts-control { text-align: left !important; }

/* ============================================================
   Toggle (Switch)
============================================================ */

.toggle{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid #acacac;
  background:#fff;
  cursor:pointer;
  user-select:none;
}
.toggle:hover { border: 1px solid #484848; }

.toggle input{ display:none; }

.toggle-ui{
  width: 44px;
  height: 24px;
  border-radius: 50px;
  background:#eceff3;
  border: 1px solid #e1e4ea;
  position: relative;
  transition: background .15s ease;
  flex: 0 0 auto;
}
.toggle-ui::after{
  content:"";
  width: 20px;
  height: 20px;
  border-radius: 50px;
  background:#fff;
  border: 1px solid #d6d6d6;
  position:absolute;
  top: 50%;
  left: 2px;
  transform: translateY(-50%);
  transition: left .15s ease;
}
.toggle input:checked + .toggle-ui{
  background:#1a56ff;
  border-color:#1a56ff;
}
.toggle input:checked + .toggle-ui::after{ left: 22px; }

.toggle-text{
  font-weight: 800;
  font-size: 13px;
  color:#111;
}

/* Progressbar */
.progress{
  height: 8px;
  border-radius: 8px;
  background:#eef1f6;
  overflow:hidden;
  margin-top: 8px;
}
.progress .bar{
  height: 100%;
  background:#1a56ff;
  width: 0%;
  transition: width .12s ease;
}
.progress.hidden{ display:none; }

/* Toggle-Spalte rechts */
.file-private{
  display:flex;
  align-items:center;
  justify-content:flex-end;
}

/* File-toggle kompakter und “premium” */
.file-toggle{
  border-radius: 8px;
  padding: 6px 10px;
  border: 1px solid #e7e7e7;
  background: #fbfbfd;
}
.file-toggle .toggle-text{
  font-size: 12px;
  font-weight: 800;
}
.file-toggle .toggle-ui{
  height: 22px;
}

/* ============================================================
   Icons / Animationen (nur benutzt)
============================================================ */

/* Upload-Icon: „fliegt“ leicht nach oben */
.u-upload-fly{
  animation: uUploadFly 0.8s ease-in-out infinite;
}
@keyframes uUploadFly{
  0%   { transform: translateY(0); opacity: 0.95; }
  50%  { transform: translateY(-6px); opacity: 1; }
  100% { transform: translateY(0); opacity: 0.95; }
}

/* Lock: dreht genau 1x sauber */
@keyframes uLockTwirlOnce{
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(180deg); }
}
.u-lock-twirl{
  display: inline-block;
  animation: uLockTwirlOnce 0.42s ease-out 1;
}

/* ============================================================
   Dropzone Slide-Up / Slide-Down Animation
============================================================ */

#dropzone{
  overflow: hidden;
  transform-origin: top;
  transition:
    max-height 0.38s ease,
    opacity 0.28s ease,
    margin 0.38s ease,
    padding 0.38s ease;
}

/* sichtbar */
#dropzone.dropzone-open{
  max-height: 500px;
  opacity: 1;
  margin-top: 0;
  padding: 35px;
}

/* eingeklappt */
#dropzone.dropzone-closed{
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
  pointer-events: none;
}

/* ============================================================
   MOBILE (<=768px): Dropzone weg, dafür großer + Button
============================================================ */
.mobile-upload-btn{ display: none; }

/* ============================================================
   Track Editor Overlay (Modal)
============================================================ */

.te-overlay{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}
.te-overlay.open{ display: block; }

.te-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
}

.te-modal{
  position: relative;
  width: min(720px, calc(100% - 24px));
  margin: 60px auto;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e8e8e8;
  box-shadow: 0 22px 60px rgba(0,0,0,0.25);
  overflow: hidden;
}

.te-head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
}

.te-title{
  font-weight: 900;
  font-size: 16px;
  color: #111;
}

.te-subtitle{
  margin-top: 2px;
  font-size: 12px;
  color: #667085;
}

.te-close{
  border: 1px solid #ececec;
  background: #fff;
  border-radius: 10px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.te-body{ padding: 16px; }

.te-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.te-field{
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.te-label{
  font-size: 12px;
  color: #667085;
  font-weight: 800;
}

.te-input{
  border: 1px solid #e1e4ea;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}
.te-input:focus{ border-color: #1a56ff; }

.te-toggle{ width: fit-content; }

.te-hint{
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f6f7f9;
  border: 1px solid #eceff3;
  color: #111;
  font-size: 12px;
}

.te-foot{
  padding: 12px 16px;
  border-top: 1px solid #eee;
  display: grid;
  align-items: center;
  gap: 10px;
}

/* ✅ NEU: Year-Error + Error-Input-State */
.te-error{
  margin-top: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #8a0f17;
  background: #ffe9ea;
  border: 1px solid #ffb7bc;
  border-radius: 8px;
  padding: 8px 10px;
}
.te-input.te-input-error{
  border: 1px solid #ffb7bc !important;
  box-shadow: 0 0 0 3px rgba(255, 58, 58, 0.10);
}

/* ============================================================
   Validation / Warnings (nur was wirklich genutzt wird)
============================================================ */

.file-row.row-invalid{
  border-color: #ffb7bc !important;
  background: #fff5f6 !important;
}

/* ============================================================
   Hint Toolbar (Pills)
============================================================ */

#filelistHint{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  min-height: 28px;
}

.hint-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:5px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  line-height:1;
  font-size: 0.9rem;
  user-select:none;
  white-space:nowrap;
}

.hint-pill i{ opacity:0.9; }

.hint-val{
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.hint-neutral{ border-color: rgba(255,255,255); }
.hint-ok{ border-color: rgba(25, 135, 84); }
.hint-warn{ border-color: rgba(255, 193, 7); }
.hint-bad{ border-color: rgb(220, 53, 69); }

/* ============================================================
   Upload Mode Select (in upload-actions)
============================================================ */

.mode-select{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0px 10px;
  border-radius: 8px;
  border: 1px solid #acacac;
  background: #fff;
  cursor: default;
  user-select: none;
}
.mode-select:hover{ border: 1px solid #484848; }

.uploadModeSelect{
  max-height: 400px;
  display: block;
  font-size: 16px;
  background-color: #fff;
  border: 0px solid #ccc !important;
  border-radius: 5px;
  padding: 8.5px 8px;
}

.mode-label{
  font-weight: 800;
  font-size: 13px;
  color: #111;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

/* TomSelect inline */
.mode-select .ts-wrapper{ min-width: 90px; }

.mode-select .ts-control{
  border: none !important;
  padding: 0 !important;
  min-height: auto !important;
  box-shadow: none !important;
  background: transparent !important;
}
.mode-select .ts-control input{ font-weight: 800; }
.mode-select .ts-control::after{ margin-left: 6px; }

.mode-select.is-disabled{
  opacity: .55;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================================
   Responsive
============================================================ */

@media (max-width: 768px){

  /* Upload card / Dropzone */
  .upload-main{
    padding: 12px;
    margin-top: 10px;
  }

  .dropzone{
    padding: 18px;
    border-radius: 10px;
  }

  .dz-icon{
    width: 46px;
    height: 46px;
    border-radius: 10px;
  }

  .dz-title{ font-size: 16px; }
  .dz-sub{ font-size: 12px; }

  .dz-meta{ gap: 6px; }

  .dz-pill{
    font-size: 12px;
    padding: 6px 8px;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
  }

  /* Actions (mobil vereinfacht) */
  .upload-actions{
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .upload-main button{
    justify-content: center;
    padding: 16px 12px;
  }

  .te-close{ padding: 0 !important; }

  /* Weniger Funktionen mobil */
  #stopUploadBtn,
  #cancelAllBtn{
    display: none;
  }

  .upload-actions .toggle{
    width: 100%;
    padding: 12px 10px;
    justify-content: space-between;
  }

  /* File list mobil */
  .filelist{ display: block; }

  .file-row{
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 15px;
    max-width: 100%;
  }

  .file-icon{
    display: grid;
    order: 4;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    flex: 0 0 auto;
  }

  .file-meta{ display:none; }

  .file-main{
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100%;
  }

  .file-name{
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    text-align: center;
  }

  .file-status{
    flex: 1 1 100%;
    order: 3;
    text-align: center;
  }

  .file-private{
    flex: 1 1 auto;
    order: 5;
    justify-content: flex-start;
    padding-left: 0;
    min-width: 0;
  }

  .file-actions{
    flex: 0 0 auto;
    order: 6;
    margin-left: auto;
  }

  .file-toggle{
    padding: 6px 8px;
    width: auto;
    gap: 8px;
  }

  .file-toggle .toggle-text{ font-size: 12px; }

  .file-toggle .toggle-ui{
    width: 38px;
    height: 22px;
  }

  .file-toggle .toggle-ui::after{
    width: 18px;
    height: 18px;
  }

  .icon-btn, .icon-btn-private{
    width: 40px;
    height: 40px;
  }

  .kpi-grid.v2{ display: block; }
  .kpi-grid.v2 .kpi{ display: none; }
  .kpi-grid.v2 .kpi:nth-child(1),
  .kpi-grid.v2 .kpi:nth-child(3){
    display: block;
    margin-bottom: 12px;
  }

  /* Hint Toolbar (war fälschlich 7680px) */
  #filelistHint{
    justify-content:center;
    align-items:center;
    gap:6px;
    max-height: 68px;
    overflow:hidden;
  }

  .hint-pill{
    padding:5px 9px;
    font-size: 0.85rem;
    gap:7px;
  }

  /* Dropzone komplett ausblenden (mobil nutzt das +) */
  #dropzone, .muted{
    display: none !important;
  }

  /* großer + Button */
  .mobile-upload-btn{
    display: flex;
    align-items: center;
    justify-content: center;
    height: 150px;
    border-radius: 12px;
    border: 0px;
    background: #fff;
    cursor: pointer;
    user-select: none;
    transition: border-color .15s ease, background .15s ease;
  }

  .mobile-upload-btn:hover{ background: #fff; }

  .mobile-upload-btn i{
    font-size: 55px;
    color: #1a56ff;
    line-height: 1;
    margin-top: 15px;
  }

  .te-modal{
    width: min(720px, calc(100% - 5px));
    height: calc(100% - 10px);
    margin: 5px auto !important;
    overflow: scroll;
  }

  .filelist-head{ display: block; }

  .filelist-sub{
    font-size: 14px;
    text-align: center;
    margin: 5px 0;
  }

  .filelist-title{ text-align: center; }

  /* Mobile: Mode-Select volle Breite */
  .mode-select{
    width: 100%;
    justify-content: space-between;
    padding: 6px 10px;
  }
  .mode-select .ts-wrapper{
    width: 100%;
    min-width: 100px;
    max-width: 120px;
  }
}

/* Mobile */
@media (max-width: 640px){
  .te-grid{ grid-template-columns: 1fr; }
}


