:root {
  --bg: radial-gradient(circle at top left, #30245f 0%, #101435 45%, #050519 100%);
  --bg-solid: #050519;
  --surface: #101435;
  --surface-soft: #181b3a;
  --surface-soft-alt: #1f2348;
  --card-bg: rgba(15, 23, 42, 0.92);
  --text: #e5e7ff;
  --text-muted: #a5b0ff;
  --accent: #764df0;
  --accent-soft: rgba(118, 77, 240, 0.24);
  --accent-strong: #a26bff;
  --border-subtle: rgba(148, 163, 255, 0.25);
  --chip-bg: rgba(118, 77, 240, 0.18);
  --danger: #f97373;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--text);
  font-size: 11px;
  line-height: 1;
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.tag-chip + .tag-chip {
  margin-left: 4px;
}

@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css');

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Roboto Flex', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden; /* Evite le scroll horizontal et les débordements de la bottom-nav sur mobile */
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* Variante de fond pour la page d'exploration */
body.page-explore {
  background: radial-gradient(circle at top left, #3b256a 0%, #101435 45%, #050519 100%);
  color: var(--text);
}

body.page-explore .card {
  background: var(--surface-soft);
}

body.page-explore .collections-grid {
  gap: 14px;
}

body.page-explore .tag-chip {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
}

.app-shell {
  min-height: 100vh;
  padding-bottom: 64px;
}

.main-content {
  padding: 16px;
  background: transparent;
}

h1, h2, h3 {
  margin: 0 0 12px;
  color: var(--accent-strong);
}

h1 {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--accent-strong);
}

.card {
  background: radial-gradient(circle at top left, rgba(118,77,240,0.25), rgba(15,23,42,0.9));
  border-radius: 20px;
  padding: 18px 16px;
  box-shadow:
    0 18px 55px rgba(8, 6, 35, 0.8),
    0 0 0 1px rgba(148, 163, 255, 0.1);
  backdrop-filter: blur(22px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: none;
  padding: 11px 18px;
  font-size: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(118,77,240,0.55);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.2s ease;
}

.btn:active {
  transform: scale(0.97);
  box-shadow: 0 6px 18px rgba(0,0,0,0.5);
}

.btn-secondary {
  background: rgba(15,23,42,0.75);
  color: var(--accent-strong);
  border: 1px solid rgba(148, 163, 255, 0.4);
  box-shadow: none;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.input-group label {
  font-size: 13px;
  opacity: 0.8;
}

.input-group input,
.input-group textarea {
  border-radius: 999px;
  border: 1px solid rgba(148,163,255,0.35);
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
  background: rgba(15,23,42,0.85);
  color: var(--text);
}

.input-group textarea {
  border-radius: 16px;
  resize: vertical;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 64px;
  background: radial-gradient(circle at top, rgba(55,48,163,0.85), rgba(10,12,32,0.96));
  backdrop-filter: blur(18px);
  border-top: 1px solid rgba(148,163,255,0.3);
  z-index: 50;

  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.bottom-nav__group {
  display: flex;
  align-items: center;
  gap: 20px;
}

.bottom-nav__item {
  display: flex;
  align-items: center;
  justify-content: center;
}

.bottom-nav__icon {
  font-size: 22px;
  position: relative;
  color: #a26bff;
}

.bottom-nav__icon i {
  -webkit-text-stroke: 1.1px rgba(162,107,255,0.65); /* icône en contour léger */
  color: transparent;
  transition: color 0.18s ease, -webkit-text-stroke 0.18s ease, text-shadow 0.18s ease;
}

.bottom-nav__item--active .bottom-nav__icon i {
  -webkit-text-stroke: 0;
  color: var(--accent-strong); /* icône pleine */
  text-shadow: 0 0 12px rgba(162, 107, 255, 0.9);
}

.bottom-nav__badge {
  position: absolute;
  top: -4px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.bottom-nav__fab {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  z-index: 60;
}

.bottom-nav__fab-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 0%, var(--accent-strong), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 28px;
  border: none;
  box-shadow: 0 16px 40px rgba(118,77,240,0.85);
}

.collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.collection-card {
  background: radial-gradient(circle at top, rgba(118,77,240,0.32), var(--card-bg));
  border-radius: 18px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow:
    0 14px 40px rgba(5, 7, 31, 0.85),
    0 0 0 1px rgba(148, 163, 255, 0.14);
}

.collection-card__cover {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  background-color: #d0d0d5;
  position: relative;
}

.collection-card__like {
  position: absolute;
  right: 6px;
  bottom: 6px;
}

.collection-card__title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.collection-card__meta {
  font-size: 12px;
  color: var(--text-muted);
}

.collections-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.collections-toolbar input[type="search"] {
  flex: 1;
  border-radius: 999px;
  border: none;
  padding: 8px 12px;
  font-size: 14px;
}

.collections-toolbar select {
  border-radius: 999px;
  border: none;
  padding: 8px 12px;
  font-size: 14px;
}

.collections-visibility-filter {
  border-radius: 999px;
  border: none;
  padding: 8px 12px;
  font-size: 14px;
}

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  border: none;
  padding: 4px 8px;
  font-size: 11px;
  background: #e0def9;
  color: #764df0;
  cursor: pointer;
}

.like-btn.is-liked {
  background: #764df0;
  color: #ffffff;
}

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #dcdce5;
  flex-shrink: 0;
}

.toggle__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: transform 0.2s ease;
}

.toggle--on {
  background: #764df0;
}

.toggle--on .toggle__thumb {
  transform: translateX(20px);
}

/* Image de fond uniquement sur la page de connexion */
body.login-page {
  background-image: url('../img/bg_log.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.auth-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 16px 64px;
}

.auth-hero {
  margin-bottom: 24px;
}

.auth-hero-title {
  font-size: 26px;
  font-weight: 700;
}

.auth-hero-sub {
  font-size: 14px;
  opacity: 0.8;
}

.form-card {
  margin-top: 8px;
}

.error-list {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  color: #b3261e;
  font-size: 13px;
}

@media (min-width: 768px) {
  .auth-layout {
    max-width: 100%;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: transparent;
  }
  
  .auth-layout .card {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
  }
}

/* Style uniforme pour les champs fichier */
.input-group input[type="file"] {
  border-radius: 999px;
  padding: 6px 10px;
  background: #d0cce5;
  font-size: 13px;
}

.input-group input[type="file"]::file-selector-button {
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  margin-right: 8px;
  background: #ffffff;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.input-group input[type="file"]::file-selector-button:hover {
  background: #ece9ff;
}

/* Overlay de chargement pour les uploads */
.upload-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 20, 53, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.upload-overlay__box {
  background: transparent;
  border-radius: 16px;
  padding: 16px 18px;
  max-width: 260px;
  width: 80%;
  text-align: center;
}

.upload-overlay__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  animation: upload-pulse 1.4s infinite ease-in-out;
}

.upload-overlay__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.upload-overlay__title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.upload-overlay__subtitle {
  font-size: 12px;
  opacity: 0.8;
  margin-bottom: 10px;
}

.upload-overlay__bar {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: #e0def9;
  overflow: hidden;
}

.upload-overlay__bar-inner {
  position: absolute;
  left: -40%;
  top: 0;
  bottom: 0;
  width: 40%;
  border-radius: 999px;
  background: var(--accent);
  animation: upload-bar-slide 1s infinite ease-in-out;
}

@keyframes upload-bar-slide {
  0% { transform: translateX(0); }
  50% { transform: translateX(160%); }
  100% { transform: translateX(320%); }
}

@keyframes upload-pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.06);
    opacity: 0.9;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
