/* ───── CANDIDATES PAGE ───── */

/* ───── BASIC STYLES ───── */
body {
  background: url('/static/images/bg-static-p-1080.jpg') center/cover fixed;
  color: white;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  /* Parallax ефект для фону */
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* ───── PARALLAX SCROLL EFFECT ───── */
@keyframes parallax {
  0% { transform: translateY(0px); }
  100% { transform: translateY(-20px); }
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('/static/images/bg-static-p-1080.jpg') center/cover;
  z-index: -1;
  animation: parallax 20s ease-in-out infinite alternate;
}

header {
  display: flex;
  justify-content: center;
  padding: 80px;
}

header img {
  max-width: 1080px;
  width: 100%;
  height: auto;
  display: block;
}

.centered-logo {
  max-width: 400px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

.container {
  max-width: 1200px;
  margin: auto;
  padding: 10px;
}

/* ───── CANDIDATES HEADER ───── */
.candidates-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 0.5em;
  justify-content: space-between;
  animation: fadeInUp 0.8s ease-out 0.3s both;
}

.btn-back {
  background: #202020;
  border: 1px solid #444;
  color: white;
  padding: 0.5em 1.2em;
  margin: 0.3em;
  border-radius: 6px;
  font-size: 1em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  box-sizing: border-box;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.8s ease-out 0.3s both;
}

.btn-back::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(58, 255, 142, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn-back:hover {
  background-color: #14532d;
  border-color: #3aff8e;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 15px rgba(20, 83, 45, 0.4);
}

.btn-back:hover::before {
  left: 100%;
}

.btn-back:active {
  transform: translateY(-1px) scale(1.02);
  transition: all 0.1s ease;
}

/* ───── PAGE TITLE ───── */
.page-title {
  text-align: center;
  font-size: 1.4em;
  margin: 0;
  color: white;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  flex: 1;
  line-height: 1.3;
  animation: fadeInUp 0.8s ease-out 0.4s both;
}

/* ───── CANDIDATES GRID ───── */
.candidates-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  margin-bottom: 0.5em !important;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  background: rgba(16, 16, 16, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: fadeInUp 1s ease-out 0.5s both;
}

/* ───── FADE-IN ANIMATION FOR CARDS ───── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.candidate-card {
  background: rgba(32, 32, 32, 0.95);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: 20px;
  padding: 25px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: pointer;
  border: 3px solid rgba(68, 68, 68, 0.5);
  position: relative;
  overflow: hidden;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  /* Fade-in анімація */
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
}

/* Затримка для кожної картки */
.candidate-card:nth-child(1) { animation-delay: 0.1s; }
.candidate-card:nth-child(2) { animation-delay: 0.2s; }
.candidate-card:nth-child(3) { animation-delay: 0.3s; }
.candidate-card:nth-child(4) { animation-delay: 0.4s; }
.candidate-card:nth-child(5) { animation-delay: 0.5s; }
.candidate-card:nth-child(6) { animation-delay: 0.6s; }
.candidate-card:nth-child(7) { animation-delay: 0.7s; }
.candidate-card:nth-child(8) { animation-delay: 0.8s; }
.candidate-card:nth-child(9) { animation-delay: 0.9s; }
.candidate-card:nth-child(10) { animation-delay: 1.0s; }
.candidate-card:nth-child(11) { animation-delay: 1.1s; }
.candidate-card:nth-child(12) { animation-delay: 1.2s; }
.candidate-card:nth-child(13) { animation-delay: 1.3s; }
.candidate-card:nth-child(14) { animation-delay: 1.4s; }
.candidate-card:nth-child(15) { animation-delay: 1.5s; }
.candidate-card:nth-child(16) { animation-delay: 1.6s; }
.candidate-card:nth-child(17) { animation-delay: 1.7s; }
.candidate-card:nth-child(18) { animation-delay: 1.8s; }
.candidate-card:nth-child(19) { animation-delay: 1.9s; }
.candidate-card:nth-child(20) { animation-delay: 2.0s; }
.candidate-card:nth-child(21) { animation-delay: 2.1s; }

.candidate-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #666, #888);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

/* ───── ENHANCED HOVER EFFECTS ───── */
.candidate-card:hover {
  transform: translateY(-15px) scale(1.02);
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.9);
  border-color: #888;
  background: rgba(72, 72, 72, 0.98);
}

.candidate-card:hover::before {
  transform: scaleX(1);
}

.candidate-card:active {
  transform: translateY(-10px) scale(1.01);
  transition: all 0.1s ease;
}

/* ───── CANDIDATE PHOTO ───── */
.candidate-photo {
  text-align: center;
  margin-bottom: 15px;
}

.candidate-photo img {
  width: 100%;
  height: 280px;
  border-radius: 20px;
  object-fit: cover;
  border: 3px solid #444;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  image-rendering: auto;
  -webkit-image-smoothing: auto;
  -moz-image-smoothing: auto;
  -ms-image-smoothing: auto;
}

.candidate-card:hover .candidate-photo img {
  border-color: #aaa;
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

/* ───── CANDIDATE INFO ───── */
.candidate-info {
  text-align: center;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
}

.candidate-name {
  font-size: 1.2em;
  font-weight: 600;
  margin-bottom: 8px;
  color: white;
  line-height: 1.3;
  transition: color 0.3s ease;
}

.candidate-card:hover .candidate-name {
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.candidate-info p {
  margin: 4px 0;
  color: #ccc;
  font-size: 0.9em;
  line-height: 1.3;
  transition: color 0.3s ease;
}

.candidate-card:hover .candidate-info p {
  color: #ddd;
}

.candidate-info p strong {
  color: #fff;
  font-weight: 600;
  transition: color 0.3s ease;
}

.candidate-card:hover .candidate-info p strong {
  color: #fff;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
}

/* ───── DETAILS BUTTON ───── */
.btn-details {
  margin-top: auto;
  width: 100%;
  height: 40px;
  background: #202020;
  border: 1px solid #444;
  color: white;
  border-radius: 8px;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

.btn-details::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.candidate-card:hover .btn-details {
  background: #2a2a2a;
  border-color: #666;
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.candidate-card:hover .btn-details::before {
  left: 100%;
}

.btn-details:hover {
  background: #333;
  border-color: #777;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* ───── ENHANCED MODAL ANIMATIONS ───── */
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(-50px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes modalContentSlide {
  from {
    opacity: 0;
    transform: scale(0.7) translateY(30px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  padding: 20px;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
  animation: modalFadeIn 0.22s ease-out;
}

.modal-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  transform: scale(0.8) translateY(20px);
  transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  animation: modalContentSlide 0.25s ease-out 0.08s both;
}

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

/* ───── MODAL HEADER ───── */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 25px 30px;
  border-bottom: 1px solid #eee;
  background: #f8f9fa;
  border-radius: 12px 12px 0 0;
}

.modal-header h2 {
  font-size: 1.5em;
  font-weight: 600;
  color: #333;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 2em;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.modal-close:hover {
  background: #f0f0f0;
  color: #333;
  transform: rotate(90deg) scale(1.1);
}

/* ───── MODAL BODY ───── */
.modal-body {
  padding: 30px;
}

/* ───── CANDIDATE DETAILS ───── */
.candidate-details {
  color: #333;
}

.candidate-header {
  display: flex;
  gap: 25px;
  margin-bottom: 30px;
  padding-bottom: 25px;
  border-bottom: 2px solid #eee;
}

.candidate-photo-large {
  flex-shrink: 0;
  text-align: center;
}

.candidate-photo-large img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #ddd;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.candidate-photo-large img:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
}

.candidate-basic-info {
  flex: 1;
}

.candidate-basic-info h3 {
  font-size: 2.2em;
  font-weight: 600;
  margin-bottom: 20px;
  color: #333;
}

.candidate-basic-info p {
  margin: 10px 0;
  font-size: 1.1em;
  line-height: 1.6;
  color: #555;
}

.candidate-basic-info strong {
  color: #333;
  font-weight: 600;
}

/* ───── CANDIDATE SECTIONS ───── */
.candidate-sections {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.section {
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #ddd;
  transition: all 0.3s ease;
}

.section:hover {
  border-left-color: #007bff;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.1);
}

.section h4 {
  font-size: 1.4em;
  font-weight: 600;
  margin-bottom: 15px;
  color: #333;
}

.section p {
  font-size: 1.1em;
  line-height: 1.7;
  color: #555;
  margin: 0;
}

/* Безпечне відображення переносів рядків */
#modalPublicOrgs,
#modalPoliticalParties,
#modalMotivation {
  white-space: pre-line;
}

/* ───── LOADING INDICATOR ───── */
.loading-indicator {
  text-align: center;
  padding: 3em;
  color: #aaa;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #444;
  border-top: 3px solid #666;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1em;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ───── MOBILE ADAPTATION ───── */
@media (max-width: 600px) {
  header {
    padding: 40px 0 20px 0;
  }
  
  header img {
    max-width: 90vw;
  }
  
  .candidates-header {
    flex-direction: column;
    gap: 15px;
    margin-bottom: 1em;
  }
  
  .btn-back {
    align-self: flex-start;
  }
  
  .page-title {
    font-size: 1.2em;
    margin: 0;
    text-align: center;
  }

  .candidates-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .candidate-card {
    padding: 25px;
    min-height: 350px;
  }

  .candidate-photo img {
    width: 150px;
    height: 150px;
  }

  .candidate-name {
    font-size: 1.3em;
    margin-bottom: 12px;
  }

  .candidate-info p {
    font-size: 1em;
    line-height: 1.4;
  }

  .btn-details {
    height: 50px;
    font-size: 1em;
  }

  /* Модальне вікно на мобільній */
  .modal-content {
    width: 95%;
    max-height: 95vh;
    transform: scale(0.9) translateY(10px);
  }
  
  .modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
  }

  .modal-header {
    padding: 20px;
  }

  .modal-header h2 {
    font-size: 1.3em;
  }

  .modal-body {
    padding: 20px;
  }

  .candidate-header {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }

  .candidate-photo-large img {
    width: 120px;
    height: 120px;
  }

  .candidate-basic-info h3 {
    font-size: 1.4em;
  }

  .section {
    padding: 15px;
  }

  .section h4 {
    font-size: 1.1em;
  }
}

/* ───── TABLET ADAPTATION ───── */
@media (min-width: 601px) and (max-width: 900px) {
  .candidates-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }

  .candidate-photo img {
    width: 70px;
    height: 70px;
  }

  .modal-content {
    width: 85%;
  }
}

/* ───── LARGE SCREEN OPTIMIZATION ───── */
@media (min-width: 1200px) {
  .candidates-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 1400px;
  }

  .modal-content {
    max-width: 900px;
  }
} 

@keyframes fadeOutDown {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(60px);
  }
}

.candidates-header.fade-out-down,
.candidates-grid.fade-out-down {
  animation: fadeOutDown 0.6s cubic-bezier(0.4,0,0.2,1) forwards;
} 