/**
 * Kissbook Swipe – Style global (v4.3)
 * Auteur : Smounse 🐐💋
 * Inspiré du concept Kissbook : doux, arrondi, coloré, fluide.
 */

/* === Reset basique === */
.kissbook-container, .kissbook-card, .kissbook-buttons, .kissbook-debug {
  box-sizing: border-box;
}
.kissbook-container * {
  transition: all .25s ease-in-out;
}

/* === Deck principal === */
.kissbook-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 20px auto;
  max-width: 420px;
  position: relative;
  font-family: 'Segoe UI', sans-serif;
}

.kissbook-card {
  width: 100%;
  height: 540px;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  background: #f9f9f9;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  margin-bottom: 12px;
  cursor: pointer;
  user-select: none;
}

.kissbook-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kissbook-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
  padding: 20px;
  color: #fff;
}

.kissbook-info h3 {
  margin: 0;
  font-size: 22px;
}
.kissbook-info p {
  font-size: 14px;
  opacity: 0.9;
  margin: 6px 0 0;
}

/* === Boutons d’action === */
.kissbook-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 25px;
}

.kissbook-row {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.kissbook-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 3px 6px rgba(0,0,0,0.2);
  transition: transform .2s, box-shadow .3s;
}

.kissbook-btn:hover {
  transform: scale(1.12);
  box-shadow: 0 5px 12px rgba(0,0,0,0.3);
}

.kissbook-btn.pass { background: #e74c3c; }
.kissbook-btn.like { background: #2ecc71; }
.kissbook-btn.superlike { background: #00bfff; }
.kissbook-btn.rewind { background: #f39c12; }
.kissbook-btn.boost { background: #9b59b6; }

/* === Réorganisation 2x2 === */
.kissbook-buttons .kissbook-row:first-child .kissbook-btn.pass { order: 1; }
.kissbook-buttons .kissbook-row:first-child .kissbook-btn.like { order: 2; }
.kissbook-buttons .kissbook-row:last-child .kissbook-btn.rewind { order: 1; }
.kissbook-buttons .kissbook-row:last-child .kissbook-btn.superlike { order: 2; }

/* === Animation de swipe === */
.kissbook-card.swipe-left { transform: rotate(-8deg) translateX(-120%); opacity: 0; }
.kissbook-card.swipe-right { transform: rotate(8deg) translateX(120%); opacity: 0; }
.kissbook-card.swipe-up { transform: rotate(0deg) translateY(-120%); opacity: 0; }

/* === Effet “Bisou magique ✨” === */
.kissbook-bisou {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.1);
  font-size: 80px;
  animation: bisouMagic 1.2s ease-out forwards;
  z-index: 99999;
  pointer-events: none;
  text-shadow: 0 0 10px #ff66b2, 0 0 20px #ff33aa;
}

@keyframes bisouMagic {
  0% {
    transform: translate(-50%, -50%) scale(0.2);
    opacity: 0;
  }
  30% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
  }
  70% {
    transform: translate(-50%, -60%) scale(1);
    opacity: 0.9;
  }
  100% {
    transform: translate(-50%, -70%) scale(0.8);
    opacity: 0;
  }
}

/* === Popup de match === */
#kissbook-match-popup {
  animation: fadeInPopup 0.4s ease-in;
}
@keyframes fadeInPopup {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* === Bouton "?" en bas à droite === */
#kbsw-help {
  position: fixed;
  right: 20px;
  bottom: 25px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #2d3436;
  color: #fff;
  border: none;
  font-weight: 800;
  cursor: pointer;
  font-size: 20px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  z-index: 1000;
  transition: transform .25s ease, background .25s ease;
}
#kbsw-help:hover {
  transform: scale(1.1);
  background: #e84393;
}

/* === Popup quotas glissant === */
#kbsw-help-popup {
  position: fixed;
  right: 20px;
  bottom: 80px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 25px rgba(0,0,0,0.25);
  width: 260px;
  padding: 15px 18px;
  text-align: left;
  color: #222;
  font-size: 15px;
  opacity: 0;
  transform: translateY(15px);
  transition: all .3s ease;
  z-index: 1001;
}
#kbsw-help-popup.show {
  opacity: 1;
  transform: translateY(0);
}
#kbsw-help-popup h4 {
  margin: 0 0 8px;
  color: #e84393;
  font-size: 16px;
}
#kbsw-help-popup ul {
  list-style: disc;
  margin: 0;
  padding-left: 20px;
}
#kbsw-help-popup li {
  margin: 4px 0;
  font-size: 14px;
}

/* === Debug Panel amélioré === */
#kbsw-debug {
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  font-family: monospace;
  font-size: 13px;
}
#kbsw-debug-header {
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}
#kbsw-debug pre {
  white-space: pre-wrap;
  word-break: break-word;
}
#kbsw-copy {
  background: #fff;
  color: #111;
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 12px;
  cursor: pointer;
  border: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
#kbsw-copy:hover {
  background: #e7f7ef;
}
#kbsw-debug-content {
  background: #181818;
  color: #cfcfcf;
}
#kbsw-toggle-icon {
  font-weight: bold;
}

/* === Accessibilité === */
.kissbook-btn:focus {
  outline: 2px solid #00b894;
  outline-offset: 3px;
}
.kissbook-card:focus {
  outline: 2px solid #00b894;
}

/* === Message de fin de deck === */
.kissbook-end-message {
  text-align: center;
  color: #888;
  padding: 30px 0;
  font-size: 16px;
}

/* === Scrollbar fine pour le debug === */
#kbsw-debug::-webkit-scrollbar {
  width: 8px;
}
#kbsw-debug::-webkit-scrollbar-thumb {
  background-color: #00b894;
  border-radius: 4px;
}

/* === Toast notifications === */
.kbsw-toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  opacity: 0;
  transition: all .3s ease;
  z-index: 9999;
  pointer-events: none;
}
.kbsw-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
