/* ===================================
   Seed I.T - Système de Votes Up/Down
   Variables et styles globaux
   =================================== */

:root {
  /* Variables Seed I.T officielles */
  --seedit-primary: #037CFB;
  --seedit-primary-light: #4DB6FF;
  --seedit-bg-dark: #1a1a2e;
  --seedit-bg-darker: #16213e;
  --seedit-radius: 12px;
  --seedit-transition: 0.25s ease;
  --seedit-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);

  /* Variables spécifiques aux votes */
  --seedit-vote-upvote: #10B981;
  --seedit-vote-downvote: #EF4444;
  --seedit-vote-neutral: rgba(255, 255, 255, 0.5);
  --seedit-vote-bg: rgba(255, 255, 255, 0.05);
  --seedit-vote-btn-size: 36px;
  --seedit-vote-gap: 8px;
}

/* Reset et base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #ffffff;
  min-height: 100vh;
  padding: 2rem;
}

/* ===================================
   Conteneur principal de démonstration
   =================================== */

.seedit-vote-demo {
  max-width: 1200px;
  margin: 0 auto;
}

.seedit-vote-demo__title {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--seedit-primary) 0%, var(--seedit-primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.seedit-vote-demo__description {
  text-align: center;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 3rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* ===================================
   Sections de démonstration
   =================================== */

.seedit-vote-demo__section {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--seedit-radius);
  padding: 2rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(10px);
}

.seedit-vote-demo__section--dark {
  background: rgba(0, 0, 0, 0.3);
}

.seedit-vote-demo__section-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--seedit-primary-light);
  text-align: center;
}

.seedit-vote-demo__section-desc {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 2rem;
  text-align: center;
}

.seedit-vote-demo__examples {
  display: flex;
  flex-wrap: wrap;
  gap: 3rem;
  justify-content: center;
  align-items: flex-start;
}

.seedit-vote-demo__item {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.seedit-vote-demo__label {
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
}

/* ===================================
   Composant Vote (vertical par défaut)
   =================================== */

.seedit-vote {
  /* Structure */
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: var(--seedit-vote-gap);

  /* Style de base */
  background: var(--seedit-vote-bg);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px;

  /* Effets */
  transition: border-color var(--seedit-transition);
}

/* ===================================
   Boutons de vote
   =================================== */

.seedit-vote__btn {
  /* Structure */
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--seedit-vote-btn-size);
  height: var(--seedit-vote-btn-size);
  padding: 0;

  /* Style de base */
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: var(--seedit-vote-neutral);
  cursor: pointer;

  /* Transitions */
  transition: all var(--seedit-transition);

  /* Reset native button styles */
  font: inherit;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.seedit-vote__btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.seedit-vote__btn:active:not(:disabled) {
  transform: translateY(0) scale(0.95);
}

.seedit-vote__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Bouton upvote */
.seedit-vote__btn--up:hover:not(:disabled):not(.seedit-vote__btn--active) {
  color: var(--seedit-vote-upvote);
  border-color: var(--seedit-vote-upvote);
}

.seedit-vote__btn--up.seedit-vote__btn--active {
  background: var(--seedit-vote-upvote);
  border-color: var(--seedit-vote-upvote);
  color: #ffffff;
}

/* Bouton downvote */
.seedit-vote__btn--down:hover:not(:disabled):not(.seedit-vote__btn--active) {
  color: var(--seedit-vote-downvote);
  border-color: var(--seedit-vote-downvote);
}

.seedit-vote__btn--down.seedit-vote__btn--active {
  background: var(--seedit-vote-downvote);
  border-color: var(--seedit-vote-downvote);
  color: #ffffff;
}

/* Icônes */
.seedit-vote__icon {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.seedit-vote__btn:hover:not(:disabled) .seedit-vote__icon {
  transform: scale(1.1);
}

.seedit-vote__btn--active .seedit-vote__icon {
  transform: scale(1.15);
}

/* ===================================
   Compteur
   =================================== */

.seedit-vote__count {
  /* Structure */
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 4px 8px;

  /* Style de base */
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;

  /* Animation au changement */
  transition: transform 0.2s ease, color 0.3s ease;
}

/* Animation lorsque le score change */
.seedit-vote__count--updating {
  animation: seedit-vote-pulse 0.4s ease;
}

@keyframes seedit-vote-pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* Couleur du compteur selon le score */
.seedit-vote--upvoted .seedit-vote__count {
  color: var(--seedit-vote-upvote);
}

.seedit-vote--downvoted .seedit-vote__count {
  color: var(--seedit-vote-downvote);
}

/* ===================================
   VARIANTE : Compact
   =================================== */

.seedit-vote--compact {
  --seedit-vote-btn-size: 28px;
  --seedit-vote-gap: 6px;
  padding: 6px;
}

.seedit-vote--compact .seedit-vote__count {
  font-size: 0.875rem;
  min-width: 32px;
}

/* ===================================
   VARIANTE : Large
   =================================== */

.seedit-vote--large {
  --seedit-vote-btn-size: 44px;
  --seedit-vote-gap: 10px;
  padding: 10px;
}

.seedit-vote--large .seedit-vote__count {
  font-size: 1.25rem;
  min-width: 50px;
}

/* ===================================
   VARIANTE : Minimal
   =================================== */

.seedit-vote--minimal {
  background: transparent;
  border: none;
  padding: 4px;
}

.seedit-vote--minimal .seedit-vote__btn {
  border: none;
  background: transparent;
}

.seedit-vote--minimal .seedit-vote__btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
}

/* ===================================
   VARIANTE : Colored
   =================================== */

.seedit-vote--colored .seedit-vote__btn--up {
  color: var(--seedit-vote-upvote);
  border-color: var(--seedit-vote-upvote);
}

.seedit-vote--colored .seedit-vote__btn--down {
  color: var(--seedit-vote-downvote);
  border-color: var(--seedit-vote-downvote);
}

.seedit-vote--colored .seedit-vote__btn--up:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.2);
}

.seedit-vote--colored .seedit-vote__btn--down:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.2);
}

/* ===================================
   VARIANTE : Horizontal
   =================================== */

.seedit-vote--horizontal {
  flex-direction: row;
  padding: 6px 10px;
}

.seedit-vote--horizontal .seedit-vote__count {
  min-width: 50px;
}

/* ===================================
   VARIANTE : Disabled
   =================================== */

.seedit-vote--disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.05);
}

/* ===================================
   Exemple : Post Card
   =================================== */

.seedit-post-card {
  display: flex;
  gap: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: transform var(--seedit-transition), box-shadow var(--seedit-transition);
}

.seedit-post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--seedit-shadow);
}

.seedit-post-card__vote {
  flex-shrink: 0;
}

.seedit-post-card__content {
  flex: 1;
  min-width: 0;
}

.seedit-post-card__title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.seedit-post-card__text {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.seedit-post-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

.seedit-post-card__author {
  color: var(--seedit-primary-light);
  font-weight: 500;
}

.seedit-post-card__separator {
  color: rgba(255, 255, 255, 0.3);
}

.seedit-post-card__comments {
  color: rgba(255, 255, 255, 0.6);
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 768px) {
  .seedit-vote-demo__title {
    font-size: 2rem;
  }

  .seedit-vote-demo__section {
    padding: 1.5rem;
  }

  .seedit-vote-demo__examples {
    gap: 2rem;
  }

  .seedit-post-card {
    flex-direction: column;
    gap: 1rem;
  }

  .seedit-post-card__vote {
    align-self: flex-start;
  }

  .seedit-vote--horizontal {
    align-self: stretch;
    justify-content: center;
  }
}

@media (max-width: 375px) {
  body {
    padding: 1rem;
  }

  .seedit-vote-demo__title {
    font-size: 1.75rem;
  }

  .seedit-vote-demo__description {
    font-size: 1rem;
  }

  .seedit-vote-demo__section {
    padding: 1.25rem;
  }

  .seedit-vote-demo__examples {
    gap: 1.5rem;
  }

  .seedit-vote {
    --seedit-vote-btn-size: 32px;
  }

  .seedit-vote__count {
    font-size: 0.95rem;
  }

  .seedit-post-card {
    padding: 1.25rem;
  }

  .seedit-post-card__title {
    font-size: 1.125rem;
  }

  .seedit-post-card__text {
    font-size: 0.9rem;
  }
}
