/* Modal Overlay - General Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    background: linear-gradient(135deg, rgba(20, 20, 30, 0.95), rgba(10, 10, 20, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5), 0 0 10px rgba(0, 255, 200, 0.1);
    border-radius: 12px;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.modal-title {
    margin: 0;
    font-family: 'Orbitron', sans-serif;
    color: #fff;
    font-size: 1.5rem;
    text-shadow: 0 0 10px rgba(0, 255, 200, 0.3);
}

.modal-subtitle {
    margin: -1rem 0 0 0;
    color: #aaa;
    font-size: 0.9rem;
}

/* Speech Input */
.speech-input {
    width: 100%;
    height: 150px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    color: #eee;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    resize: none;
    transition: all 0.2s;
}

.speech-input:focus {
    outline: none;
    border-color: rgba(0, 255, 200, 0.5);
    box-shadow: 0 0 10px rgba(0, 255, 200, 0.1);
}

.char-count {
    text-align: right;
    font-size: 0.8rem;
    color: #666;
    margin-top: -1rem;
}

/* Speech Display */
.speech-display {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1.5rem;
    color: #ddd;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    line-height: 1.6;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    /* Preserve newlines */
}

/* Modal Actions */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Read Speech Icon in Candidate List */
.read-speech-btn {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 1.2rem;
    margin-left: 0.5rem;
}

.read-speech-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.candidate-item {
    /* Ensure flex alignment for the new button */
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.candidate-info-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.candidate-vote-count {
    margin-left: auto;
}