/* ========== BASE ========== */
body, html {
  margin: 0;
  font-family: sans-serif;
  height: 100vh;
  background: url('/carbon-fiber.jpg') center/cover no-repeat;
  color: white;
}

/* ========== STRUCTURE ========== */
.app {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
}

/* ========== SIDEBAR (DESKTOP) ========== */
.sidebar {
  background: rgba(0, 0, 0, 0.85);
  width: 260px;
  padding: 20px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.sidebar .logo {
  max-height: 80px;
  margin-bottom: 20px;
  object-fit: contain;
}

.sidebar h2 {
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 20px;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar li {
  padding: 10px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s;
}

.sidebar li:hover,
.sidebar li.active {
  background-color: #d21f3c;
}

/* ========== MOBILE HEADER (MOBILE) ========== */
.mobile-header {
  display: none;
}

@media (max-width: 768px) {
  .app {
    flex-direction: column;
  }

  .sidebar {
    display: none;
  }

  .mobile-header {
    background: #111;
    display: flex;
    flex-direction: column;
    padding: 15px;
    align-items: flex-start;
  }

  .mobile-header img {
    height: 40px;
    margin-bottom: 10px;
    max-width: 100%;
    width: auto;
  }


  .mobile-header select {
    background-color: #222;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    border: none;
    width: 100%;
  }

  #category-menu-mobile {
    background-color: #222;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    border: none;
    width: 100%;
  }
}

/* ========== MAIN CONTENT ========== */
.main {
  flex: 1;
  padding: 20px;
  background: rgba(0, 0, 0, 0.65);
  overflow-y: auto;
}

/* ========== FILE LISTING CARDS ========== */
.files {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #111;
  border-radius: 10px;
  text-decoration: none;
  color: white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}

.file:hover {
  transform: translateY(-2px);
  background-color: #1a1a1a;
}

.file .icon {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
}

.file .icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px; /* ✅ Pour de jolis coins arrondis */*
}

.file .label {
  font-size: 1.3rem;
  font-weight: bold;
  flex-grow: 1;
  word-break: break-word;
}

/* ========== CATEGORY LIST ========== */
/* Liste des catégories - version de base (desktop) */
.category-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.category-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1a1a1a;
  margin: 10px 0;
  padding: 12px 16px;
  border-radius: 8px;
  width: 100%;
  box-sizing: border-box;
  flex-wrap: wrap; /* utile pour mobile */
}

.category-list li span:first-child {
  flex-grow: 1;
  color: white;
  font-size: 1rem;
}

/* Boutons */
.category-list li span:last-child {
  display: flex;
  gap: 8px;
}

/* Style boutons */
.category-list button {
  background: #444;
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.2s;
}

.category-list button:hover {
  background: #d21f3c;
}

/* === MOBILE === */
@media (max-width: 600px) {
  .category-list li {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .category-list li span:first-child {
    margin-bottom: 10px;
  }

  .category-list li span:last-child {
    justify-content: center;
    flex-wrap: wrap;
  }
  
}


/* ========== FORMULAIRE CHAMPS ========== */

#add-category-form {
  display: flex;
  gap: 10px;
  margin: 20px 0;
  flex-wrap: wrap;
}

#add-category-form input[type="text"] {
  padding: 10px;
  border-radius: 6px;
  border: none;
  background-color: #222;
  color: white;
  flex: 1;
  min-width: 200px;
}

#add-category-form button {
  padding: 10px 16px;
  background-color: #d21f3c;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

#add-category-form button:hover {
  background-color: #a7192e;
}

/* ========== AJOUT SIGNET ANDROID ========== */

.add-to-home {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #d21f3c;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  z-index: 1000;
}

#search-input {
  padding: 10px;
  border-radius: 6px;
  border: none;
  background-color: #222;
  color: white;
  font-size: 16px;
  width: 100%;
  max-width: 500px;
  box-sizing: border-box;
  margin: 20px auto;
  display: block;
}

/* ========== PAGE UPLOAD ========== */

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-width: 500px;
  margin: 20px auto;
  padding: 20px;
  background-color: #2b2b2b;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.upload-form label {
  color: white;
  font-weight: bold;
}

.upload-form select,
.upload-form input[type="file"],
.upload-form input[type="text"],
.upload-form button {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: none;
  font-size: 16px;
  background-color: #3a3a3a;
  color: white;
  box-sizing: border-box; /* ✅ Très important pour fixer les débordements */
}


.upload-form button {
  background-color: #d32f2f;
  cursor: pointer;
  transition: background-color 0.3s;
}

.upload-form button:hover {
  background-color: #b71c1c;
}

