/* FCIAA Voting Frontend Styles */

.fciaa-voting-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.fciaa-voting-container h2 {
    color: #1e3a8a;
    font-size: 32px;
    margin-bottom: 10px;
    text-align: center;
}

.voting-period {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    margin-bottom: 30px;
}

.fciaa-voting-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #856404;
}

#voting-message {
    margin-bottom: 20px;
}

.voting-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.voting-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.position-section {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.position-section h3 {
    color: #1e40af;
    font-size: 24px;
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 3px solid #3b82f6;
}

.vote-confirmed {
    background: #d1fae5;
    color: #065f46;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 600;
    display: inline-block;
}

.candidates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.candidate-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.candidate-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-color: #3b82f6;
}

.candidate-card.selected {
    border-color: #10b981;
    background: #f0fdf4;
    box-shadow: 0 4px 12px rgba(16,185,129,0.2);
}

.candidate-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 auto 20px;
    border: 4px solid #e5e7eb;
    transition: border-color 0.3s ease;
}

.candidate-card:hover .candidate-photo {
    border-color: #3b82f6;
}

.candidate-card.selected .candidate-photo {
    border-color: #10b981;
}

.candidate-card h4 {
    text-align: center;
    color: #1e293b;
    font-size: 20px;
    margin: 0 0 15px 0;
    font-weight: 700;
}

.candidate-bio {
    color: #475569;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: left;
}

.candidate-qa {
    background: #f8fafc;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
}

.candidate-qa h5 {
    color: #334155;
    font-size: 16px;
    margin-top: 0;
    margin-bottom: 12px;
    font-weight: 600;
}

.qa-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.qa-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.qa-item .question {
    color: #475569;
    font-size: 13px;
    margin-bottom: 8px;
    line-height: 1.5;
}

.qa-item .answer {
    color: #1e293b;
    font-size: 13px;
    margin-bottom: 0;
    line-height: 1.5;
}

.vote-button {
    width: 100%;
    padding: 14px 20px;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.vote-button:hover {
    background: #2563eb;
    transform: scale(1.02);
}

.vote-button:active {
    transform: scale(0.98);
}

.vote-button.disabled,
.vote-button:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

.candidate-card.selected .vote-button {
    background: #10b981;
}

.ask-question-button {
    width: 100%;
    padding: 10px 20px;
    background: #ffffff;
    color: #3b82f6;
    border: 2px solid #3b82f6;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.ask-question-button:hover {
    background: #eff6ff;
}

/* Modal Styles */
.fciaa-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    position: relative;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: #94a3b8;
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover,
.close:focus {
    color: #1e293b;
}

.modal-content h3 {
    margin-top: 0;
    color: #1e293b;
    font-size: 24px;
    margin-bottom: 20px;
}

#question-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    margin-bottom: 15px;
    transition: border-color 0.3s;
    resize: vertical;
}

#question-form textarea:focus {
    outline: none;
    border-color: #3b82f6;
}

#question-form .button {
    background: #3b82f6;
    color: #fff;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

#question-form .button:hover {
    background: #2563eb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .candidates-grid {
        grid-template-columns: 1fr;
    }
    
    .fciaa-voting-container {
        padding: 15px;
    }
    
    .position-section {
        padding: 20px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20% auto;
        padding: 20px;
    }
}

/* Loading state */
.vote-button.loading {
    position: relative;
    color: transparent;
}

.vote-button.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

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