body {
  margin:0;
  padding:20px;
  font-family:'Segoe UI', Arial, sans-serif;
  background: linear-gradient(160deg,#121212 0%,#1a1a1a 100%);
  color:#f5f5f5;
  display:flex;
  flex-direction:column;
  align-items:center;
  min-height:100vh;
}

#logo { width:90px; margin-bottom:10px; animation:fadeIn 1s ease; }
h1 { font-size:2rem; color:#00c896; margin-bottom:20px; opacity:0; animation:fadeIn 1s ease 0.3s forwards; text-align:center; }

#reader { width:300px; max-width:90vw; border:2px solid #00c896; border-radius:12px; overflow:hidden; margin-bottom:15px; }

button,input[type="file"] {
  background-color:#1e1e1e;
  color:#f5f5f5;
  border:1px solid #00c896;
  border-radius:8px;
  padding:10px 15px;
  margin:5px;
  cursor:pointer;
  transition:0.3s;
}
button:hover,input[type="file"]:hover {background-color:#00c896;color:#121212;}
#rescan-btn:hover {animation:pulse 1s infinite;}

#welcome-popup {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 1000;
}

#welcome-popup.show {
  opacity: 1;
  pointer-events: auto;
}

.popup-content {
  background: #1e1e1e;
  border: 2px solid #00c896;
  border-radius: 16px;
  padding: 25px 20px;
  max-width: 350px;
  text-align: center;
  color: #f5f5f5;
  position: relative;
  animation: popIn 0.5s ease;
}

#close-popup {
  position: absolute;
  top: 2px;
  right: 2px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #00c896;
  cursor: pointer;
  transition: color 0.2s;
}
#close-popup:hover { color: #00ffb0; }

.popup-content h2 { margin-top: 0; color: #00c896; }
.popup-content ul { text-align: left; padding-left: 20px; margin-top: 10px; }

@keyframes popIn {
  0% { transform: scale(0.7); opacity: 0; }
  60% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); }
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 4px; /* espace uniforme entre les items */
  width: 100%;
  max-width: 600px;
  margin: 20px auto;
}

/* Chaque item */
.faq-item {
  background: rgba(30,30,30,0.7);
  border-radius: 12px;
  overflow: hidden;
  transition: background 0.3s;
}

/* Question */
.faq-question {
  width: 100%;
  text-align: left;
  background: rgba(30,30,30,0.7);
  color: #f5f5f5;
  border: none;
  padding: 12px 15px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
  margin: 0; /* géré par gap du conteneur */
  position: relative;
}

/* Hover question */
.faq-question:hover { 
  background: rgba(0,200,150,0.2); 
}

/* Flèche */
.faq-question::after {
  content: "▼";
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  transition: transform 0.3s;
}

.faq-item.active .faq-question::after {
  transform: translateY(-50%) rotate(-180deg);
}

/* Réponse */
.faq-answer {
  width: 100%;
  box-sizing: border-box;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  padding: 0 15px;
  color: #f5f5f5;
  font-size: 0.95rem;
  line-height: 1.5;
  opacity: 0;           /* invisible quand fermé */
  will-change: max-height, opacity;
}

.faq-item.active .faq-answer {
  max-height: 500px;
  opacity: 1;           /* visible quand ouvert */
}

#loader {
  display:none;
  margin:15px;
  border:4px solid #f3f3f3;
  border-top:4px solid #00c896;
  border-radius:50%;
  width:36px;height:36px;
  animation:spin 1s linear infinite;
}

.result-bubble {
  margin-top:20px;
  padding:18px;
  border-radius:16px;
  width:90%;
  max-width:400px;
  text-align:center;
  display:none;
  transform:scale(0.8);
  opacity:0;
  position:relative;
  transition:all 0.4s ease;
}
.result-bubble.show {
  display:block;
  transform:scale(1);
  opacity:1;
  animation:popIn 0.5s ease, pulse 1.5s infinite alternate;
}
.result-bubble.safe {background:#003d2e;border:1px solid #00c896;box-shadow:0 0 10px #00c896;}
.result-bubble.warning {background:#3d2e00;border:1px solid #ffa500;box-shadow:0 0 10px #ffa500;}
.result-bubble.danger {background:#3d0000;border:1px solid #ff4c4c;box-shadow:0 0 10px #ff4c4c;}
.result-bubble.unreachable {background:#2e2e2e;border:1px solid #808080;box-shadow:0 0 10px #808080;}

a { color:#00c896; text-decoration:none; font-weight:bold; }
a:hover { text-decoration:underline; }

#history {margin-top:25px;width:90%;max-width:420px;display:flex;flex-direction:column;gap:8px;}
.history-item {
  background: rgba(30,30,30,0.7);
  border-radius:12px;
  padding:10px 12px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  opacity:0;
  transform:translateY(20px);
  animation:fadeInUp 0.5s forwards;
}
.history-item.safe {border-left:4px solid #00c896;}
.history-item.warning {border-left:4px solid #ffa500;}
.history-item.danger {border-left:4px solid #ff4c4c;}
.history-item.unreachable {border-left:4px solid #808080;}

.copy-btn {background:transparent;border:none;color:#00c896;cursor:pointer;font-size:0.9rem;}

@keyframes popIn {0%{transform:scale(0.7);opacity:0;}60%{transform:scale(1.1);opacity:1;}100%{transform:scale(1);}}
@keyframes fadeIn {from{opacity:0;transform:translateY(-10px);}to{opacity:1;transform:translateY(0);}}
@keyframes fadeInUp {0%{opacity:0;transform:translateY(20px);}100%{opacity:1;transform:translateY(0);}}
@keyframes spin {0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}
@keyframes pulse {0%{transform:scale(1);}50%{transform:scale(1.05);}100%{transform:scale(1);} }

