/*──────────────────────────────────────────────────────
  Variables & Global Reset
──────────────────────────────────────────────────────*/
:root {
  --bg-page: #f0f0f0;
  --color-primary: #f57c00;
  --color-primary-dark: #e65100;
  --color-secondary: #004f9e;
  --color-accent: #c29a00;
  --color-text-light: #fff;
  --color-text-dark: #333;
  --radius: 6px;
  --transition: 0.3s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', sans-serif;
}

html, body {
  height: 100%;
  background: var(--bg-page);
}

/*──────────────────────────────────────────────────────
  Header & Footer
──────────────────────────────────────────────────────*/
.header, .footer {
  background: #010101;
  color: var(--color-text-light);
  text-align: center;
  padding: 15px 20px;
}

.footer {
  font-size: 14px;
  opacity: 0.9;
  padding: 20px 0;
}

/*──────────────────────────────────────────────────────
  Poll Title
──────────────────────────────────────────────────────*/
.poll-title {
  text-align: center;
  font-size: 2rem;
  font-weight: bold;
  margin: 20px 0;
  color: var(--color-text-light);
  animation: fadeIn 0.6s both;
}

/*──────────────────────────────────────────────────────
  Fullscreen Vote Container
──────────────────────────────────────────────────────*/
.fullscreen-vote {
  display: flex;
  flex-wrap: wrap;
  min-height: 65vh;
  animation: fadeInUp 0.6s both;
}

.candidate {
  flex: 1 1 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  position: relative;
  color: var(--color-text-light);
  overflow: hidden;
  transition: transform var(--transition);
}
.candidate:hover {
  transform: translateY(-8px);
}

.candidate-left { background: var(--color-accent); }
.candidate-right { background: var(--color-secondary); }

.candidate img {
  width: 180px; height: 180px;
  border-radius: 50%;
  border: 5px solid var(--color-text-light);
  object-fit: cover;
  margin-bottom: 20px;
  box-shadow: 0 0 15px rgba(0,0,0,0.3);
  animation: popIn 0.5s both;
}

.candidate h2 {
  font-size: 1.5rem;
  margin-bottom: 5px;
}

.candidate p {
  font-size: 1.125rem;
  margin-bottom: 20px;
}

/*──────────────────────────────────────────────────────
  Custom Checkbox & Radio
──────────────────────────────────────────────────────*/
.checkbox-wrapper,
.custom-radio {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"],
.custom-radio input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkbox-wrapper .box,
.custom-radio .radio-mark {
  display: inline-block;
  position: relative;
  width: 28px; height: 28px;
  border: 3px solid var(--color-text-light);
  border-radius: 4px;
  transition: background var(--transition), border-color var(--transition);
}

.checkbox-wrapper input:checked + .box {
  background: var(--color-text-light);
}

.custom-radio .radio-mark {
  border-radius: 50%;
  margin-right: 8px;
}
.custom-radio input:checked + .radio-mark {
  border-color: var(--color-primary);
}
.custom-radio input:checked + .radio-mark::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 12px; height: 12px;
  background: var(--color-primary);
  border-radius: 50%;
  transform: translate(-50%,-50%) scale(0);
  animation: radioPop 0.2s forwards;
}

/*──────────────────────────────────────────────────────
  Progress Bar / Percentages
──────────────────────────────────────────────────────*/
/* Progress Bar Styles */
.bar-labels {
  display: flex;
  justify-content: space-between;
  max-width: 800px;
  margin: 1em auto;
}
.bar-container {
  max-width: 800px;
  margin: 0.5em auto 2em;
  height: 20px;
  display: flex;
  border-radius: 10px;
  overflow: hidden;
  background-color: #e0e0e0;
}
.bar-left,
.bar-right {
  height: 100%;
  flex-shrink: 0;
}
.bar-left {
  background-color: var(--clr1);
}
.bar-right {
  background-color: var(--clr2);
}

/*──────────────────────────────────────────────────────
  Vote Form (Email + Button)
──────────────────────────────────────────────────────*/
.vote-form {
  text-align: center;
  padding: 30px 0;
  background: var(--color-text-light);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
  border-top: 1px solid #ccc;
}

.vote-form input[type="email"] {
  padding: 10px;
  font-size: 1rem;
  width: 100%; max-width: 280px;
  border: 1px solid #ccc;
  border-radius: var(--radius);
}

.vote-form button {
  position: relative;
  overflow: hidden;
  margin-left: 10px;
  padding: 10px 20px;
  font-size: 1rem;
  border: none;
  border-radius: var(--radius);
  background: var(--color-primary);
  color: var(--color-text-light);
  cursor: pointer;
  transition: background var(--transition);
}
.vote-form button:hover { background: var(--color-primary-dark); }
.vote-form button::after {
  content: "";
  position: absolute;
  width: 100%; height: 100%;
  top: 0; left: -100%;
  background: rgba(255,255,255,0.2);
  transform: skewX(-25deg);
  transition: left 0.5s var(--transition);
}
.vote-form button:hover::after { left: 200%; }

/*──────────────────────────────────────────────────────
  Map & Info Text
──────────────────────────────────────────────────────*/
.map-container {
  margin: 30px auto;
  text-align: center;
}
.map-container svg,
#map {
  width: 100%;
  max-width: 500px;
  height: auto;
  display: block;
  margin: 0 auto 20px;
}

/* Remove unwanted spacing after map */
#map + p {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.info-text {
  text-align: center;
  font-weight: bold;
  color: orange;
  margin-bottom: 30px;
}

/*──────────────────────────────────────────────────────
  Table & Pagination
──────────────────────────────────────────────────────*/
.table-container {
  width: 90%;
  margin: 0 auto 30px;
}

.table-container h3 {
  text-align: center;
  margin-bottom: 10px;
  color: var(--color-text-dark);
}

.region-votes {
  width: 100%;
  border-collapse: collapse;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.region-votes th,
.region-votes td {
  border: 1px solid #ddd;
  padding: 10px 8px;
  text-align: center;
}

.region-votes th {
  background: #f7f7f7;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.region-votes tr:nth-child(even) { background: #fafafa; }
.region-votes tr:hover      { background: #f1f1f1; }

#pagination {
  text-align: center;
  margin-top: 15px;
}
.page-btn {
  margin: 0 4px;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 3px;
  background: #f7f7f7;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background var(--transition);
}
.page-btn:hover { background: #e2e2e2; }
.page-btn.active {
  background: #007bff;
  color: #fff;
  border-color: #007bff;
}

/*──────────────────────────────────────────────────────
  Responsive Adjustments
──────────────────────────────────────────────────────*/
@media (max-width: 768px) {
  .candidate { flex: 1 1 100%; padding: 20px; }
  .candidate img { width: 140px; height: 140px; }
  .fullscreen-vote { min-height: auto; }
  .vote-form input[type="email"] { width: 100%; max-width: none; }
}

/*──────────────────────────────────────────────────────
  Animations
──────────────────────────────────────────────────────*/
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; }}
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px);} to { opacity: 1; transform: translateY(0);} }
@keyframes popIn { 0% { transform: scale(0.5); opacity: 0;} 100% { transform: scale(1); opacity: 1;} }
@keyframes radioPop { 0% { transform: translate(-50%,-50%) scale(0);} 60% { transform: translate(-50%,-50%) scale(1.2);} 100% { transform: translate(-50%,-50%) scale(1);} }


/*──────────────────────────────────────────────────────
   Candidate Text: Bigger + Subtle Shadow Effect
──────────────────────────────────────────────────────*/
.candidate h2 {
  font-size: 1.75rem;                        /* up from 1.5rem */
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
}

.candidate p {
  font-size: 1.25rem;                        /* up from 1.125rem */
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

/*──────────────────────────────────────────────────────
   Info-Text: More Readable + Larger
──────────────────────────────────────────────────────*/
.info-text {
  font-size: 1.25rem;                        /* up from default */
  color: black;          /* stronger contrast vs. orange */
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  line-height: 1.4;
  padding: 0 10px;                           /* give it breathing room */
}

.bar-container { background: transparent; }
.bar-left,
.bar-right {
  height: 100%;
  transition: width var(--transition), background-color var(--transition);
}
.footer a {
  color: #fff;
  text-decoration: underline;
  margin: 0 0.5em;
}
.footer a:hover {
  opacity: 0.8;
}

.modal {
  display: none;               /* ascuns inițial */
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* conținutul popup-ului */
.modal-content {
  background: #fff;
  padding: 1.5em;
  border-radius: 8px;
  max-width: 300px;
  width: 90%;
  text-align: center;
  position: relative;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* buton închidere */
.modal-close {
  position: absolute;
  top: 8px; right: 12px;
  font-size: 1.4em;
  cursor: pointer;
}

/* butonul de votează */
.btn-vote {
  display: inline-block;
  margin-top: 1em;
  padding: .5em 1em;
  background: #f1d600;
  color: #000;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
}
.btn-vote:hover {
  opacity: .9;
}