@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

@font-face {
  font-family: 'URW DIN';
  src: url('assets/fonts/URWDIN-Black.woff2') format('woff2'),
       url('assets/fonts/URWDIN-Black.woff') format('woff');
  font-weight: 900;
  font-style: normal;
}

@font-face {
  font-family: 'URW DIN';
  src: url('assets/fonts/URWDIN-Bold.woff2') format('woff2'),
       url('assets/fonts/URWDIN-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'URW DIN';
  src: url('assets/fonts/URWDIN-Medium.woff2') format('woff2'),
       url('assets/fonts/URWDIN-Medium.woff') format('woff');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'URW DIN';
  src: url('assets/fonts/URWDIN-Regular.woff2') format('woff2'),
       url('assets/fonts/URWDIN-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
}


:root {
  --card-bg: rgba(23, 23, 23, 0.98); /* dark semi-transparent background */
  --card-radius: 12px;
  --card-pad: 16px;
  --card-shadow: 0 4px 10px rgba(0,0,0,0.4);

  --text: #fff;
  --muted: rgba(255,255,255,0.6);

  --color-blue: #3b82f6;
  --color-red: #ef4444;
  --color-green: #22c55e;
  --color-yellow: #eab308;
  --color-orange: #f97316;
  --color-purple: #a855f7;
  --color-teal: #14b8a6;
  --color-pink: #ec4899;
  --color-lime: #84cc16;
  --color-gray: #9ca3af;
}

html {
  height: 100%;
  margin: 0;
  background: transparent;
  font-family: Roboto, system-ui, sans-serif;
  color: var(--text);
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden; /* prevent horizontal scroll */
  overflow-y: auto;   /* allow vertical scroll */
  background-color: #181818;
  font-family: Inter, Roboto, system-ui, sans-serif;
}

/* Modern dark scrollbar */
body::-webkit-scrollbar {
  width: 10px; /* thickness of the scrollbar */
}

body::-webkit-scrollbar-track {
  background: #1c1c1c; /* dark track */
  border-radius: 5px;
}

body::-webkit-scrollbar-thumb {
  background-color: #555; /* dark grey handle */
  border-radius: 5px;
  border: 2px solid #1c1c1c; /* spacing around handle */
}

body::-webkit-scrollbar-thumb:hover {
  background-color: #777; /* lighter on hover */
}

.widget-title {
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'URW DIN', sans-serif;
  font-weight: 900; /* matches the font-face weight */
  font-size: 1.6em;
  gap: 10px;
  background-color: #141414;
  color: #fff;
  padding: 10px 0;
  margin: 0;
  width: 100%;   /* spans full page width */
  box-shadow: 0 4px 8px rgba(0,0,0,0.4); /* subtle shadow separation */
}


.poll-wrapper {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 28px;
  width: 95%;
  
  display: flex;
  justify-content: center;
  /* Fade transition */
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.poll-wrapper.hidden {
  opacity: 0;
  visibility: hidden;
}

.poll-card {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  padding: var(--card-pad);
  width: 100%;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative; /* so overlay can be positioned */
  overflow: hidden;
}

.poll-timer-overlay {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.08); /* subtle white overlay */
  width: 100%; /* will shrink with time */
  pointer-events: none; /* clicks go through */
  transition: width 1s linear; /* smooth shrink */
}



.title {
  text-align: center;
  font-size: 1.3rem;
  font-weight: bold;
  user-select: none;
}

.choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.choice {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 44px;
  transition: opacity 0.3s ease, filter 0.3s ease, transform 0.3s ease;
}

.choice.winner {
  filter: brightness(1.4); /* brighten winner */
  transform: scale(1.01); /* optional subtle pop */
}

.choice.loser {
  opacity: 0.3; /* dim losers */
}

.vote-key {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.95rem;
  background: rgba(255,255,255,0.03);
  padding: 6px 8px;
  border-radius: 10px;
  min-width: 36px;
  user-select: none;
  transition: background-color 0.2s ease;
}

/* Flash animations */
.vote-key.flash-blue   { background-color: color-mix(in srgb, var(--color-blue) 60%, white); }
.vote-key.flash-red    { background-color: color-mix(in srgb, var(--color-red) 60%, white); }
.vote-key.flash-green  { background-color: color-mix(in srgb, var(--color-green) 60%, white); }
.vote-key.flash-yellow { background-color: color-mix(in srgb, var(--color-yellow) 70%, white); }
.vote-key.flash-orange { background-color: color-mix(in srgb, var(--color-orange) 70%, white); }
.vote-key.flash-purple { background-color: color-mix(in srgb, var(--color-purple) 70%, white); }
.vote-key.flash-teal   { background-color: color-mix(in srgb, var(--color-teal) 70%, white); }
.vote-key.flash-pink   { background-color: color-mix(in srgb, var(--color-pink) 70%, white); }
.vote-key.flash-lime   { background-color: color-mix(in srgb, var(--color-lime) 70%, white); }
.vote-key.flash-gray   { background-color: color-mix(in srgb, var(--color-gray) 70%, white); }

.vote-key.flash-blue,
.vote-key.flash-red,
.vote-key.flash-green,
.vote-key.flash-yellow,
.vote-key.flash-orange,
.vote-key.flash-purple,
.vote-key.flash-teal,
.vote-key.flash-pink,
.vote-key.flash-lime,
.vote-key.flash-gray {
  transform: translate(1px, 1px) scale(0.96);
}


.choice-main {
  display: flex;
  flex-direction: column;
}

.choice-text {
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.choice-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gauge {
  margin-top: 6px;
  height: 7px;
  background: rgba(255,255,255,0.04);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.gauge-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  transition: width 0.5s ease;
}

/* Gauge fills */
.gauge-fill.blue   { background-color: var(--color-blue); }
.gauge-fill.red    { background-color: var(--color-red); }
.gauge-fill.green  { background-color: var(--color-green); }
.gauge-fill.yellow { background-color: var(--color-yellow); }
.gauge-fill.orange { background-color: var(--color-orange); }
.gauge-fill.purple { background-color: var(--color-purple); }
.gauge-fill.teal   { background-color: var(--color-teal); }
.gauge-fill.pink   { background-color: var(--color-pink); }
.gauge-fill.lime   { background-color: var(--color-lime); }
.gauge-fill.gray   { background-color: var(--color-gray); }

.choice-right {
  display: flex;
  gap: 5px;
  font-size: 0.98rem;
  font-weight: 500;
}

.percent {
  font-weight: 600;
}

.votes {
  color: var(--muted);
}

.notifications {
  font-family: 'URW DIN', sans-serif;
  position: fixed;
  bottom: 40px;       /* distance from bottom of screen */
  left: 50%;           /* center horizontally */
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;          /* space between multiple toasts */
}

.toast {
  position: relative;
  padding: 10px;
  color: #fff;
  margin-bottom: 10px;
  max-width: 500px;
  display: grid;
  grid-template-columns: 70px 1fr 70px;
  border-radius: 5px;
  --color: #0abf30;
  background: #202022;
  animation: show 0.3s ease 1 forwards;
}


.toast i{
  color: var(--color);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: x-large;
}

.toast .content {
  text-align: left;       
  display: flex;          
  flex-direction: column; 
  justify-content: center; 
  align-items: flex-start; 
}

.toast .title{
  font-size: x-large;
  font-weight: bold;
}

.toast span, .toast i:nth-child(3){
  color: #fff;
  opacity: 0.6;
}

@keyframes show {
  0% {
    transform: translateY(100%);
  }
  40% {
    transform: translateY(-5%);
  }
  80% {
    transform: translateY(0%);
  }
  100% {
    transform: translateY(-10%);
  }
}


.toast::before{
  position: absolute;
  bottom: 0;
  left: 0;
  background-color: var(--color);
  width: 100%;
  height: 3px;
  content: '';
  box-shadow: 0 0 10px var(--color);
  animation: timeOut 3s linear 1 forwards
}

@keyframes timeOut{
  100%{
      width: 0;
  }
}

.toast.error{
  --color: #f24d4c;
  background: #202022;
}

.toast.warning{
  --color: #e9bd0c;
  background: #202022;
}

.toast.info{
  --color: #3498db;
  background: #202022;
}

.toast-logo {
width: 28px;   /* adjust */
height: 28px;
object-fit: contain;
display: block;
margin: auto;
}

/* Settings Page */
.rexbordz-logo {
  width: 32px;
  height: 32px;
  padding-top: 3px;
}
.settings-container {
  width: 100%;
  max-width: 100%; /* wider maximum width */
  margin: auto;
  padding: 20px;
  background-color: #181818;
  display: flex;
  flex-direction: column;
  gap: 15px;
  box-sizing: border-box; /* include padding in width */
}


.settings-container h1 {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 10px;
  font-weight: 600;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-weight: 500;
  font-size: 0.95rem;
}

.input-group input,
.input-group select {
  width: 100%;  /* full width */
  box-sizing: border-box; /* padding included in width */
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  background-color: #222;
  color: #fff;
  font-size: 0.95rem;
}

.input-group input:focus,
.input-group select:focus {
  outline: 2px solid #3b82f6; /* bright blue */
  outline-offset: 2px;         /* space between outline and element */
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.5); /* optional subtle glow */
}


.input-group input::placeholder {
  color: #696969;
}

/* Choice inputs stacked vertically */
.choice-input {
  margin-bottom: 6px;
}

/* Button Group */
.button-group {
  display: flex;
  flex-wrap: wrap; /* wraps on smaller screens */
  gap: 10px;
  margin-top: 10px;
}

.button-group button {
  flex: 1 1 45%; /* grow/shrink with container, min 45% */
  padding: 10px 0;
  border: none;
  border-radius: 8px;
  background-color: #555;
  color: #fff;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

button {
  background: #007bff;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

button:active::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.3); /* flash overlay */
  animation: flash 0.2s ease;
}

@keyframes flash {
  from { opacity: 1; }
  to { opacity: 0; }
}

#start-end-poll {
  flex: 1 1 100%; /* full width of first row */
}

/* Let the other two buttons share the next row */
#toggle-poll,
#reset-poll {
  flex: 1 1 48%; /* each takes about half the row */
}

#start-end-poll {
  background-color: #284cb8; /* blue */
  color: #fff;
  font-weight: bold;
}

.button-group button:hover {
  background-color: #777;
}

/* Small screen adjustments */
@media (max-width: 450px) {
  .button-group {
    flex-direction: column;
  }
  .button-group button {
    flex: 1 1 100%;
  }
}

.pro-badge {
  background-color: #284cb8; /* consistent with your brand blue */
  color: #ffffff;
  font-size: 0.5em;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  margin-left: 6px;
  display: inline-block;
  vertical-align: middle;
  letter-spacing: 0.5px;
}


.add-choice {
  background-color: #3b82f6;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 0;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.add-choice:hover {
  background-color: #2563eb;
}

