@import url('https://fonts.googleapis.com/css2?family=Bayon&family=Cabin:wght@400;700&family=Oswald&display=swap');

:root {
  --purple: #340059;
  --green: #7dff9f;
  ;
}

*, *:before, *:after {
  box-sizing: border-box;
}

* {
  font-size: 16px;
}

*:focus {
  outline: none;
}

html {
  background-color: var(--purple);
}

body {
  min-height: 100vh;
  font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
  background: url('../images/bg.svg');
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;

  /* FLEXBOX */
  display: flex;
  flex-direction: column;
  align-items: center;
}

a, a:visited {
  color: var(--purple);
}

h1, h2, h3, p {
  margin: 0px;
  padding: 0px
}

h1 {
  font-size: 3rem;
  font-family: 'Bayon', sans-serif;
  color: #fff;
}


/* HEADER */

header {
  display: flex;
  align-items: center;
  padding-right: 20px;
  padding-left: 10px;
  margin-bottom: 15px;
  width: 100%;
  height: 100px;
}

header > section {
  flex-grow: 1;
}

header img {
  z-index: 150;
  width: 250px;
}

@media screen and (min-width: 600px) {
  header {
    padding-right: 50px;
    padding-left: 50px;
  }
}

/* MENU */

#menu {
  flex-direction: column;
  position: fixed;
  top: 0px;
  left: 0;
  width: 100%;
  height: 100vh;
  padding: 20px;
  background-color: #fff;
  transform: translateX(100%);
  transition: transform 0.25s linear;
  z-index: 50;
}

input#toggle{
  padding: 5px 10px;
  border-radius: 15px;
  margin-right: 15px;
}

div#menuToggle {
  display: flex;
  flex-direction: column;
  position: relative;
}

#menuToggle label span {
  display: flex;
  width: 35px;
  height: 4px;
  margin-bottom: 7px;
  position: relative;
  background-color: #fff;
  border-radius: 3px;
  z-index: 100;
  cursor: pointer;
  transform-origin: left center;
  transition: transform 0.25s,
              background-color 0.5s,
              opacity 0.55s ease;
}

#menuToggle label {
  cursor: pointer;
}

#menuToggle input:checked ~ label span {
  background-color: var(--purple);
  opacity: 1;
  transform: rotate(45deg) translate(-1px, -1px);
}

#menuToggle input:checked ~ label span:nth-of-type(2) {
  opacity: 0;
  transform: rotate(0deg) scale(0.2, 0.2);
}

#menuToggle input:checked ~ label span:nth-of-type(3) {
  transform: rotate(-45deg) translate(-2px, 0px);
}

#menu #menu-inner ul {
  padding-left: 0px;
}


#menu #menu-inner li {
  display: block;
  margin-top: 25px;
  margin-left: 0px;
}

#menu #menu-inner li a {
  font-family: 'Oswald';
  text-decoration: none;
  font-size: 2rem;
}

#menuToggle input:checked ~ #menu {
  transform: translateX(0%);
}

#menuToggle input  {
  display: none;
}

@media screen and (min-width: 1200px) {
  #menuToggle input:checked ~ #menu {
    transform: translateX(75%);
  }
}


/* FORM STYLES */

fieldset {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

fieldset textarea {
  border: 1px solid #fff !important;
  color: #fff;
  background-color: transparent;
  font-family: 'cabin';
  font-size: 2rem !important;
}

fieldset textarea::placeholder {
  color: #fff;
} 


/* MAIN CONTAINER FOR PAGES */

main {
  flex-grow: 1;
  display: flex;
  align-items: center;
  width: 100%;
}

#main-inner {
  position: relative;
  top: -20px;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 530px;
  margin-right: auto;
  margin-left: auto;
}

@media screen and (min-width: 600px) {
  #main-inner {
    min-width: 590px;
    max-width: 740px;
    border-radius: 0px 0px 40px 40px;

  }
}

section#tab {
  padding: 0rem 1rem;
  position: relative;
  height: 100%;
  flex-grow: 1;
}

section#tab-create {
  min-width: 100%;
}



@media screen and (min-width: 600px) {
  section#tab {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

p.messages {
  font-family: 'Oswald';
  font-style: normal;
  font-weight: 400;
  font-size: 15px;
  text-transform: uppercase;
  color: #ffffff;
  background: #ffffff1b;
  padding: .75rem;
  margin: 1rem auto 1rem auto;
}

p.messages.custom {
  text-transform: none;
}

p.messages-voted {
  background: #b8ff99;
  animation: fade 5500ms forwards;
  font-family: 'Oswald';
  font-style: normal;
  font-weight: 400;
  font-size: 15px;
  text-transform: uppercase;
  color: #373737;
  background: #F4F4F4;
  padding: .75rem;
  margin: 1rem auto 1rem auto;
}

@keyframes fade {
  0% {
    background: #b8ff99;
  }
  100% {
    background: #F4F4F4;
  }
}

p.login{
  text-transform: none;
}

section.login a {
  color: #fff;
}

p.messages-error {
  font-family: 'Oswald';
  font-style: normal;
  font-weight: 400;
  font-size: 15px;
  text-transform: uppercase;
  color: #960000;
  background: #ffc1c1;
  padding: .75rem;
  margin: 2rem auto 1rem auto;
}

section#tab input {
  color: #fff;
  font-family: 'Oswald', sans-serif;
  border: none;
  border-bottom: 2px solid #fff;
  font-size: 2rem;
  padding: 1rem;
  margin-bottom: 1rem;
  background-color: transparent;
}

section#tab input::placeholder {
  color: #fff;
}

section#tab textarea {
  font-family: 'Oswald', sans-serif;
  border: none;
  border: 2px solid var(--purple);
  font-size: 1.15rem;
  padding: 1rem;
  margin-bottom: 1rem;
}

section#tab input:focus {
  border-bottom: 2px solid #e100ff;
}

section#tab textarea:focus {
  border: 2px solid #e100ff;
}

section#tab button {
  width: 100%;
  border: none;
  font-family: 'Bayon';
  font-size: 1.8rem;
  padding: .45rem .15rem;
  margin-top: 2.5rem;
  background-color: var(--green);
  text-transform: uppercase;
  color: var(--purple);
  border-radius: 23px;
}

button#vote-btn-voted{
  opacity: .3;
}

button.blink-animation {
  animation: blink 1500ms infinite;
}

@keyframes blink {
  0% {
    background-color: var(--green);
  }
  100% {
    background-color: #f1f1f1;
  }
}

section#tab button:hover:disabled, section#home-list button:hover:disabled {
  pointer-events: none;
  }

button.create-poll-btn{
  width: 100%;
  border: none;
  font-family: 'Bayon';
  font-size: 1.5rem;
  padding: .5rem .25rem;
  margin-top: 1rem !important;
  background-color: var(--purple);
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 3rem;
  border-radius: 23px;
}

#menu a {
  color:rgb(134, 17, 143);
}

#menu a:visited {
  color:rgb(134, 17, 143);
}

/* HOME page styles */

article {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  min-height: 225px;
  background-color:rgb(244, 244, 244);
  border-top-left-radius: 25px;
  border-top-right-radius: 0px;
  border-bottom-left-radius: 25px;
  border-bottom-right-radius: 0px;
  padding-left: 20px;
  padding-right: 20px;
}

article.expired {
  opacity: 0.5;
}

article .poll-list-link {
  font-family: 'Cabin';
  color:rgb(134, 17, 143);
  font-size: 1.75rem;
  flex-grow: 1;
  margin-right: 10px;
}

section#polls-list a {
  text-decoration: none;
}

section#polls-list a:hover article {
  margin-top: 15px;
  margin-bottom: 15px;
  transition: all 250ms ease;
  background-color: var(--green);
  box-shadow: 0px 0px 50px #0000004c;
}

article div {
  position: relative;
  height: 100px;
  width: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  background-color: #410059;
  transition: all 250ms;
}

article div span:first-child {
  font-family: 'Oswald';
  font-size: .85rem;
  margin-bottom: 2px;
}

article div span {
  color: #7effc5;
  line-height: 100%;
  font-family: 'Oswald';
  font-size: 2.5rem;
}

#polls-list {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 45px;
}

#polls-list a article {
  transition: all 250ms ease;
}

@media screen and (min-width:780px) {
  article {
    padding-left: 50px;
  }

  article div {
    left: 50px;
    border: 5px solid #f1f1f1;
  }

  section#polls-list a:hover article div {
    transition: all 250ms ease;
    transform: scale(120%);
  }

  article .poll-list-link {
    font-size: 2.25rem;
  }
}

/* POLL page styles */

form {
  margin-top: 20px;
  margin-bottom: 20px;
}

.question {
  color: #ffffff00;
  font-family: 'Cabin', sans-serif;
  font-size: 3.5rem;
  line-height: 140%;
  font-weight: 600;
  margin: 1.5rem 0rem;
  letter-spacing: .05rem;
  margin-bottom: 50px;
}

fieldset.poll-answers div input[type="radio"] {
  display: inline-block;
  font-size: 3rem;
  margin-right: 1rem;
}

fieldset.poll-answers {
  display: flex;
  flex-direction: column;
  row-gap: 30px;
}

span.vote-count {
  font-size: 1.25rem;
  color: #fff;
  font-family: 'Bayon', sans-serif;
  padding: .15rem .7rem;
  background-color: var(--purple);
  margin-left: 1rem;
  border-radius: 50px;
}

aside#poll-link {
  padding: 20px;
  background-color: rgba(55, 55, 55, 0.07);
}

aside#username-display {
  color: #fff;
  font-family: 'Cabin';
  position: relative;
  bottom: 0px;
  text-align: center;
}

@media screen and (min-width: 600px){
  aside#username-display {
    border-radius: 0px 0px 40px 40px;
  }
}


aside#username-display div#poll-url:HOVER {
  cursor: pointer;
  background: linear-gradient(180deg, #ffffff10 0%, #ffffff00 30%);
}

aside#username-display i {
  font-size: 3rem;
  margin-left: 3px;
  cursor: grab;
  padding: 4px;
  border-radius: 5px;
  color: var(--green);
}

#username-display-inner {
  margin-top: 10px;
  width: 93%;
  margin-left: auto;
  margin-right: auto;
  border: 0px solid #6e068e;
  border-radius: 50px;
  padding: 15px;
}

div#poll-info {
  display: grid;
  grid-template-areas: "totalvotes username expiry"
                        "link link link";
}

div#poll-info a, div#poll-info a:visited {
  color: var(--green);
  font-size: 1.5rem;
  text-decoration: none;
}

div#poll-info a:hover {
  color: #fff;
}


div#poll-info div p {
  font-size: 1.5rem;
  line-height: 2rem;
  margin-top: 5px;
}

div#poll-info div:nth-of-type(1) p {
  font-size: 2rem;
}

div#poll-url span {
  margin-top: 10px;
}

div#poll-url p {
  font-size: 20px !important;
  white-space: nowrap;
}


div#poll-info div {
  width: 100%;
  display: grid;  
  box-sizing: border-box;
  grid-template-rows: 1fr 2fr;
  justify-content: center;
  height: 120px;
  border-radius: 150px;
  padding: 5px 20px;
}

div#poll-info div:nth-of-type(1){
  border-radius: 0px;
  border-right: 1px solid #ffffff81;
  grid-area: totalvotes;
}

div#poll-info div:nth-of-type(2){
  grid-area: username;
}

div#poll-info div:nth-of-type(2):hover{
  cursor: pointer;
}

div#poll-info div:nth-of-type(3){
  border-radius: 0;
  border-left: 1px solid #ffffff81;
  grid-area: expiry;
}

div#poll-url {
  border-top: 1px solid #ffffff81;
  grid-area: link;
}

div#poll-info span {
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  margin-top: 14px;
}

div#poll-info p {
  font-weight: bold;
  color: var(--green);
}


div#poll-url p {
  overflow: hidden;
}


@media screen and (min-width: 600px){
  div#poll-info { 
    flex-direction: row;
  }
}

section#user-poll-list {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: 'Bayon';
  font-size: 1.5rem;
  margin-bottom: 2rem;
  text-transform: uppercase;
  padding: 10px 3px;
}


/* Radio Input Styles */

.poll-option {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-items: center;
  padding: 10px 10px;
  border-radius: 35px;
  overflow: hidden;
  background-color: #F4F4F4;
}

.poll-option:hover {
  cursor: pointer;
}

button i {
  font-size: 1.75rem;
}

/* Hide the default radio button */
.poll-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Create the custom radio button */
.poll-option label {
  display: inline-block;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--purple);
  position: relative;
  cursor: pointer;
}

/* Style the inner circle */
.poll-option label::after {
  content: "";
  width: 0px;
  height: 0px;
  border-radius: 50%;
  background-color: var(--purple);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: all 0.2s ease;
}

/* Show the inner circle when the radio button is checked */
.poll-option input[type="radio"]:checked + label::after {
  opacity: 1;
  width: 22px;
  height: 22px;
}

span.answer-label {
  display: inline-block;
  font-family: 'Cabin', sans-serif;
  font-size: 1.5rem;
  margin-left: 10px;
}

span.answer-label-selected {
  font-weight: 700;
  font-size: 1.8rem;
  color: var(--purple);
}


.percentage-bar {
  position: absolute;
  top: 0;
  left: 0;
  background-color: var(--green);
  height: 100%;
  width: 0; /* The initial width is set to 0 */
  transition: all 500ms ease; /* Add a transition effect for smooth width changes */
  z-index: 1;
}

.poll-option-container {
  z-index: 10;
  display: flex;
  align-items: center;
}

.list {
  margin-bottom: 3rem;
}

footer {
  height: 40px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
}

footer p {
  color: rgba(255, 255, 255, 0.216);
  font-size: .75rem;
  text-align: center;
}


/* CREATE PAGE RADIO BUTTON */

/* Hide the default radio button */
.poll-timer-options input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}


/* Create the custom radio button */
.poll-timer-options label:first-of-type {
  display: inline-block;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #fff;
  position: relative;
  cursor: pointer;
}

/* Style the inner circle */
.poll-timer-options label:first-of-type::after {
  content: "";
  width: 0px;
  height: 0px;
  border-radius: 50%;
  background-color: #fff;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: all 0.2s ease;
}

/* Show the inner circle when the radio button is checked */
.poll-timer-options input[type="radio"]:checked + label:first-of-type::after {
  opacity: 1;
  width: 20px;
  height: 20px;
}

.poll-timer-options label:nth-of-type(2) {
  display: inline-block;
  font-family: 'Oswald', sans-serif;
  font-size: 1.5rem;
  margin-left: 10px;
  color: #fff;
  cursor: pointer;
}

fieldset.poll-timer-container {
  margin-top: 30px;
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: repeat( auto-fit, minmax(150px, 1fr));
  gap: 20px;
  justify-items: center;
}

.poll-timer-options{
  display: flex;
  align-items: center;
}

p#poll-timer span {
  font-size: 1.5rem;
}

p#poll-timer span.animate-blink {
  animation: blinker 1000ms infinite forwards;
}

@keyframes blinker {
  0% {
    color:rgba(125, 255, 160, 0.609);
  }
  50% {
    color: var(--green);
  }
  100% {
    color:rgba(125, 255, 160, 0.609);
  }
}