/* lachoulette.css */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 600px;
  margin: 0 auto;
}

.header {
  text-align: center;
  margin-bottom: 30px;
  color: white;
  position: relative;
}

.header h1 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.language-selector {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}

.lang-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s;
  backdrop-filter: blur(10px);
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.lang-btn.active {
  background: rgba(255, 255, 255, 0.4);
  border-color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.status-badge {
  display: inline-block;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  font-size: 0.875rem;
  margin-top: 10px;
}

.status-badge.loading {
  background: #F59E0B;
}

.status-badge.ready {
  background: #10B981;
}

.card {
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  overflow: hidden;
}

.image-area {
  position: relative;
  background: #1a1a1a;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-area video,
.image-area img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.placeholder {
  text-align: center;
  color: #666;
  padding: 40px;
}

.placeholder svg {
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
  opacity: 0.3;
}

.controls {
  padding: 20px;
}

.button-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 15px;
}

button, .file-label {
  padding: 15px 20px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: #4F46E5;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #4338CA;
  transform: translateY(-2px);
}

.btn-secondary {
  background: #9333EA;
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  background: #7E22CE;
  transform: translateY(-2px);
}

.btn-success {
  background: #10B981;
  color: white;
  grid-column: 1 / -1;
}

.btn-success:hover:not(:disabled) {
  background: #059669;
}

.btn-danger {
  background: #EF4444;
  color: white;
  grid-column: 1 / -1;
}

.btn-danger:hover {
  background: #DC2626;
}

.btn-gray {
  background: #E5E7EB;
  color: #374151;
  grid-column: 1 / -1;
}

.btn-gray:hover {
  background: #D1D5DB;
}

.file-label {
  background: #9333EA;
  color: white;
}

.file-label:hover {
  background: #7E22CE;
  transform: translateY(-2px);
}

input[type="file"] {
  display: none;
}

.info-panel {
  border-top: 1px solid #E5E7EB;
  padding: 25px;
  background: linear-gradient(135deg, #EEF2FF 0%, #F3E8FF 100%);
}

.info-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 20px;
}

.info-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #4F46E5;
  font-size: 1.5rem;
  font-weight: bold;
}

.confidence-score {
  display: inline-block;
  padding: 4px 12px;
  background: #10B981;
  color: white;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-left: 10px;
}

.close-btn {
  background: none;
  border: none;
  color: #9CA3AF;
  cursor: pointer;
  padding: 5px;
}

.close-btn:hover {
  color: #4B5563;
}

.object-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #1F2937;
  margin-bottom: 15px;
}

.object-description {
  color: #4B5563;
  line-height: 1.6;
  margin-bottom: 15px;
}

.keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword {
  padding: 6px 14px;
  background: #C7D2FE;
  color: #4338CA;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
}

.gallery {
  background: white;
  border-radius: 20px;
  padding: 25px;
  margin-top: 30px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.gallery h2 {
  font-size: 1.5rem;
  color: #1F2937;
  margin-bottom: 20px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.gallery-item {
  background: #F9FAFB;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s;
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.gallery-item-image {
  aspect-ratio: 1;
  background: #E5E7EB;
  overflow: hidden;
}

.gallery-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item-title {
  padding: 12px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #1F2937;
  line-height: 1.3;
}

.loading {
  text-align: center;
  padding: 20px;
  color: #4F46E5;
  font-weight: 600;
}

.spinner {
  border: 3px solid #E5E7EB;
  border-top: 3px solid #4F46E5;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.hidden {
  display: none;
}

canvas {
  display: none;
}

.match-details {
  background: rgba(255, 255, 255, 0.5);
  padding: 15px;
  border-radius: 12px;
  margin-top: 15px;
  font-size: 0.875rem;
}

.match-details h4 {
  color: #4F46E5;
  margin-bottom: 8px;
  font-size: 1rem;
}

.similarity-bar {
  width: 100%;
  height: 8px;
  background: #E5E7EB;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}

.similarity-fill {
  height: 100%;
  background: linear-gradient(90deg, #10B981, #34D399);
  transition: width 0.5s ease;
}

.matched-image-info {
  margin-top: 10px;
  font-size: 0.75rem;
  color: #6B7280;
  font-style: italic;
}

/* Styles pour les cartes d'objets multiples */
#objectsContainer {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Popup Carrousel */
.carousel-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.carousel-container {
  width: 100%;
  max-width: 500px;
  position: relative;
}

.carousel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  color: white;
}

.carousel-title {
  font-size: 1.5rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 10px;
}

.carousel-counter {
  background: rgba(255, 255, 255, 0.2);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
}

.carousel-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  flex-shrink: 0;
}

.carousel-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.carousel-close svg {
  display: block;
  width: 20px;
  height: 20px;
}

.carousel-content {
  position: relative;
  overflow: hidden;
}

.carousel-slides {
  display: flex;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-slide {
  min-width: 100%;
  padding: 0 10px;
}

.carousel-card {
  background: white;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  animation: slideIn 0.4s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.carousel-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.carousel-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 50%;
  font-weight: bold;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.carousel-confidence {
  background: #10B981;
  color: white;
  padding: 8px 16px;
  border-radius: 16px;
  font-size: 1.125rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.carousel-object-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1F2937;
  margin-bottom: 15px;
  line-height: 1.3;
}

.carousel-object-description {
  color: #4B5563;
  line-height: 1.7;
  margin-bottom: 20px;
  font-size: 1.05rem;
}

.carousel-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.carousel-keyword {
  padding: 8px 16px;
  background: linear-gradient(135deg, #E0E7FF 0%, #F3E8FF 100%);
  color: #4338CA;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
}

.carousel-match-info {
  background: linear-gradient(135deg, #EEF2FF 0%, #F3E8FF 100%);
  padding: 15px;
  border-radius: 12px;
  margin-top: 15px;
}

.carousel-similarity-bar {
  width: 100%;
  height: 10px;
  background: #E5E7EB;
  border-radius: 5px;
  overflow: hidden;
  margin-top: 10px;
}

.carousel-similarity-fill {
  height: 100%;
  background: linear-gradient(90deg, #10B981, #34D399);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.carousel-view-info {
  margin-top: 10px;
  font-size: 0.875rem;
  color: #6B7280;
  font-style: italic;
}

.carousel-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  gap: 15px;
}

.carousel-nav-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}

.carousel-nav-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.3);
  border-color: white;
  transform: scale(1.1);
}

.carousel-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.carousel-nav-btn svg {
  display: block;
  width: 20px;
  height: 20px;
}

.carousel-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex: 1;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.3s;
}

.carousel-dot.active {
  background: white;
  width: 28px;
  border-radius: 5px;
}

.carousel-dot:hover {
  background: rgba(255, 255, 255, 0.6);
}

/* Responsive */
@media (max-width: 480px) {
  .carousel-card {
    padding: 20px;
  }
  
  .carousel-object-title {
    font-size: 1.5rem;
  }
  
  .carousel-rank {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
}

.object-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
}

.object-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.object-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.object-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 50%;
  font-weight: bold;
  font-size: 0.875rem;
}

.object-card .confidence-score {
  background: #10B981;
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 600;
}

.object-card .object-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #1F2937;
  margin-bottom: 10px;
}

.object-card .object-description {
  color: #4B5563;
  line-height: 1.5;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.object-card .keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.object-card .keyword {
  padding: 4px 10px;
  background: #E0E7FF;
  color: #4338CA;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.object-card .match-details {
  background: rgba(79, 70, 229, 0.05);
  padding: 10px;
  border-radius: 8px;
  margin-top: 12px;
}

.object-card .similarity-bar {
  width: 100%;
  height: 6px;
  background: #E5E7EB;
  border-radius: 3px;
  overflow: hidden;
}

.object-card .similarity-fill {
  height: 100%;
  background: linear-gradient(90deg, #10B981, #34D399);
  transition: width 0.5s ease;
}

.logo_la_choulette{
    width: 48px;
}