/* ======================
   POPUP SYSTEM (FULLY FIXED)
   ====================== */
.logout-button {
  display: inline-block;
  padding: 10px 20px;
  background-color: #e74c3c;
  color: #fff;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.logout-button:hover {
  background-color: #c0392b;
}

#election-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#election-popup.visible {
    opacity: 1;
    display: flex;
}

.popup-content {
    background: white;
    border-radius: 10px;
    padding: 40px 30px 60px; /* Ekstra padding i bunden til close-knap */
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease, opacity 0.3s ease;
    text-align: center;
}

#election-popup.visible .popup-content {
    transform: scale(1);
}

.popup-message {
    font-size: 1.2em;
    margin-bottom: 20px;
    padding: 15px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border-radius: 5px;
}

/* FIXED CLOSE BUTTON - KLIKBAR OG SYNLIG */
.popup-close {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #e74c3c;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    z-index: 1000;
    transition: all 0.3s ease;
}

.popup-close:hover {
    background: #c0392b;
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* Loading spinner */
.loading-spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success and error states */
.popup-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.popup-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ======================
   ELECTION GRID SYSTEM
   ====================== */

.election-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

#location-consent {//*checkboks bigger*/
    transform: scale(5.0);
    margin-right: 8px;
    cursor: pointer;
}

.election-candidate {	
	border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100%; /* hvis du bruger grid med ens højde */
    padding: 20px;
    box-sizing: border-box;
    background: #fff;
    border-radius: 10px;
    position: relative;
	box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.vote-button-wrapper {
    margin-top: auto;
    padding-top: 10px;
}

.election-candidate:hover {
    transform: translateY(-5px);
}

.candidate-photo img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #eee;
}

.candidate-info h3 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 1.4em;
}

.candidate-country {
    color: #3498db;
    font-weight: 500;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.candidate-desc {
    color: #7f8c8d;
    line-height: 1.6;
}

.election-vote-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
    margin-top: 15px;
    width: 100%;
    display: block;
    text-align: center;
}

.election-vote-btn:hover:not(:disabled) {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.election-vote-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none !important;
}

/* ======================
   PRIVACY CONSENT
   ====================== */

.privacy-consent {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.privacy-consent label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 1.1em;
}

.privacy-consent input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

/* ======================
   MESSAGES
   ====================== */

.election-warning {
    background: #fff8e1;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

.election-info {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

/* ======================
   RESPONSIVE FIXES
   ====================== */

@media (max-width: 600px) {
    .election-grid {
        grid-template-columns: 1fr;
    }
    
    .popup-content {
        width: 95%;
        padding: 30px 20px 50px; /* Mere plads til close-knap på mobile */
    }
    
    .candidate-photo img {
        height: 150px;
    }
    
    .popup-close {
        width: 80%;
        padding: 10px;
        font-size: 0.9em;
    }
}