/* Module Lettres-Calques */
.cdesigner-letter-wrapper {
  display: flex;
  position: relative;
}

.cdesigner-sidebar {
  width: 60px;
  background: #fff;
  border-right: 1px solid #ddd;
  padding: 20px 10px;
}

.cdesigner-sidebar button {
  width: 40px;
  height: 40px;
  border: none;
  background: #f5f5f5;
  border-radius: 8px;
  cursor: pointer;
  font-size: 20px;
  margin-bottom: 10px;
  transition: all 0.3s;
}

.cdesigner-sidebar button:hover {
  background: #e0e0e0;
}

.cdesigner-sidebar button.active {
  background: #00bcd4;
  color: white;
}

.cdesigner-panel {
  width: 350px;
  background: #fafafa;
  border-right: 1px solid #ddd;
  overflow-y: auto;
  max-height: 80vh;
}

.panel-header {
  background: white;
  padding: 20px;
  border-bottom: 1px solid #ddd;
}

.panel-header h2 {
  margin: 0 0 5px 0;
  font-size: 20px;
}

.panel-header p {
  margin: 0;
  color: #666;
  font-size: 14px;
}

.panel-section {
  padding: 20px;
  background: white;
  margin-bottom: 1px;
}

.btn-upload {
  width: 100%;
  padding: 12px;
  background: #222;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.3s;
}

.btn-upload:hover {
  background: #444;
}

.preview-image {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 15px;
  border: 2px solid #ddd;
}

.categories {
  display: flex;
  gap: 8px;
}

.categories button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: #e0e0e0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s;
}

.categories button:hover {
  background: #d0d0d0;
}

.categories button.active {
  background: #222;
  color: white;
}

.letter-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.letter-btn {
  aspect-ratio: 1;
  border: 2px solid #ddd;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 24px;
  font-weight: bold;
  color: #333;
  transition: all 0.2s;
}

.letter-btn:hover {
  background: #e3f2fd;
  border-color: #00bcd4;
  color: #00bcd4;
  transform: scale(1.05);
}

.text-center {
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-size: 14px;
}

.letter-preview {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  display: flex;
  gap: 10px;
  max-width: 80%;
  overflow-x: auto;
  z-index: 1000;
}

.letter-item {
  position: relative;
  flex-shrink: 0;
}

.letter-item img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border: 2px solid #ddd;
  border-radius: 8px;
}

.delete-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f44336;
  color: white;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.2s;
}

.letter-item:hover .delete-btn {
  opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
  .cdesigner-panel {
    width: 100%;
    max-width: 100%;
  }
  
  .letter-preview {
    left: 10px;
    right: 10px;
    transform: none;
    max-width: calc(100% - 20px);
  }
}