/**
 * Custom VFM theme — clean file-transfer inspired interface.
 * Keeps the VFM functionality and selectors while replacing the visual layer.
 */

:root {
  --tn-bg: #f7f7fb;
  --tn-surface: #ffffff;
  --tn-surface-soft: #f1efff;
  --tn-text: #17152d;
  --tn-muted: #737089;
  --tn-border: #e6e3ef;
  --tn-primary: #6c4df6;
  --tn-primary-dark: #5738e7;
  --tn-primary-soft: #ede9ff;
  --tn-shadow: 0 24px 80px rgba(38, 27, 89, .12);
  --tn-shadow-sm: 0 10px 30px rgba(38, 27, 89, .08);
  --tn-radius-xl: 32px;
  --tn-radius-lg: 22px;
  --tn-radius-md: 16px;
}

html, body { min-height: 100%; }

body {
  background:
    radial-gradient(circle at 12% 8%, rgba(108,77,246,.12), transparent 28rem),
    radial-gradient(circle at 92% 12%, rgba(73,185,255,.11), transparent 30rem),
    linear-gradient(180deg, #fbfbff 0%, var(--tn-bg) 54%, #fff 100%);
  color: var(--tn-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -.01em;
}

body:before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(108,77,246,.12) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.22), transparent 42%);
  z-index: -1;
}

.container { max-width: 1180px; }

/* Navigation */
.navbar.bg-dark {
  background: rgba(255,255,255,.86) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(34,26,74,.07);
  box-shadow: none !important;
  min-height: 72px;
}

.navbar .container { gap: 1rem; }
.navbar-brand {
  color: var(--tn-text) !important;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -.03em;
  padding-left: 0;
}
.navbar-brand img { max-height: 38px; width: auto; }
.navbar .nav-link,
.navbar .navbar-toggler { color: var(--tn-text) !important; }
.navbar .nav-link {
  font-weight: 650;
  border-radius: 999px;
  padding: .58rem .85rem !important;
}
.navbar .nav-link:hover { background: #f2f0f8; }
.navbar-toggler { border: 1px solid var(--tn-border); border-radius: 12px; }

/* Header/logo area */
.vfm-header { background: transparent !important; }
.vfm-header .head-banner { padding-top: 1.1rem; }
.vfm-header .head-banner img { max-height: 54px; width: auto; }
.vfm-header .description {
  color: var(--tn-muted);
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}

/* Main composition */
.main-content { align-items: flex-start; }
body:not(.download-page) .main-content { padding-bottom: 3.5rem; }

.tn-upload-section { padding: 2.2rem 0 1.5rem !important; }
.tn-upload-card {
  max-width: 860px;
  margin: 0 auto;
  padding: 0;
}

.tn-upload-card__intro { text-align: center; margin-bottom: 1.65rem; }
.tn-kicker {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .46rem .78rem;
  margin-bottom: 1rem;
  border-radius: 999px;
  background: rgba(108,77,246,.09);
  color: var(--tn-primary-dark);
  font-weight: 750;
  font-size: .82rem;
}
.tn-upload-card__intro h1 {
  margin: 0 auto .85rem;
  max-width: 760px;
  font-size: clamp(2.2rem, 5vw, 4.45rem);
  line-height: .98;
  letter-spacing: -.055em;
  font-weight: 820;
  color: var(--tn-text);
}
.tn-upload-card__intro p {
  max-width: 650px;
  margin: 0 auto;
  color: var(--tn-muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.65;
}

.tn-dropzone {
  position: relative;
  overflow: hidden;
  text-align: center;
  background: rgba(255,255,255,.96);
  border: 1px solid var(--tn-border);
  border-radius: var(--tn-radius-xl);
  padding: clamp(2rem, 6vw, 4.2rem) clamp(1.25rem, 5vw, 3.25rem);
  box-shadow: var(--tn-shadow);
}
.tn-dropzone:before,
.tn-dropzone:after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(1px);
  pointer-events: none;
}
.tn-dropzone:before {
  width: 210px; height: 210px;
  right: -90px; top: -95px;
  background: rgba(108,77,246,.09);
}
.tn-dropzone:after {
  width: 150px; height: 150px;
  left: -70px; bottom: -70px;
  background: rgba(67,194,255,.08);
}
.tn-dropzone__icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  margin: 0 auto 1.25rem;
  color: #fff;
  background: linear-gradient(135deg, #7458ff 0%, #5a38ec 100%);
  border-radius: 26px;
  box-shadow: 0 18px 38px rgba(108,77,246,.28);
  font-size: 2.25rem;
  transform: rotate(-3deg);
}
.tn-dropzone__content { position: relative; z-index: 1; }
.tn-dropzone__content h2 {
  margin: 0 0 .45rem;
  color: var(--tn-text);
  font-weight: 790;
  letter-spacing: -.035em;
  font-size: clamp(1.35rem, 3vw, 2rem);
}
.tn-dropzone__content p { color: var(--tn-muted); margin: 0 auto 1.5rem; max-width: 540px; }

.tn-upload-form { position: relative; z-index: 2; max-width: 560px; margin: 0 auto; }
.tn-upload-controls {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: .7rem;
  flex-wrap: wrap;
}
.tn-file-input {
  min-height: 54px;
  flex: 1 1 260px;
  border: 1px solid var(--tn-border) !important;
  border-radius: 16px !important;
  background: #f8f7fc !important;
  box-shadow: none !important;
  color: var(--tn-muted) !important;
  padding: 0 1rem !important;
}
.tn-start-btn,
.upload_sumbit {
  min-height: 54px;
  border: 0 !important;
  border-radius: 16px !important;
  padding: 0 1.25rem !important;
  background: linear-gradient(135deg, #7357ff, #5d3cf0) !important;
  box-shadow: 0 12px 26px rgba(108,77,246,.24) !important;
  font-weight: 760;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
}
.tn-start-btn:hover,
.upload_sumbit:hover { transform: translateY(-1px); filter: brightness(.98); }
.tn-start-btn i { font-size: 1.05rem; }

.tn-dropzone__meta {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: .7rem 1.1rem;
  flex-wrap: wrap;
  margin-top: 1.35rem;
  color: #807c92;
  font-size: .82rem;
}
.tn-dropzone__meta span { display: inline-flex; align-items: center; gap: .35rem; }

.tn-secondary-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 760px;
  margin: 1rem auto 0;
  padding: 1rem 1.1rem;
  background: rgba(255,255,255,.76);
  border: 1px solid var(--tn-border);
  border-radius: 18px;
}
.tn-secondary-action > div { display: flex; flex-direction: column; gap: .18rem; }
.tn-secondary-action strong { color: var(--tn-text); font-size: .92rem; }
.tn-secondary-action span { color: var(--tn-muted); font-size: .8rem; }
.tn-new-folder-form { min-width: min(330px, 100%); }
.tn-new-folder-form .input-group {
  background: #fff;
  border: 1px solid var(--tn-border);
  border-radius: 14px;
  overflow: hidden;
}
.tn-new-folder-form .form-control { border: 0 !important; background: #fff !important; }
.tn-new-folder-form .btn { border: 0 !important; border-left: 1px solid var(--tn-border) !important; border-radius: 0 !important; }

.tn-progress-wrap { max-width: 760px; margin: .9rem auto 0; }
.tn-progress-wrap .progress { height: 10px; background: #e9e6f3; border-radius: 999px; overflow: hidden; }
.tn-progress-wrap .progress + .progress { margin-top: .5rem; }

/* File manager surfaces */
.breadcrumbs,
.vfmblock.tableblock,
.vfmblock.bg-light-lighter,
.card,
#login-form,
.download-page .vfmblock {
  background: rgba(255,255,255,.94) !important;
  border: 1px solid var(--tn-border) !important;
  border-radius: var(--tn-radius-lg) !important;
  box-shadow: var(--tn-shadow-sm) !important;
}

.vfmblock.tableblock { overflow: hidden; padding: 1rem !important; }
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > :not(caption) > * > * { border-bottom-color: #eeeaf5; padding-top: .9rem; padding-bottom: .9rem; }
.table-hover > tbody > tr:hover > * { background: #f8f6ff; }

.btn { border-radius: 12px; font-weight: 650; }
.btn-primary {
  background: var(--tn-primary) !important;
  border-color: var(--tn-primary) !important;
}
.btn-primary:hover { background: var(--tn-primary-dark) !important; border-color: var(--tn-primary-dark) !important; }
.btn-outline-primary { color: var(--tn-primary); border-color: #cfc6ff; }
.btn-outline-primary:hover { background: var(--tn-primary); border-color: var(--tn-primary); }

.form-control,
.form-select,
.input-group-text {
  border-radius: 12px;
}
.form-control:focus,
.form-select:focus {
  border-color: #b9abff !important;
  box-shadow: 0 0 0 .2rem rgba(108,77,246,.10) !important;
}

.modal-content {
  border: 1px solid var(--tn-border);
  border-radius: 24px;
  box-shadow: var(--tn-shadow);
}

.dropdown-menu {
  border: 1px solid var(--tn-border) !important;
  border-radius: 16px !important;
  box-shadow: var(--tn-shadow-sm);
  padding: .45rem;
}
.dropdown-item { border-radius: 10px; }

/* Drag overlay */
.overdrag {
  background: rgba(39,29,87,.80) !important;
  backdrop-filter: blur(10px);
}
.overdrag:after {
  content: "Déposez vos fichiers pour les envoyer";
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: clamp(1.3rem, 3vw, 2.2rem);
  font-weight: 800;
  text-align: center;
}

/* Footer */
.footer.bg-dark-lighter {
  margin-top: 2rem;
  background: transparent !important;
  color: var(--tn-muted) !important;
  border-top: 1px solid rgba(34,26,74,.08);
}
.footer a { color: var(--tn-text) !important; font-weight: 650; }
.to-top {
  border-radius: 50%;
  background: var(--tn-primary) !important;
  box-shadow: 0 8px 24px rgba(108,77,246,.26);
}

/* Dark mode: keep accessible while preserving the same visual system. */
.dark-mode {
  --tn-bg: #12111a;
  --tn-surface: #1b1926;
  --tn-surface-soft: #242033;
  --tn-text: #f4f2fa;
  --tn-muted: #aaa6b8;
  --tn-border: #302b40;
  background: #12111a;
}
.dark-mode .navbar.bg-dark,
.dark-mode .tn-dropzone,
.dark-mode .tn-secondary-action,
.dark-mode .vfmblock.tableblock,
.dark-mode .card,
.dark-mode #login-form { background: rgba(27,25,38,.94) !important; }
.dark-mode .tn-file-input,
.dark-mode .tn-new-folder-form .form-control,
.dark-mode .tn-new-folder-form .input-group { background: #211e2d !important; color: var(--tn-text) !important; }
.dark-mode .navbar .nav-link:hover { background: #242130; }
.dark-mode .table-hover > tbody > tr:hover > * { background: #242130; }

@media (max-width: 767.98px) {
  .navbar.bg-dark { min-height: 62px; }
  .tn-upload-section { padding-top: 1.35rem !important; }
  .tn-upload-card__intro h1 { font-size: clamp(2rem, 12vw, 3.15rem); }
  .tn-dropzone { border-radius: 24px; padding: 2.2rem 1rem; }
  .tn-dropzone__icon { width: 72px; height: 72px; border-radius: 22px; font-size: 1.9rem; }
  .tn-upload-controls { display: grid; grid-template-columns: 1fr; }
  .tn-file-input, .tn-start-btn, .upload_sumbit { width: 100%; }
  .tn-secondary-action { align-items: stretch; flex-direction: column; }
  .tn-new-folder-form { min-width: 0; width: 100%; }
  .tn-dropzone__meta { flex-direction: column; align-items: center; }
}
