@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Raleway:ital,wght@0,100..900;1,100..900&display=swap');

.dpm-poll {
  /* max-width: 800px;
  margin: 20px auto; */
  min-height: 100vh;
  height: 100vh;
  position: relative;
  overflow-x: hidden;
  /* padding: 20px; */
  /* border-radius: 8px; */
  background: #0c142a;
  /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.dpm-poll-title {
  text-align: center;
  margin-bottom: 20px;
  font-size: 1.4rem;
}

.dpm-bars-wrapper {
  display: flex;
  flex-direction: row;
  gap: 10px;
  padding: 15px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  box-sizing: border-box;
  z-index: 10;
}

.dpm-bar {
  position: relative;
  background: #f2f2f2;
  border-radius: 999px;
  overflow: hidden;
  height: 32px;
  width: 50%;
  flex: 1;
  min-width: 0;
}

.dpm-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, #0073aa, #00a0d2);
  transition: width 0.4s ease;
}

.dpm-bar-2 .dpm-bar-fill {
  background: linear-gradient(90deg, #ca4a1f, #ff8a00);
}

.dpm-bar-label {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
  height: 100%;
  font-size: 0.85rem;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
}
.dpm-candidate-name{
  font-family: 'Raleway', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  /* text-transform: uppercase; */
  letter-spacing: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.dpm-percent{
  font-family: 'Raleway', sans-serif;
  font-size: 18px;
  font-weight: 700;
  /* color: #ffffff; */
  /* text-transform: uppercase; */
  letter-spacing: 1px;
  flex-shrink: 0;
  margin-left: 8px;
}
.dpm-candidates-wrapper {
  display: flex;
  /* gap: 20px; */
  justify-content: space-around;
  flex-wrap: wrap;
  min-height: 100vh;
  height: 100vh;
  align-items: center;
  position: relative;
  padding-top: 70px;
  box-sizing: border-box;
  background: linear-gradient(270deg, #600013, #00235b);
}

.dpm-candidates-wrapper:before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: url(https://balenvsoli.com/wp-content/plugins/digital-poll-manager/assets/img/versus_sign.png);
  width: 270px;
  height: 270px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 1;
  pointer-events: none;
}

.dpm-candidate-card {
  width: 50%;
  max-width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 70px);
  padding: 20px;
  box-sizing: border-box;
  position: relative;
  z-index: 2;
}

.dpm-candidate-image {
  width: 60%;
  max-width: 400px;
}
.dpm-candidate-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
}

.dpm-vote-button {
  margin-top: 10px;
  padding: 8px 18px;
  border-radius: 20px;
  border: none;
  background: #0073aa;
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

/* .dpm-candidate-card:nth-child(2) .dpm-vote-button {
  background: #ca4a1f;
} */
button.dpm-vote-button {
  text-transform: uppercase;
  font-family: 'Archivo Black', sans-serif;
  font-size: 20px;
  font-weight: 500;
  border: 2px solid transparent;
  border-radius: 28px;
  padding: 8px 32px;
  width: 35%;
  /* background: linear-gradient(135deg, #f39c12 0%, #f39c12 50%, #d68910 100%); */
  color: #ffffff;
  /* box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4); */
  border: 1px solid #d68910;
  background: #d68910;
}
button.dpm-vote-button:hover {
  /* background: linear-gradient(135deg, #f7dc6f 0%, #f4d03f 50%, #f39c12 100%); */
    color: #fff;
    /* border-color: transparent; */
    /* box-shadow: 0 6px 20px rgba(243, 156, 18, 0.6); */
    transform: translateY(-2px);
    background: transparent;
}
.dpm-vote-button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.dpm-vote-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.dpm-vote-count {
  margin-top: 6px;
  font-family: 'Archivo Black', sans-serif;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 3px;
  color: #fff;
  display: inline-block;
  overflow: hidden;
  width: 100%;
  text-align: center;
}

/* .dpm-vote-animate {
  animation: dpm-vote-slide-down 0.4s ease-out;
} */

@keyframes dpm-vote-slide-down {
  0% {
    transform: translateY(-100%);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}


/* Tablet Styles (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
  .dpm-bars-wrapper {
    gap: 15px;
    padding: 15px;
  }

  .dpm-bar {
    height: 30px;
  }

  .dpm-bar-label {
    padding: 0 12px;
    font-size: 0.8rem;
  }

  .dpm-candidate-name,
  .dpm-percent {
    font-size: 16px;
  }

  .dpm-candidate-image {
    width: 65%;
  }

  .dpm-candidates-wrapper:before {
    width: 200px;
    height: 200px;
  }

  .dpm-vote-count {
    font-size: 28px;
    letter-spacing: 2px;
  }

  button.dpm-vote-button {
    font-size: 18px;
    padding: 8px 28px;
    width: 40%;
  }
}

/* Mobile Landscape and Small Tablets (481px - 768px) */
@media (max-width: 768px) and (min-width: 481px) {
  .dpm-poll {
    min-height: 100vh;
    height: auto;
  }

  .dpm-bars-wrapper {
    gap: 10px;
    padding: 12px;
    position: relative;
  }

  .dpm-bar {
    height: 28px;
  }

  .dpm-bar-label {
    padding: 0 10px;
    font-size: 0.75rem;
  }

  .dpm-candidate-name,
  .dpm-percent {
    font-size: 14px;
    letter-spacing: 0.5px;
  }

  .dpm-candidates-wrapper {
    flex-direction: row;
    padding-top: 20px;
    min-height: auto;
    height: auto;
    padding-bottom: 20px;
  }

  .dpm-candidates-wrapper:before {
    width: 120px;
    height: 120px;
  }

  .dpm-candidate-card {
    width: 50%;
    min-height: auto;
    padding: 15px 10px;
  }

  .dpm-candidate-image {
    width: 70%;
    max-width: 250px;
  }

  .dpm-vote-count {
    font-size: 24px;
    letter-spacing: 2px;
    margin-top: 8px;
  }

  button.dpm-vote-button {
    font-size: 16px;
    padding: 8px 24px;
    width: 50%;
    margin-top: 12px;
  }
}

/* Mobile Portrait (up to 480px) */
@media (max-width: 480px) {
  .dpm-candidate-card{
    padding: 0px;
  }
  .dpm-poll {
    min-height: 100vh;
    height: auto;
  }

  .dpm-bars-wrapper {
    /* gap: 8px;
    padding: 10px;
    position: relative; */
    flex-direction: column;
  }

  .dpm-bar {
    height: 26px;
    width: 100%;
  }

  .dpm-bar-label {
    padding: 0 8px;
    font-size: 0.7rem;
  }

  .dpm-candidate-name,
  .dpm-percent {
    font-size: 12px;
    letter-spacing: 0.5px;
  }

  /* .dpm-candidates-wrapper {
    flex-direction: column;
    align-items: center;
    padding-top: 15px;
    min-height: auto;
    height: auto;
    padding-bottom: 15px;
    gap: 20px;
  } */

  .dpm-candidates-wrapper:before {
    width: 140px;
    height: 140px;
    top: 50%;
    left: 50%;
    z-index: 9;
  }

  /* .dpm-candidate-card {
    width: 100%;
    max-width: 100%;
    min-height: auto;
    padding: 15px 20px;
    height: auto;
  } */

  /* Add extra space between candidate cards on mobile */
  .dpm-candidate-card + .dpm-candidate-card {
    /* margin-top: 24px; */
  }

  .dpm-candidate-image {
    width: 130%;
    max-width: 280px;
  }

  .dpm-candidate-image img {
    border-radius: 6px;
  }

  .dpm-vote-count {
    font-size: 18px;
    letter-spacing: 1.5px;
    margin-top: 10px;
  }

  button.dpm-vote-button {
    font-size: 14px;
    padding: 6px;
    width: 85%;
    margin-top: 12px;
    border-radius: 24px;
  }
}

/* Extra Small Mobile (up to 360px) */
/* @media (max-width: 360px) {
  .dpm-bars-wrapper {
    padding: 8px;
    gap: 6px;
  }

  .dpm-bar {
    height: 24px;
  }

  .dpm-bar-label {
    padding: 0 6px;
    font-size: 0.65rem;
  }

  .dpm-candidate-name,
  .dpm-percent {
    font-size: 11px;
  }

  .dpm-candidates-wrapper:before {
    width: 60px;
    height: 60px;
  }

  .dpm-candidate-image {
    width: 75%;
  }

  .dpm-vote-count {
    font-size: 20px;
    letter-spacing: 1px;
  }

  button.dpm-vote-button {
    font-size: 13px;
    padding: 8px 18px;
    width: 70%;
  }
} */

/* Large Desktop (above 1440px) */
@media (min-width: 1441px) {
  .dpm-bars-wrapper {
    padding: 25px;
    gap: 25px;
  }

  .dpm-bar {
    height: 36px;
  }

  .dpm-bar-label {
    padding: 0 16px;
    font-size: 0.9rem;
  }

  .dpm-candidate-name,
  .dpm-percent {
    font-size: 20px;
  }

  .dpm-candidate-image {
    width: 55%;
    max-width: 500px;
  }

  .dpm-candidates-wrapper:before {
    width: 320px;
    height: 320px;
  }

  .dpm-vote-count {
    font-size: 36px;
    letter-spacing: 4px;
  }

  button.dpm-vote-button {
    font-size: 22px;
    padding: 10px 36px;
    width: 30%;
  }
}

