/* 
ERCIHS SSLG Online Election System

Developed by Nikko Angelo Quilo, CpE, LPT | SST I
nikko.quilo@ercihs.edu.ph | https://ph.linkedin.com/in/nikkoquilo

EMMANUEL RESURRECCION CONGRESSIONAL INTEGRATED HIGH SCHOOL
Poinsettia St., Via Verde Village, Brgy. San Agustin II
City of Dasmariñas, Cavite
301179@deped.gov.ph
(046) 472-9768

© 2026 ERCIHS
All rights reserved.
*/

:root { --maroon: #600000; --light-maroon: #8b0000; --gold: #f39c12; --bg: #f8f9fa; --text: #333333; }
    body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: var(--bg); color: var(--text); margin: 0; padding: 10px; display: flex; justify-content: center; align-items: center; min-height: 100vh; overflow-y: auto !important; -webkit-overflow-scrolling: touch; user-select: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; }
    .container { background: white; max-width: 550px; width: 100%; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); overflow: visible; border-top: 6px solid var(--maroon); position: relative; margin: auto; }
    @media (max-width: 480px) { body { padding: 0; align-items: flex-start; } .container { border-radius: 0; box-shadow: none; border-top: 5px solid var(--maroon); min-height: 100vh; } .content { padding: 15px !important; } }
    .header { background: var(--maroon); color: white; text-align: center; padding: 10px 15px 15px 15px; display: flex; flex-direction: column; align-items: center; overflow: hidden; width: 100%; box-sizing: border-box; }
    .logo { width: 75px; height: 75px; border-radius: 50%; border: 2px solid white; background: white; object-fit: cover; margin-bottom: 8px; box-shadow: 0 3px 8px rgba(0,0,0,0.2); }
    .header .school-name { margin: 0 0 4px 0; font-size: clamp(7px, 2vw, 12px); width: 100%; color: #ffffff; letter-spacing: 0.5px; text-transform: uppercase; font-weight: 800; line-height: 1.2; text-align: center; }
    .header .comelec-title { margin: 0 0 10px 0; font-size: clamp(7px, 1.8vw, 10px); color: #e0e0e0; font-weight: 500; line-height: 1.2; letter-spacing: 0.2px; text-align: center; }
    .header .main-title { margin: 0 0 5px 0; font-size: clamp(15px, 4vw, 20px); letter-spacing: 0.5px; text-transform: uppercase; font-weight: 900; line-height: 1.2; color: #ffd700; text-align: center; }
    .header .school-year { font-size: clamp(12px, 3vw, 14px); font-weight: 700; color: #ffffff; margin-bottom: 10px; letter-spacing: 1px; line-height: 1; }
    .content { padding: 20px 25px; } 
    label { font-weight: 600; display: block; margin-bottom: 4px; color: var(--maroon); margin-top: 10px; font-size: 13px; }
    input[type="text"] { width: 100%; padding: 10px 12px; border: 2px solid #ddd; border-radius: 6px; font-size: 14px; box-sizing: border-box; text-align: center; font-weight: bold; transition: border-color 0.3s; background: #fff; appearance: none; margin: 0 0 10px 0; display: block; text-transform: uppercase; letter-spacing: 1px; }
    input[type="text"]:focus { border-color: var(--maroon); outline: none; box-shadow: 0 0 5px rgba(96,0,0,0.2); }
    input::placeholder { color: #999999; font-weight: 600; letter-spacing: 0.5px; font-size: 12px; }
    .btn { background: var(--maroon); color: white; border: none; width: 100%; padding: 12px; font-size: 14px; font-weight: bold; border-radius: 6px; cursor: pointer; margin-top: 12px; transition: background 0.3s, transform 0.1s; letter-spacing: 0.5px; }
    .btn:hover { background: var(--light-maroon); }
    .btn:active { transform: scale(0.99); }
    .btn:disabled { background: #ccc; cursor: not-allowed; }
    #ballot-section, #success-section { display: none; }
    .voter-info-box { background: #f4f8fa; border-left: 4px solid #17a2b8; padding: 12px; margin-bottom: 15px; font-size: 13px; border-radius: 0 6px 6px 0; line-height: 1.4; }
    .position-group { background: #fffafa; border: 1px solid #f0e6e6; padding: 15px; border-radius: 8px; margin-bottom: 15px; }
    .position-title { font-size: 15px; font-weight: bold; color: var(--maroon); border-bottom: 2px solid var(--maroon); padding-bottom: 6px; margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; }
    .position-subtitle { font-size: 12px; color: #555; margin-bottom: 12px; }
   
    /* CONTAINER FOR 2-COLUMN GRID */
#dynamic-candidates-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 10px;
}

/* UPDATED CANDIDATE CARD */
.candidate-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px 10px;
  margin: 0; /* Removed old margin since grid uses gap */
  background: white;
  border: 2px solid #dcdcdc; /* Made border slightly thicker for card feel */
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  box-sizing: border-box;
}

.candidate-option:hover {
  border-color: var(--maroon);
  background: #fff5f5;
  transform: translateY(-3px); /* Move upward instead of sideways */
  box-shadow: 0 4px 8px rgba(96,0,0,0.1);
}

/* CANDIDATE IMAGE (SQUARE & EQUAL SIZES) */
.candidate-img {
  width: 90px;
  height: 90px;
  object-fit: cover; /* Forces the image to crop perfectly into a square */
  border-radius: 8px;
  margin-bottom: 12px;
  border: 1px solid #eee;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  background-color: #f8f9fa; /* Slight background while loading */
}

/* WRAPPER FOR CHECKBOX AND NAME */
.candidate-details {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 8px;
}

.candidate-option input {
  margin: 0;
  transform: scale(1.3);
  accent-color: var(--maroon);
  flex-shrink: 0;
}

.candidate-name {
  line-height: 1.3;
  word-break: break-word; /* Prevents long names from breaking the layout */
}



    #error-msg { color: #d9534f; background: #fdf7f7; border: 1px solid #f8d7da; padding: 10px; border-radius: 6px; font-size: 13px; margin-top: 12px; display: none; text-align: center; font-weight: 600; }
    .success-box { text-align: center; padding: 20px 10px; }
    .success-box h2 { color: #28a745; margin-bottom: 10px; font-size: 20px; }
    .modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.6); display: none; justify-content: center; align-items: center; z-index: 9999; padding: 15px; box-sizing: border-box; }
    .modal-box { background: white; max-width: 350px; width: 100%; border-radius: 10px; padding: 20px; text-align: center; box-shadow: 0 10px 25px rgba(0,0,0,0.3); border-top: 6px solid var(--maroon); }
    .modal-title { font-size: 16px; font-weight: bold; color: var(--maroon); margin-bottom: 10px; }
    .modal-message { font-size: 13px; color: #444; line-height: 1.4; margin-bottom: 15px; white-space: pre-line; }
    .modal-actions { display: flex; gap: 8px; justify-content: center; }
    .modal-btn { padding: 10px 15px; border-radius: 6px; font-weight: bold; font-size: 13px; cursor: pointer; border: none; flex: 1; }
    .btn-primary { background: var(--maroon); color: white; }
    .btn-secondary { background: #e0e0e0; color: #333; }
    .countdown-box { background: rgba(0, 0, 0, 0.25); border: 1px dashed #ffd700; border-radius: 6px; padding: 8px 12px; margin-top: 5px; display: inline-block; width: 90%; max-width: 350px; box-sizing: border-box; }
    .countdown-label { font-size: clamp(8px, 2vw, 10px); color: #ffd700; font-weight: 700; margin-bottom: 2px; }
    .countdown-timer { font-size: clamp(12px, 3.5vw, 16px); color: #ffffff; font-weight: 800; font-family: monospace; letter-spacing: 1px; }
    .rating-lbl { cursor: pointer; text-align: center; flex: 1; }
    .rating-lbl input { display: none; }
    .emoji-btn { padding: 10px; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 22px; transition: 0.3s; background: white; color: #555; display: flex; flex-direction: column; align-items: center; justify-content: center; }
    .rating-lbl input:checked + .emoji-btn { background: #fff5f5; border-color: var(--maroon); color: var(--maroon); transform: scale(1.05); }
    .rating-lbl .emoji-desc { font-size: 10px; margin-top: 4px; font-weight: bold; }


/* VIEW ONLY MODIFIER FOR CANDIDATES MODAL */
.candidate-option.view-only-card {
  cursor: default !important;
}
.candidate-option.view-only-card:hover {
  border-color: #dcdcdc !important;
  background: white !important;
  transform: none !important;
  box-shadow: none !important;
}
.candidate-option.view-only-card .candidate-name {
  margin-left: 0; /* Para pantay sa gitna dahil walang checkbox */
}
